MCP Gatekeeper
The QA framework for the MCP ecosystem
46 validators · 8 gates · Schema · Security · Functional · AI Eval · Human Review
Quick Start · What It Catches · Gates · AI Evaluation · Use as MCP Server
______________________________________________________________________
MCP有200多个服务器实现,但在发布之前没有质量门。 MCP看门人填补了这一空白。
在发布到MCP注册表、npm或Smithery之前运行它。它捕获了其他工具遗漏的模式违规、安全漏洞、功能错误和质量问题,包括基于LLM的语义评估,用于比较您的工具 *声称* 反对他们所做的 *实际上* 同上
npx mcpqa run --server-url https://your-mcp-server.com/mcp它捕获了什么
在生产Zoho MCP服务器上运行的真实结果(65个工具):
| 发现 | 门 | 这意味着什么 |
|---|---|---|
| 125个工具默默接受无效输入 | 功能正常 | 服务器返回 isError: false 对于空/错误的类型参数 |
| 107个参数没有描述 | 架构 | LLM不能使用带有未记录参数的工具 |
| 26个写入工具缺少速率限制信息 | 安全性 | 消费者不知道是否有节流阀 |
| 输出中反映的SQL注入有效负载 | 安全性 | 动态注入测试发现了真正的漏洞 |
| 工具描述与实际行为不符 | AI评估 | Claude将描述与调用结果进行了比较 |
快速开始
# Validate an MCP server (Gates 1-3: schema + security + functional)
npx mcpqa run --server-url https://your-server.com/mcp
# Add AI semantic evaluation (Gate 4 — requires Anthropic API key)
ANTHROPIC_API_KEY=... npx mcpqa run --server-url https://your-server.com/mcp --gates 1,2,3,4
# Validate a Claude Code skill
npx mcpqa run --skill-path ./.claude/skills/my-skill --gates 6
# Validate an extension
npx mcpqa run --extension-path ./my-extension --gates 7
# Validate your npm package before publishing
npx mcpqa run --package-path . --gates 8
# Everything at once
npx mcpqa run --server-url https://server.com/mcp --package-path . --gates 1,2,3,4,8 --mode lenient大门
| 门 | 它验证了什么 | 验证器 | 速度 |
|---|---|---|---|
| 1.架构 | 协议一致性、工具名称、JSON模式、描述、参数类型 | 6 | \ # Compare two reports |
mcpqa dashboard [--port N] # Launch human review UI
Options: --server-url MCP server URL (http/sse) --server-cmd MCP server command (stdio) --skill-path Claude Code skill directory --extension-path Extension directory --package-path npm package directory --gates Gate numbers (e.g., 1,2,3,4,6,7,8) --mode Stop on first fail vs run all --trials LLM evaluation trials for pass@k --save-baseline Save results for regression tracking --check-regression Compare against saved baseline --verbose / --debug Control log verbosity --dry-run Show what would run without executing
## 报告
|格式|文件|用例|
|--------|------|----------|
|Console | stdout |带有彩色徽章和进度条的实时进度|
|JSON| `reports/latest.json` |CI/CD集成,程序化访问|
|HTML| `reports/latest.html` |面向利益相关者的黑暗主题视觉报告|
|萨里夫| `reports/latest.sarif` |GitHub代码扫描,VS代码SARIF查看器|
|成绩单| `reports/transcripts/` |Gate 4 LLM会话调试|
## CI/CD集成
GitHub Actions
- name: Validate MCP Server
run: npx mcpqa run --server-cmd "node dist/server.js" --gates 1,2,3,8 # Exit code 0 = pass, 1 = fail
Docker
docker build -t mcpqa . docker run mcpqa run --server-url https://server.com/mcp
## 配置
configs/default.yaml
pipeline: mode: strict enabledGates: [1, 2, 3]
server: transport: http url: https://your-server.com/mcp headers: Authorization: "Bearer your-token"
semantic: trials: 3 # pass@k evaluation autoApproveThreshold: 4.5 # Gate 5 auto-approve
reporting: formats: [console, json, sarif] outputDir: ./reports
## 发展
npm install npm test # 172 tests npm run lint # type-check npm run build # compile to dist/
## 建筑
CLI (mcpqa) ─┐ ┌─ MCP Server (mcpqa-server) │ │ ▼ ▼ PipelineOrchestrator (shared core) │ ┌─────────┼──────────┬──────────┐ ▼ ▼ ▼ ▼ Gate 1-3 Gate 4 Gate 5 Gate 6-8 Code LLM Judge Dashboard File (24 val) (7 val) (htmx) (15 val)
## 贡献
PR欢迎。每个验证器都是一个实现 `IValidator`。要添加新支票,请执行以下操作:
1. 创建 `src/gates/gateN-name/validators/your-check.ts`
1. 实施 `IValidator` 接口(名称、描述、验证)
1. 在登机口登记 `index.ts`
1. 在中添加测试 `tests/unit/gateN/`
## 许可证
麻省理工学院
## 链接
- [MCP规范](https://modelcontextprotocol.io/specification)
- [MCP官方登记处](https://registry.modelcontextprotocol.io/)
- [人性化安全带设计](https://www.anthropic.com/engineering/harness-design-long-running-apps)
- [人类学评价框架](https://www.anthropic.com/engineering/demystifying-evals-for-ai-agents)