pkgtruth
Provides tools to verify npm package trustworthiness before installation, checking registry existence, security placeholders, impersonation, install scripts, deprecation, adoption, and maintenance status.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pkgtruthCheck if unused-imports is a hallucinated package before adding it to my project."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
pkgtruth
Ground truth about npm packages, for AI coding agents and CI.

Your agent just wrote npm install unused-imports. That package is not the
linter plugin it meant. It is a name an attacker registered because models
kept inventing it — and npm has since replaced it with a security placeholder.
pkgtruth catches that before it reaches your lockfile.
Why this exists
Large language models invent package names. Measured across models, 19.7% of generated package names were hallucinated, and when researchers re-ran the prompts, 43% of those names came back every single time.
That reproducibility is the whole attack. An attacker does not need to compromise a maintainer, poison a build server, or find a vulnerability. They watch what models invent, register the name, and wait. The technique is called slopsquatting, and it is already happening in the wild.
The standing security advice is that agents with package-management
capabilities should not install anything without a review gate. pkgtruth is
that gate, in a form an agent can call on its own.
Related MCP server: npm-guardian
Install
As an MCP server (for coding agents)
{
"mcpServers": {
"pkgtruth": {
"command": "npx",
"args": ["-y", "pkgtruth"]
}
}
}Two tools become available:
Tool | Use it when |
| About to add, import, or recommend one dependency |
| About to write a |
As a CLI (for humans and CI)
npx pkgtruth check express unused-imports
npx pkgtruth scan .scan reads every dependency in a package.json and exits non-zero when
something is blocking, so it drops straight into CI:
- name: Block hallucinated and slopsquatted dependencies
run: npx pkgtruth scan . --fail-on dangerWhat it checks
Signal | Meaning |
Not in registry | The name is fabricated. Nothing to install. |
npm security placeholder | npm removed malicious code published under this name. |
Impersonates a popular package | A near-identical name with a fraction of the adoption. |
Install-time scripts |
|
Deprecated | Upstream says stop using it. |
Very new / almost no adoption | Days old with single-digit installs. |
No repository | No source to audit. |
Unmaintained | No release in years. |
Verdicts are SAFE, CAUTION, DANGER, HALLUCINATED, or UNKNOWN. Every
one arrives with the evidence behind it — an agent should never have to take
"DANGER" on faith, and neither should you.
Design notes
Network failures never open the gate. If the registry is unreachable, the
verdict is UNKNOWN, never SAFE. A degraded network must not silently turn
a security check into a no-op.
Popular packages are not flagged. Checked against a real 18-dependency project, zero false positives. A gate that cries wolf gets switched off.
No build step. Two direct dependencies — the MCP SDK and zod, both only
needed for the server. npx pkgtruth starts immediately.
Limitations
Read these before trusting it:
npm only. PyPI, crates.io, and Go modules are not covered yet.
Registry metadata only. It does not analyze package source code, so a legitimate-looking package with a malicious payload can still pass.
Not a replacement for
npm auditor Snyk. Those find known CVEs in code you already trust.pkgtruthasks the earlier question: should this package be here at all?New legitimate packages will get
CAUTION. That is deliberate. Newness genuinely is a risk signal; use--fail-on dangerso it does not block.
Options
--json Machine-readable output
--fail-on <level> danger (default) | caution--fail-on caution also blocks packages that could not be verified at all,
since "we could not check" is not a pass.
Exit codes: 0 clean, 1 blocking packages found, 2 usage or runtime error.
Configuration
Variable | Default | Purpose |
|
| Per-request timeout |
|
| Retries for 429/5xx/network errors |
| per-host | Override request pacing |
| npm | Alternate registry |
| npm | Alternate downloads API |
|
| Where adoption figures are cached |
| 6 hours | How long a cached figure stays usable |
| unset | Set to |
On speed and rate limits
Adoption figures come from npm's downloads API, which throttles bursts and
cannot batch scoped names — a project with several @scope/pkg dependencies
would spend its whole budget on every scan.
Three things keep that in check: the bulk endpoint resolves all unscoped names in one request, requests to that host are paced serially, and figures are cached on disk for six hours. Weekly download counts move slowly, so a six-hour-old number is no less true.
A warm scan of ~18 dependencies takes about 1.4 seconds. A cold one after
heavy use may return UNKNOWN for some packages — that is the intended
failure mode. A throttled lookup never becomes SAFE; re-run, and the cache
will answer.
Cached figures are keyed by the API they came from, so pointing
PKGTRUTH_DOWNLOADS_API at a private registry never reuses npm's numbers.
Contributing
Issues and pull requests are welcome at github.com/hxckya/pkgtruth.
Two things make a report especially useful: a legitimate package that gets flagged, and a malicious one that slips through. Both are regression tests waiting to be written.
npm test # offline
npm run test:online # includes live registry checksLicense
MIT © hxckya
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityFmaintenanceActs as a security checkpoint for AI coding agents by intercepting package installations to verify existence, check against CVE databases, and block vulnerable or hallucinated dependencies before they reach your codebase. Provides seven security tools including pre-install gates, full project audits, safe version recommendations, and deep transitive dependency scanning for npm and PyPI packages.7134MIT
- AlicenseNot gradedqualityCmaintenanceAudits npm packages for supply-chain attacks (typosquatting, malicious install scripts, credential exfiltration) before installation, returning a SAFE/SUSPICIOUS/DANGEROUS verdict.MIT
- AlicenseNot gradedqualityDmaintenanceAudits your package-lock.json for supply-chain attacks before install. Cross-checks every resolved entry against the live npm registry to detect integrity mismatches, new install scripts, and other malicious signals.MIT
- AlicenseAqualityDmaintenanceDependency security & health auditing for AI agents with no account or API key required.22MIT
Related MCP Connectors
Provide AI-powered real-time analysis and intelligence on NPM packages, including security, depend…
Package intelligence for AI agents across npm, PyPI, crates.io and deps.dev. No API keys.
Supply chain risk scoring for npm, PyPI, Cargo, and Go. 9 tools. Behavioral signals.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hxckya/pkgtruth'
If you have feedback or need assistance with the MCP directory API, please join our Discord server