mcp兽医
MCP(模型上下文协议)服务器的开源安全审计员。在将服务器定义和源代码连接到Claude或其他AI代理之前,扫描它们是否存在漏洞。
快速开始
# Auto-discover and audit all MCP configs on your machine
npx mcp-vet
# Audit a specific config file
npx mcp-vet audit ./mcp.json
# Audit an npm package directly
npx mcp-vet audit @modelcontextprotocol/server-filesystem它检测到什么
30条检测规则 跨越8个攻击向量:
| 矢量 | 规则 | 示例 |
|---|---|---|
| 提示注入 | PI-001–008 | 覆盖关键字、保密指令、Unicode混淆、身份注入 |
| 工具中毒 | TP-001–004 | 名称相似,名称描述不匹配,隐藏尾随文本 |
| 数据过滤 | DE-001–003 | 描述中的外部URL、凭证收集参数 |
| 特权升级 | PE-001–003 | OAuth范围过广,工具组合危险,网络绑定 |
| 拒绝钱包 | DW-001–002 | 递归调用指令,缺少速率限制 |
| 跨服务器 | TS-001–003 | 跨工具说明、取样、有毒物流图 |
| 实现漏洞 | SC-001–004 | 命令注入、SSRF、路径遍历、SQL注入 |
| 供应链 | SU-001–003 | 已知CVE、凭证管理、不可信内容 |
特性
- 外部API调用为零 --一切都在本地运行,没有任何东西离开你的机器
- 实时服务器连接 --通过stdio连接,提取真实的工具定义
- 基于AST的源分析 --用途
ts-morph对于Types/JavaScript和tree-sitter(WASM)用于Python污染跟踪 - 多种输出格式 --终端、JSON、HTML报告、SARIF 2.1.0
- CI/CD就绪 —
--ci在关键/高发现时标记出口1 - 自动发现 --自动查找Claude Desktop、Claude CLI、VS Code MCP配置
- 信任评分 --A-F级,具有关键漏洞的自动故障条件
命令
npx mcp-vet # Auto-discover and scan all MCP configs
npx mcp-vet --project # Scan only project-level configs
npx mcp-vet audit # Audit a config file or npm package
npx mcp-vet audit --json # JSON output
npx mcp-vet audit --report # Generate HTML report
npx mcp-vet audit --sarif out.sarif # SARIF output
npx mcp-vet audit --ci # CI mode (exit 1 on critical/high)
npx mcp-vet audit --no-source # Skip source code analysis
npx mcp-vet diff
# Rug-pull detection vs snapshot
npx mcp-vet graph
# Show toxic flow graph
npx mcp-vet list-rules # List all 30 detection rules输出示例
╔═════════════════════════════════════════════════════════╗
║ ║
║ Trust Score: 24/100 Grade: F ║
║ ║
║ ⚠ AUTO-FAIL: Command injection (SC-001) ║
║ ║
╚═════════════════════════════════════════════════════════╝
Findings (4)
─────────────────────────────────────────────────────────
CRITICAL SC-001 Command Injection
├─ Tool: index.js
├─ Unsanitized input passed to exec() (22 instances)
├─ Evidence: exec(command) at line 19494
└─ Fix: Use parameterized execution (e.g., execFile with array args)评分工作原理
- 100分 根据发现的严重程度扣除基数
- 严重:-25,高:-15,中:-8,低:-3,信息:0
- 自动故障 (强制F级):保密指令、未经消毒的输入指令注入、保密指令覆盖
- 等级:A(90-100),B(70-89),C(50-69),D(30-49),F(0-29)
需求
- Node.js 20+
许可证
麻省理工学院
