mcp-scan

io.github.CodingSelim由 GitHub 账号 CodingSelim 发布v0.2.1更新于 Oct 24, 2026

Passive security scanner: audits MCP servers against the OWASP MCP Top 10, graded A-F.

发布方自己的服务:scan.mx Email Diagnostics

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

被动式安全扫描器,按 OWASP MCP Top 10 审计 MCP 服务器并给出 A–F 评级,可通过命令行或作为 MCP 服务器使用。

可以做什么
  • 扫描 MCP 服务器:审计 stdio 命令或 Streamable HTTP 端点,枚举其工具、提示与资源,输出 0–100 分与 A–F 评级。
  • 列出检查项:展示覆盖密钥泄露、注入、SSRF、路径穿越、工具投毒、权限范围、供应链、认证与遥测的 12 项静态检查。
  • 跨整个工具集推理“致命三要素”:读取私有数据、摄入不可信内容与可外泄能力同时存在。
  • 以控制台、JSON 或 SARIF 格式输出结果,并在达到可配置严重级别时返回非零退出码以用于 CI 拦截。
适用场景
适合在把陌生或第三方 MCP 服务器接入智能体之前做一次检查,也适合在 CI 中拦截 MCP 配置变更。它面向希望快速、只读地了解服务器对外暴露面的审查者,而非运行时渗透测试。
运行要求
通过 npx 以 stdio 在本地运行(npm 包 owasp-mcp-scan),需要 Node.js 以及获取该软件包的网络访问。扫描 stdio 目标会启动该命令;HTTP 目标可能需要在命令行传入 Authorization 请求头。未声明任何账号或环境变量。
安装前请注意
扫描 stdio 目标会执行该命令,因此只应扫描你信任的服务器。结果是偏向高召回的静态启发式判断,无法看到运行时沙箱,需结合上下文甄别。认证与传输检查仅适用于 HTTP 目标。作为请求头传入的令牌会出现在命令行中。

安装

在 SourceWeft 中

  1. 打开 控制台中的 mcp-scan,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

🛡️ mcp-scan

Passive security scanner for Model Context Protocol servers. Point it at any running MCP server; it audits the live server against the OWASP MCP Top 10 and grades it A–F. Read-only, so it is safe to run against production.

[npm] [License: MIT] [Node] [CI] [Tests] [OWASP MCP Top 10]

bash
npx owasp-mcp-scan --stdio "npx -y @modelcontextprotocol/server-filesystem /tmp"
[mcp-scan console report: firecrawl-mcp graded F with critical findings]

I ran it against the 12 most-installed MCP servers. 9 of them failed. No install, no config, no exploiting anything.


Why

MCP tool descriptions are fed straight into your model's context, and most public servers were never security-reviewed. A bad one can hide instructions in a description, expose a raw-shell tool, or leak a key; and your agent acts on it. Endor Labs found 82% of servers prone to path traversal, 34% to command injection.

mcp-scan is the gut-check before you wire a server in. It's passive: it reads advertised capabilities and analyzes them statically, never invoking tools, so it's safe against production servers.

How it works

  1. Connects to the server over stdio or Streamable HTTP and enumerates every advertised tool, prompt, and resource.
  2. Runs 12 static checks across that surface: secrets, injection, SSRF, path traversal, tool poisoning, excessive scope, and more.
  3. toxic-flow reasons across the whole toolset for the lethal trifecta (reads private data + ingests untrusted content + can exfiltrate), the shape single-tool scanners miss.
  4. Scores 0-100 and grades A-F (any critical forces F). Emits console, JSON, or SARIF.

It never calls a tool, never fuzzes, and never sends an exploit. The worst it does is read what the server already tells everyone.

Real findings on real servers

12 popular npm servers, actual output (snapshot 2026-07-11, full benchmark):

ServerToolsGrade🔴🟠🟡Notable
firecrawl-mcp26F2111lethal trifecta (MCP10) + code exec (MCP05)
@modelcontextprotocol/server-filesystem14F0111unconstrained path params (MCP01)
@modelcontextprotocol/server-puppeteer7F120script param executes JS (MCP05)
tavily-mcp5F031untrusted-input + exfiltration (MCP10)
@modelcontextprotocol/server-memory9F030delete_* tools, no confirmation (MCP02)
@modelcontextprotocol/server-github26D002state-changing tools (MCP02)
@modelcontextprotocol/server-slack8C010reads + posts = data + exfil (MCP10)
@modelcontextprotocol/server-everything13A000clean ✓
@kazuph/mcp-fetch1A000clean ✓

9 of 12 flagged, 3 clean, every row audited finding-by-finding, false positives stripped rather than padded. Reproduce any row yourself:

bash
npx owasp-mcp-scan --stdio "npx -y firecrawl-mcp"     # F: lethal trifecta + code execnpx owasp-mcp-scan --stdio "npx -y @modelcontextprotocol/server-everything"   # A: clean

Use it

CLI

bash
npx owasp-mcp-scan --stdio "<command>"                                  # local stdio servernpx owasp-mcp-scan --url https://host/mcp --header "Authorization: Bearer $TOKEN"npx owasp-mcp-scan --config ~/.cursor/mcp.json --format sarif --output mcp.sarif

As an MCP server, let your agent scan servers on demand ("scan this MCP server before I add it"). Add to any client; this mcpServers shape works in Claude Code, Claude Desktop, Cursor, Windsurf, VS Code, and Gemini CLI:

json
{ "mcpServers": { "mcp-scan": { "command": "npx", "args": ["-y", "owasp-mcp-scan", "--serve"] } } }

OpenAI Codex (~/.codex/config.toml):

toml
[mcp_servers.mcp-scan]command = "npx"args = ["-y", "owasp-mcp-scan", "--serve"]

Exposes two tools: scan_mcp_server (audit a stdio/HTTP target) and list_checks.

Claude Code plugin

/plugin marketplace add CodingSelim/mcp-scan/plugin install mcp-scan@mcp-scan

Also on the official MCP registry as io.github.CodingSelim/mcp-scan. Publishing steps: PUBLISHING.md.

What it checks

Full OWASP MCP Top 10 (2025) coverage, 12 checks:

CheckOWASPCatches
secret-exposureMCP01AWS / OpenAI / Anthropic / GitHub / GitLab / Stripe / SendGrid / npm / HF / DB URIs / JWT / private keys in advertised text
transportMCP01Plaintext http:// to a non-loopback host
path-traversalMCP01file:///{path} templates and unconstrained path params
excessive-scopeMCP02Destructive tools (delete, drop, transfer) with no confirmation
tool-poisoningMCP03Instruction overrides, hidden exfiltration directives, zero-width / Unicode-tag smuggling
tool-shadowingMCP03 / MCP09Duplicate tool-name collisions and "call me first" precedence injection
supply-chainMCP04 / MCP09Unpinned/placeholder versions and homoglyph server names
command-injectionMCP05Unconstrained command / shell / code params, raw SQL, advertised execution
ssrfMCP05Arbitrary url / host params with no allowlist
tool-poisoning (dynamic)MCP06Injection in resource contents and server instructions
authnMCP07HTTP servers that complete an unauthenticated handshake
telemetryMCP08High-impact tools with no audit trail (advisory, unscored)
toxic-flowMCP10Lethal trifecta: one server that reads private data, ingests untrusted content, and can exfiltrate

toxic-flow is the standout, it reasons across the whole toolset, catching the GitHub-MCP / email-agent injection shape that per-tool checks miss.

Output & CI

console (default) · json · sarif (GitHub Code Scanning). Exit code is non-zero at/above --fail-on (default high), so it gates CI:

yaml
- run: npx owasp-mcp-scan --url ${{ secrets.MCP_URL }} --format sarif --output mcp.sarif- uses: github/codeql-action/upload-sarif@v3  with: { sarif_file: mcp.sarif }

Limitations (read these)

  • Static analysis can't see runtime sandboxing, a server that safely confines paths still flags them. Verify against actual enforcement.
  • Auth and transport checks apply to HTTP targets only.
  • Heuristics favor recall, so triage findings in context. When a rule is tightened to kill a false positive, a test pins the intended behavior.
  • Scanning a stdio target spawns that command, so run it only on servers you trust.

Develop

bash
npm install && npm run build && npm test   # 48 tests, incl. live end-to-end fixture scans

Checks are pure and isolated (src/checks/), reusing detectors in src/detectors/. See CONTRIBUTING.md.

References

OWASP MCP Top 10 · MCP Security Cheat Sheet · Vulnerable MCP Project · MCPTox

MIT © CodingSelim

来源:README.md,提交 cdb4707

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Scan 集成