Security auditor for MCP servers. Connects to any MCP server, enumerates its tools/resources/prompts, scans for injection patterns, classifies risk levels, and produces a scored report (0-100, grades A-F).
Works as a CLI tool (mcp-audit) or as an MCP server itself (mcp-security-audit).
pip install mcp-security-auditmcp-audit scan --server "python -m my_mcp_server"mcp-audit scan-json --server "python -m my_mcp_server" --output report.jsonmcp-audit scan --server "python -m my_mcp_server" --live-testsExit code 0 for grade A/B, 1 for C/D/F:
mcp-audit scan --server "uvx some-server" || echo "Security audit failed"Use as an MCP server so AI assistants can audit other servers:
claude mcp add mcp-security-audit -- uvx mcp-security-audit{
"mcpServers": {
"mcp-security-audit": {
"command": "uvx",
"args": ["mcp-security-audit"]
}
}
}| Tool | What it does |
|---|---|
audit_scan |
Full security audit with text report |
audit_quick_scan |
Quick scan — score, grade, top findings |
audit_classify |
Classify a single tool's risk level |
audit_check_text |
Scan text for injection patterns |
- Tool risk classification — categorizes every tool as SHELL / FILE / DATABASE / NETWORK / SAFE
- Injection pattern scanning — scans tool and prompt descriptions for 22 injection patterns
- Resource URI analysis — flags sensitive paths (.env, .ssh, credentials, etc.)
- High-risk ratio — warns if >50% of tools are FILE or SHELL level
- Undocumented tools — flags tools missing descriptions
- Attack surface — warns on 20+ tools (large) or 50+ (very large)
- Live injection tests (opt-in) — sends payloads to string-parameter tools
Starts at 100, deducts per finding:
| Severity | Deduction |
|---|---|
| CRITICAL | -25 |
| HIGH | -15 |
| MEDIUM | -8 |
| LOW | -3 |
Bonus: +1 per documented tool (max +5).
Grades: A (90+), B (75+), C (60+), D (40+), F (<40)
============================================================
MCP SECURITY AUDIT REPORT
============================================================
Server: python -m agent_safety_mcp.server
Tools: 13
Score: 92/100 (Grade A)
------------------------------------------------------------
TOOL CLASSIFICATION
------------------------------------------------------------
Tool Risk Matched
cost_guard_configure SAFE -
cost_guard_status SAFE -
injection_scan SAFE -
trace_save FILE !!save, file
...
- mcp — MCP protocol SDK
- ai-injection-guard — 22 prompt injection detection patterns
Part of the LuciferForge AI Agent Infrastructure Stack.
MIT