Pre-install security scans for npm packages, MCP servers, and AI agents with cited verdict evidence.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Inspect an npm package or MCP server before you install or connect to it, and
get a deterministic, evidence-backed SAFE, REVIEW, or BLOCK verdict.
Local, zero-dependency static analysis β normal scans never execute package code.
Website Β· Documentation Β· Calibration Β· Report a bug
Real runs: guard clears express@4.21.0, then blocks a sample modeled on the 2024 @solana/web3.js compromise.
1. Quick start Β· 2. What it scans & detects Β· 3. Verdicts Β· 4. Usage Β· 5. Integrations Β· 6. How it compares Β· 7. Documentation
AI coding assistants install packages and connect to MCP servers at machine
speed, often without a human reading the code. Sonatype identified more than
454,600 new malicious open-source packages across monitored ecosystems in
2025, over 99% of them on npm
(Sonatype).
npm audit asks does this have a known CVE?; pkgxray also asks what does the
code actually do β before anything installs.
1. Scan a known-benign package (no install of pkgxray needed):
It stages the tarball in quarantine and runs the static and supply-chain checks
β no npm install, no lifecycle scripts, no package code executed.
2. Read the verdict:
| Verdict | Exit | Meaning |
|---|---|---|
SAFE | 0 | No high- or medium-risk indicators; default policy permits promotion. |
REVIEW | 3 | Evidence is incomplete or a privileged capability needs human review. |
BLOCK | 2 | High-severity cited evidence β reject or investigate. |
SAFE is not a proof that a package is harmless; static analysis cannot see a
payload downloaded only at runtime. See the threat model.
3. See a BLOCK on the supplied inert fixture:
The fixture is inert source text modeling a split-string SSH-key read and
exfiltration β it is never executed. It returns BLOCK (exit 2) with the
cited file and evidence.
4. Add it to your workflow β rechecks & CI, MCP, Hookshot install gate.
Two execution models. Default
guardandauditscans are static β package code is never executed. Enumerating an MCP server may spawn it andmcp-proxyruns it behind a gate; the opt-incanaryis the one deliberate exception that executes the package in a sandbox to confirm behavior β it can confirm malice but never prove a package safe. Full boundary: SECURITY.md.
Scans β pkgxray guard npm:name@version or pypi:name@version,
github:owner/repo, a local directory, whole lockfiles across two ecosystems
(npm: package-lock.json, yarn.lock, pnpm-lock.yaml, package.json; PyPI:
requirements.txt, poetry.lock, Pipfile.lock, pyproject.toml), MCP
servers, and AI-agent extensions.
Detects β credential theft (incl. split-fragment paths), cloud
instance-metadata and secret-store harvesting, prompt injection, Unicode
smuggling, base64 payloads and stage-2 loaders, exfiltration, persistence
(shell profile, OS scheduler, and injected CI/CD workflows), self-deleting
droppers, registry worm replication (install-time npm publish), npm
install-hook and PyPI setup.py install-time execution, obfuscated computed-arg
execution, hallucinated / slopsquat names (a lockfile pin the registry never
published), known CVEs (via OSV, before download), npmβGitHub artifact
divergence, trojaned updates (recheck), and MCP
capability-surface abuse.
The full coverage matrix β and the known download-later blind spot β is in the threat model; a side-by-side comparison table is on the website.
| Verdict | You should |
|---|---|
SAFE | Install. Only safe promotes out of quarantine by default. |
REVIEW | Inspect the quarantined copy before promoting. |
BLOCK | Do not install. Every finding names the file and evidence. |
Exit codes are stable and CI-friendly: 0 safe/allow Β· 2 block Β·
3 review.
One optional .pkgxray.json (read by every surface) tunes policy; zero config
means maximum strictness. CVEs can never be allowed away, every loosening is
printed, and a scan that errors fails closed to review. Schema and invariants:
configuration.md Β· .pkgxray.example.json.
One engine behind every entry point. "Works with" means a documented setup guide, not a vendor-endorsed integration.
| Where | What it does | Guide |
|---|---|---|
| Coding agents β Codex, Claude Code, Cursor, Windsurf | Gate installs and expose the audit tools to the agent | coding-agents.md |
| MCP clients | Vet a server before connect; run pkgxray itself as an MCP server | mcp.md |
| GitHub Actions / CI | Fail a build when a dependency crosses policy | github-actions.md |
| Install gate β Hookshot | Run guard on every package an agent tries to install | examples/hookshot/ |
| Runtime MCP gate | Proxy a live MCP server and gate every tool call | mcp-proxy |
| Dependency monitoring | Re-vet installed deps and pre-vet upgrades on a schedule | recheck |
Run pkgxray alongside npm audit / OSV-Scanner, not instead of them β they
answer "known CVE?". Against tools in the same lane (behavioral supply-chain
vetting β Socket.dev, OpenSSF Package Analysis, Cisco MCP Scanner), the full
capability comparison is in docs/comparison.md and on the
website.
The zero-heuristic-false-block calibration on the top-1000 most-downloaded packages is regression-gated in CI (scope & methodology), and the published runs live at pkgxray.ca/stats. That claim is scoped to the most-installed set β not a claim of zero false blocks on every package.
| Doc | What it covers |
|---|---|
| architecture.md Β· design.md | Pipeline, surfaces, principles |
| threat-model.md | Scope, blind spots, prompt-injection stance |
| mcp.md Β· mcp-registry.md | MCP vetting, runtime proxy, registry entry |
| canary-threat-model.md | The opt-in behavioral canary |
| configuration.md Β· reference.md | .pkgxray.json, severity policy, recheck, cache server |
| benchmark.md Β· comparison.md | Calibration and how it compares |
| compatibility.md Β· json-schema.md | 1.0 contract, --format json schema |
Start at the documentation index.
Pull requests are welcome β read CONTRIBUTING.md and the Code of Conduct. Report vulnerabilities privately per SECURITY.md. Releases publish to npm with provenance (SLSA attestation), gated on tests, the calibration benchmark, and pkgxray's own supply-chain guard.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/pkgxray)<a href="https://allmcps.com/mcp/pkgxray"><img src="https://allmcps.com/api/badge/pkgxray?style=directory" alt="Pkgxray on AllMCPs" /></a>