mcpsnoop
Zero-dependency MCP server inspector for protocol conformance, tool annotations, and capability checks.
README
mcpsnoop
Zero-dependency MCP server inspector — protocol conformance, tool annotations, and capability checks.
"Validate your MCP server before your users do."
mcpsnoop statically analyzes a Python MCP server module and reports protocol violations, missing tool annotations, and capability gaps — without installing the MCP SDK or standing up a live server.
Quick Start
pip install mcpsnoop-mcp-mcp-mcp
from mcpsnoop import inspect_server, check_capabilities, lint_annotations
# Inspect a Python MCP server module (stdlib only, no mcp SDK import required)
issues = inspect_server("path.to.your.server_module")
# Returns: list of Issue(severity, code, message, path)
# Check capability declarations against a target MCP version
gap = check_capabilities(server_module, target_version="1.0.0")
# Lint tool annotations for MCP 1.x compliance
report = lint_annotations(server_module)
CLI
# Inspect a Python file
mcpsnoop inspect ./src/myserver.py --target-version 1.0.0
# Lint tool annotations
mcpsnoop lint ./src
# Check capability declarations
mcpsnoop check-capabilities ./src/myserver.py --target 1.0.0
# Output formats
mcpsnoop inspect ./src --output sarif # SARIF format for CI
mcpsnoop inspect ./src --output json # Raw JSON
# Run as stdio MCP server (for use inside MCP-powered agents)
mcpsnoop serve --inspect ./path/to/server.py
⚡ Performance & Benchmarks
| Workload | Tools | mcpsnoop (mean) | mcpaudit (mean) | Speedup |
|---|---|---|---|---|
| empty_module | 0 | 19.45ms | N/A | N/A |
| few_tools | 2 | 19.08ms | N/A | N/A |
| many_tools | 50 | 18.98ms | N/A | N/A |
| mixed_issues | 30 | 19.25ms | N/A | N/A |
| large_file | 200 | 19.40ms | N/A | N/A |
Benchmarked on: Linux (Python 3.11). mcpaudit requires Node.js and is not available in this environment — mcpsnoop is zero-dependency and runs entirely offline. Run: python3 benchmarks/run_benchmark.py
Key Features
- Zero runtime dependencies — stdlib only (
importlib,json,typing) - Static analysis — no live server, no network, works offline in CI
- Three inspection dimensions: protocol conformance, tool annotations, capability gaps
- MCP stdio server mode — exposes a
snooptool for use inside MCP agents - SARIF output — CI-friendly integration with GitHub Actions, Semgrep, etc.
- Python 3.11+ with full type hints
API Reference
mcpsnoop.inspect_server(module_path: str) -> list[Issue]
Inspect a Python MCP server module and return protocol conformance issues.
Issue codes:
| Code | Severity | Meaning |
|---|---|---|
TOOL_MISSING_INPUT_SCHEMA |
HIGH | Tool has no inputSchema or input_schema field |
TOOL_MISSING_NAME |
HIGH | Tool dict is missing the name field |
NAME_CAMEL_CASE |
LOW | Tool name is not camelCase per MCP convention |
MODULE_NOT_FOUND |
HIGH | Module/path could not be resolved |
MODULE_IMPORT_ERROR |
HIGH | Module loaded but raised an exception |
Example:
from mcpsnoop import inspect_server
issues = inspect_server("my_mcp_server")
for issue in issues:
print(f"[{issue.severity.value}] {issue.code.value}: {issue.message}")
mcpsnoop.check_capabilities(module_path: str, target_version: str = "1.0.0") -> CapabilityGap
Check capability declarations against a target MCP version. Returns CapabilityGap(missing, deprecated, extra).
Version support:
| Version | Expected capabilities |
|---|---|
1.0.0 |
roots, sampling, resources |
2.0.0 |
roots, sampling, resources, prompts, tools + deprecated logging |
mcpsnoop.lint_annotations(module_path: str) -> AnnotationReport
Lint tool annotations for MCP 1.x compliance. Checks for idempotentHint, openWorldHint, readOnlyHint. Returns AnnotationReport(missing_idempotent_hint, missing_open_world_hint, missing_read_only_hint).
mcpsnoop.format_report(issues: list[Issue]) -> str
Format a list of issues into a human-readable multi-line report with pass/warn/fail counts.
mcpsnoop.server.MCPStdioServer
Minimal MCP stdio server exposing the snoop tool. Initialize and call run() to start the server loop.
from mcpsnoop.server import MCPStdioServer
server = MCPStdioServer(inspect_path=".", target_version="1.0.0")
server.run() # reads JSON-RPC from stdin, writes to stdout
Limitations
- Static analysis only — dynamically constructed tools (factory functions that return tool dicts at runtime) may not be detected;
inspect_serverreads whatimportlibexposes at module load time. - Python-only — inspection targets Python MCP server modules, not TypeScript/Node.js servers.
- MCP 1.x annotations — tool annotation fields (
idempotentHint,openWorldHint,readOnlyHint) are from MCP 1.x and may change in 2.0. Usetarget_versionto pin to a known baseline. - No auto-fix —
mcpsnoopreports issues but does not modify code.
Non-Goals
- Runtime evaluation of tool handlers
- MCP client or agent functionality
- Auto-fixing of detected issues
- Integration with specific MCP clients (Claude Desktop, Cursor, etc.)
- Generating mock MCP clients for live testing
License
MIT License — © 2026 Abhishek Prasad
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。