import-guardian
MCP ServerCatch AI-hallucinated (slopsquatted) npm imports in generated code before npm install.
Install
claude mcp add import-guardian -- npx -y import-guardian-mcpWhat is import-guardian?
Catch AI-hallucinated (slopsquatted) npm imports in generated code before npm install.
Trust
74/100 · Good3 factors scored below maximum
Documentation
README · ~8 min readimport-guardian 🪝
Catch AI-hallucinated (slopsquatted) npm imports in generated code — before you run npm install.
An LLM just wrote some code. It might import a package that doesn't exist — a name the model confidently hallucinated. Attackers register exactly those names and ship malware. This is slopsquatting, and in 2026 it's one of the fastest-growing supply-chain attacks: code generators have been observed referencing 205,000+ unique non-existent package names, and real hallucinated packages (react-codeshift, a fake huggingface-cli with 30k+ downloads) have already shown up in the wild.
import-guardian reads the generated code, extracts every npm package it imports, and tells you which ones are real — so an agent never installs a name its own model invented.
It's part of the guardian set: npm-guardian audits a package you've already chosen for CVEs and malicious behaviour, license-guardian audits the licenses of your dependencies (GPL/AGPL/BUSL traps) before you ship, and lockfile-guardian audits the resolved package-lock.json for integrity tampering and risky install scripts. import-guardian works one step earlier than all of them, at the moment the code — and its dependency names — are generated.
What it catches
| 👻 Hallucinated | imports of packages that do not exist on npm — the model invented the name. Returns BLOCK with a "did you mean" to the closest real package. |
| 🪤 Fresh squats | packages that do exist but were published days ago, have no source repo, near-zero downloads, or are a 1–2 edit typo of a popular library. Returns REVIEW. |
Reviews
Log in to leave a review.
No reviews yet — be the first.
Explore related
Other things in this space — across every part of the ecosystem, not just mcp servers.
MCP Serverssimilar to this one
All mcp servers →Official MCP Servers Collection
Model Context Protocol Servers
89.1K stars
context7
Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors
60K stars
pal-mcp-server
The power of Claude Code / GeminiCLI / CodexCLI + [Gemini / OpenAI / OpenRouter / Azure / Grok / Ollama / Custom Model / All Of The Above] working as one.
11.7K stars