mcp-package-audit is an open-source CLI I built for a gap that got worse as MCP went mainstream: people wire new servers into Cursor and Claude Desktop after a single npx line, with far less review than they give production Node dependencies. Attackers already publish malicious npm packages that harvest credentials and rewrite assistant configs. This tool answers a blunt question before you enable something: should I trust this MCP package or agent config?
Source: github.com/mr-Imran/mcp-package-audit (MIT). Published on npm as mcp-package-audit; also runnable as npx audit-mcp.
Quick start
# Audit a package on the npm registry (metadata + tarball heuristics)
npx mcp-package-audit <package[@version]>
# Audit the package in the current directory
npx mcp-package-audit
# Scan local Cursor / Claude MCP configs (and hinted packages)
npx mcp-package-audit --config
# JSON for CI
npx mcp-package-audit pkg some-mcp-server --json --fail-on high
What it checks
| Area | Signals |
|---|---|
| Lifecycle scripts | preinstall / install / postinstall, curl|sh, eval, base64, env exfil, miners |
| Registry metadata | Missing repository, template description, no maintainers, no provenance |
| Tarball / source | Discord/Slack webhooks, credential paths, obfuscation, child_process, install helpers |
| Agent configs | Cursor .cursor/mcp.json and Claude Desktop config — npx runtime installs, shell pipes, secret env keys |
Architecture (v1.1)
The CLI is layered so a security scanner can fail closed: thin argv and exit codes in cli.ts, orchestration in audit.ts, packument/tarball fetch with timeouts and byte caps, SRI integrity checks with zero deps, capped ustar extract, deterministic rules, and an LRU cache with bounded parallel hint audits. No runtime dependencies — a smaller install surface for a trust tool.
Who this is for
If you install MCP servers into Cursor or Claude, or you ship agent configs that pull packages via npx, run this before you enable anything new. If you need a malware proof certificate, this is not that — it is a fast red-flag pass you can put in CI.
I maintain the project at github.com/mr-Imran/mcp-package-audit and on npmjs.com/package/mcp-package-audit.
Frequently asked questions
What is mcp-package-audit?
mcp-package-audit is a free, MIT-licensed CLI by Mohammad Nizam Uddin Imran that audits MCP packages and Cursor/Claude agent configs for risky lifecycle scripts, missing provenance, obfuscation, and other supply-chain red flags.
How do I run it?
Use npx mcp-package-audit <package[@version]>, npx mcp-package-audit with no args to audit the current directory, or npx mcp-package-audit --config to scan local Cursor and Claude MCP configs. The alias npx audit-mcp works the same way.
Does a clean report mean a package is safe?
No. It is a heuristic scanner, not a guarantee of safety. Combine it with tools like Socket or Snyk, pinned versions, and human review. The package itself ships with no install scripts.
Can I use it in CI?
Yes. Run with --json and --fail-on critical|high|medium|low|info (default high). Exit code 1 means findings met the fail threshold.
Does it have runtime dependencies?
No. Version 1.1 is layered with zero runtime dependencies so the install surface of a trust tool stays small.