ClaudeSuperPower
I

import-guardian

MCP Server

Catch AI-hallucinated (slopsquatted) npm imports in generated code before npm install.

Install

claude mcp add import-guardian -- npx -y import-guardian-mcp

What is import-guardian?

Catch AI-hallucinated (slopsquatted) npm imports in generated code before npm install.

Trust

74/100 · Good

3 factors scored below maximum

Documentation

README · ~8 min read

import-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

👻 Hallucinatedimports 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 squatspackages 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.