npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcpeek

v1.2.0

Published

Source-code-level security scanner for MCP (Model Context Protocol) server implementations

Readme

MCPeek

npm version npm downloads License: MIT

Source-code security scanner for MCP (Model Context Protocol) server implementations.

Unlike config/runtime scanners, mcpeek reads your source code and detects vulnerabilities at the AST level — understanding MCP SDK patterns like server.tool() and server.setRequestHandler() and tracking taint from handler parameters to dangerous sinks.

Quick start

# Scan a GitHub repo
npx mcpeek scan https://github.com/org/your-mcp-server

# Scan a local directory
npx mcpeek scan ./my-mcp-server

# Run only specific rules
npx mcpeek scan ./my-server --rules command-injection,sql-injection

# CI mode (exit 1 on high+ severity findings)
npx mcpeek scan ./my-server --ci --fail-on high

# Output as SARIF (GitHub Code Scanning compatible)
npx mcpeek scan ./my-server --format sarif --output findings.sarif

Scan options

| Flag | Description | |------|-------------| | -f, --format <format> | Output format: markdown (default), json, or sarif | | -o, --output <file> | Write output to a file instead of stdout | | --rules <list> | Comma-separated rules to run (default: all) | | --registrations <names> | Comma-separated custom tool-registration wrapper functions (e.g. registerMyTool) to treat like server.tool() | | --taint-context | Treat the handler's second (context) parameter as attacker-controlled | | --include-tests | Also scan example/test/demo files that are excluded by default | | --ci | Exit with code 1 if findings at or above --fail-on severity are present | | --fail-on <severity> | Minimum severity to trigger CI failure: critical / high / medium / low (default: high) |

Detection rules

| Rule | Severity | CWE | Description | |------|----------|-----|-------------| | mcp-command-injection | Critical | CWE-78 | Tool handler param flows to exec / spawn / execFile without sanitization | | mcp-code-injection | Critical | CWE-94 | Tool handler param flows to eval, new Function, or vm.runIn* / vm.Script | | mcp-sql-injection | Critical | CWE-89 | Tool handler param flows to raw DB query sinks (query, $queryRawUnsafe, execute, …) | | mcp-path-traversal | High | CWE-22 | Tool handler param flows to fs operations without a boundary check | | mcp-ssrf | High | CWE-918 | Tool handler param flows to fetch / axios / got without an allowlist | | mcp-tool-poisoning | High | CWE-74 | Tool name/description contains prompt-injection keywords, hidden Unicode, ANSI escapes, or violates MCP naming rules | | mcp-missing-input-validation | High | CWE-20 | Tool registered without a Zod schema | | mcp-hardcoded-credential | High | CWE-798 | API key / token / secret hardcoded in source or committed .env files | | mcp-weak-input-validation | Medium | CWE-20 | Schema uses z.any() / z.unknown() | | mcp-weak-schema-bounds | Medium | CWE-20 | Zod schema accepts user input without size, range, or pattern bounds |

Each finding includes a taintChain showing how user input reaches the sink — e.g. cmd (handler param) → command (line 3) → execSync() (line 5).

Batch audit

# Scan all servers in a targets file
npx mcpeek audit --targets targets/top-30.json --output results/

The bundled targets/top-30.json lists verified TypeScript MCP servers and is what we use for the project's own corpus runs.

Output formats

--format markdown (default), json, or sarif. SARIF 2.1.0 output includes codeFlows derived from the taint chain, so findings render in GitHub Code Scanning with the full path from parameter to sink.

Install

npm install -g mcpeek
# or one-shot
npx mcpeek scan <target>

Use in CI

Run MCPeek directly with npx in any GitHub Actions workflow:

- uses: actions/checkout@v4
- uses: actions/setup-node@v4
  with:
    node-version: "20"
- run: npx mcpeek scan . --ci --fail-on high

To upload findings to GitHub Code Scanning, emit SARIF and hand it to upload-sarif (the job needs security-events: write):

permissions:
  contents: read
  actions: read
  security-events: write

steps:
  - uses: actions/checkout@v4
  - uses: actions/setup-node@v4
    with:
      node-version: "20"
  - run: npx mcpeek scan . --format sarif --output mcpeek.sarif
  - uses: github/codeql-action/upload-sarif@v3
    if: always()
    with:
      sarif_file: mcpeek.sarif

License

MIT