mcp-tool-guard-server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
0.3-Second Prebuilt Wheel Install (No Git Clone Needed)
Run directly from the signed v0.6.0 prebuilt wheel (dependencies = [], zero transitive supply-chain surface):
# Instant one-shot live A2A v1.0 AgentCard + Ed25519 JWKS audit via uvx
uvx --from https://github.com/khoap1220-hue/mcp-tool-guard/releases/download/v0.6.0/mcp_tool_guard-0.6.0-py3-none-any.whl \
a2a-card-guard audit https://khoaphan.dev --auto-jwks --strict-v1
# Or install into any Python 3.10+ virtualenv / CI image in <0.5s
pip install https://github.com/khoap1220-hue/mcp-tool-guard/releases/download/v0.6.0/mcp_tool_guard-0.6.0-py3-none-any.whlNote:
HS256, RFC 8785 JCS canonicalization, cross-SDK JCS divergence checks, SSRF-pinned HTTPS fetching, 5-layer prompt-injection scanning, 11-CVE multi-language SCA, SARIF v2.1.0, and thestdioMCP server run on 100% Python stdlib. For asymmetricEdDSA/ES256/PS256JWS cryptographic verification, pass--with cryptographytouvx.
Related MCP server: mcp-security-suite
1-Click IDE MCP Server Config (Claude Code, Cursor, Windsurf, VS Code)
Registered on the Official Anthropic MCP Registry as io.github.khoap1220-hue/mcp-tool-guard. Drop into .mcp.json, ~/.cursor/mcp.json, or claude_desktop_config.json:
{
"mcpServers": {
"mcp-tool-guard": {
"command": "uvx",
"args": [
"--from",
"https://github.com/khoap1220-hue/mcp-tool-guard/releases/download/v0.6.0/mcp_tool_guard-0.6.0-py3-none-any.whl",
"mcp-tool-guard-server"
]
}
}
}6 Built-In Read-Only Security Tools (mcp-tool-guard serve)
MCP Tool | Scope |
| What It Verifies |
| MCP |
| 5-layer prompt injection, Unicode Tag smuggling, homoglyphs & server typosquatting |
| MCP Lockfile |
| Canonical SHA-256 rug-pull drift & |
| A2A |
| Local file or SSRF-pinned live HTTPS origin + |
| RFC 8785 JCS |
| Cross-SDK signature canonicalization splits ( |
| 9 Lockfile Types |
| All 11 OSV-verified A2A SDK CVEs + |
|
|
| Google |
Objective Feature Comparison Matrix
Capability |
|
|
|
| Yes (pure Python stdlib) | No (heavy CLI/HTTP tree) | No |
| Yes (100% deterministic local rules) | Partial (cloud API default) | Requires vulnerability DB sync |
| Yes (SHA-256 lockfile + annotation diff) | Yes | No |
| Yes (DNS-pinned SSRF-safe HTTPS + JWKS) | No | No |
| Yes ( | No | No |
| Yes (PyPI, npm, Go, Cargo, Maven + split-brain) | No | Partial (misses commit-only OSV ranges) |
| Yes ( | Partial | Yes |
| Yes (6 read-only | No | No |
Drop-In 5-Line GitHub Action (action.yml + SARIF Code Scanning)
- uses: khoap1220-hue/mcp-tool-guard@v0.6.0
with:
agent-card: .well-known/agent-card.json
jwks: .well-known/jwks.json
mcp-config: tools.json
sarif-output: mcp-tool-guard.sarifUpload mcp-tool-guard.sarif directly to the GitHub Security tab via github/codeql-action/upload-sarif@v3; every run also writes a Markdown scorecard table to $GITHUB_STEP_SUMMARY.
Ground-Truth A2A SDK CVE Coverage (a2a-sca / A2A-08)
Standard OSV package queries (pip-audit, npm audit, osv-scanner, Dependabot) miss 2026 a2aproject/* advisories mapped only to git commit SHAs. a2a-sca detects all 11 verified advisories deterministically across uv.lock, poetry.lock, requirements*.txt, pyproject.toml, package-lock.json, pnpm-lock.yaml, go.mod, Cargo.lock, and pom.xml:
Advisory ID | Ecosystem & Package | Vulnerable Range | Patched | Class & |
| PyPI |
|
| Push Notification webhook SSRF ( |
| PyPI |
|
| Workflow identifier path traversal |
| npm |
|
| Task FSM concurrent status race / TOCTOU ( |
| Go |
|
| Internal network error disclosure in push handler ( |
| Cargo |
|
|
|
| Maven |
|
| Push |
| Maven |
|
| Unvalidated push webhook SSRF ( |
| Maven |
|
| Cleartext bearer token logged on Protobuf parse error ( |
| Maven |
|
| Cross-domain API key leak via HTTP |
| Maven |
|
| Fail-open |
| Maven |
|
| Synchronous POST cross-authority credential redirect ( |
Real MCP Attack Example (readOnlyHint -> destructiveHint Rug-Pull)
A server serves examples/tools_v1.json at approval time, then silently mutates only annotations in examples/tools_v2_rugpull.json:
"annotations": {
"title": "Analytics Reader",
- "readOnlyHint": true,
- "destructiveHint": false,
+ "readOnlyHint": false,
+ "destructiveHint": true,
"idempotentHint": true,
"openWorldHint": false
}Pinning and verifying with the CLI immediately flags HIGH severity annotation-loosening drift (exit code 2) and records old/new hashes and exact field diffs in a SHA-256 hash-chained audit trail:
mcp-tool-guard pin examples/tools_v1.json --server analytics-mcp -o pins.lock.json
mcp-tool-guard verify examples/tools_v2_rugpull.json --server analytics-mcp -l pins.lock.json --sarif-out drift.sarifPython Library & CLI Reference
from mcp_tool_guard import (
MCPStdioServer,
MCPToolGuard,
audit_live_agent_card,
check_cross_sdk_jcs_divergence,
load_tools_list_file,
scan_a2a_lockfiles,
)
# 1. MCP tools/list pin & rug-pull verification
guard = MCPToolGuard(trusted_servers=["analytics-mcp"])
guard.evaluate_tools(load_tools_list_file("examples/tools_v1.json", default_server="analytics-mcp"))
decisions = guard.evaluate_tools(load_tools_list_file("examples/tools_v2_rugpull.json", default_server="analytics-mcp"))
assert decisions[0].decision == "human_review" and decisions[0].drift_severity == "HIGH"
# 2. Multi-language A2A SDK lockfile & split-brain scan
sca_report = scan_a2a_lockfiles(".")
assert sca_report.passed is True# MCP subcommands & stdio server
mcp-tool-guard serve
mcp-tool-guard-server --version
mcp-tool-guard pin examples/tools_v1.json --server analytics-mcp -o pins.lock.json
mcp-tool-guard verify examples/tools_v2_rugpull.json --server analytics-mcp -l pins.lock.json --format sarif
mcp-tool-guard scan examples/tools_v1.json --server analytics-mcp --github-summary
mcp-tool-guard check-stateless examples/stateless_desync_request.json
mcp-tool-guard audit-toolbox examples/mcp_toolbox_sample.yaml --format sarif
mcp-tool-guard check-a2a chain.json --secret-env MCP_GUARD_SECRET --server analytics-mcp --tool query_records
# A2A v1.0 subcommands (available on both `a2a-card-guard` and `mcp-tool-guard a2a-*`)
a2a-card-guard audit https://khoaphan.dev --auto-jwks --strict-v1
a2a-card-guard pin examples/agent_card_v1.json -o a2a.lock.json --hmac-secret-env A2A_DEMO_HMAC
a2a-card-guard verify examples/agent_card_v2_rugpull.json -l a2a.lock.json --hmac-secret-env A2A_DEMO_HMAC
a2a-card-guard sca . --agent-card examples/agent_card_v1.json --format json
a2a-card-guard delegation-audit examples/a2a_delegation_escalation.json --format sarif
a2a-card-guard generate --url https://guard.example.com --pay-to 0x1111111111111111111111111111111111111111 --price-usdc 0.05Architecture
src/mcp_tool_guard/
├── models.py # Frozen dataclasses (MCPToolDefinition, DriftReport, AuditEntry)
├── canonical.py # Sorted-key JSON canonicalizer, ASCII prose normalization, deep field differ
├── policy.py # Monotonic annotation guardrails & HIGH-severity annotation loosening detector
├── scanner.py # 5-layer prompt-injection & Unicode homoglyph/Tag smuggling scanner
├── typosquat.py # Damerau-Levenshtein edit-distance-1 & confusable server spoof detector
├── audit.py # Append-only SHA-256 hash-chained AuditLog with JSONL serialization
├── guard.py # Stateful MCPToolGuard, lockfile I/O, separation-of-duties drift promotion
├── loader.py # Parser for standard MCP tools/list, JSON-RPC 2.0, array, and multi-server JSON
├── stateless.py # Stateless MCP 2026-07-28 header-body verifier & multi-replica consensus detector
├── toolbox_audit.py # Zero-dep Google mcp-toolbox tools.yaml, shell/SQL, MCP Apps & Tasks auditor
├── a2a_attenuation.py # Cryptographically linked monotonic A2A <-> MCP capability attenuation chain
├── a2a_guard.py # A2A v1.0 JCS/JWS verifier, live SSRF-pinned URL probe, JCS divergence & A2ABreak
├── a2a_sca.py # Zero-dep 9-manifest A2A SDK CVE & v0.3/v1.0 framework split-brain scanner (A2A-08)
├── a2a_x402.py # A2A v1.0.1 /.well-known/agent-card.json generator & exact-Decimal x402 v2 helpers
├── sarif.py # OASIS SARIF v2.1.0 & GitHub Actions $GITHUB_STEP_SUMMARY Markdown formatter
├── mcp_server.py # Zero-dep JSON-RPC 2.0 stdio MCP server exposing 6 read-only security tools
└── cli.py # Triple zero-dep CLIs (`mcp-tool-guard`, `a2a-card-guard`, `mcp-tool-guard-server`)Benchmarks
Measured with python -B benchmarks/bench_guard.py --iterations 500 --warmup 50 on Python 3.12 (AMD64), zero external dependencies:
Workload | Iterations | p50 (µs) | p95 (µs) | p99 (µs) | Mean (µs) |
Single tool: canonical SHA-256 pin hash only | 2,500 | 63.3 | 80.8 | 101.6 | 66.3 |
Single tool: cold pin + full 5-layer scan | 1,000 | 1,033.9 | 1,717.3 | 1,810.2 | 1,182.9 |
10-tool | 500 | 10,827.9 | 15,581.4 | 16,011.5 | 11,471.8 |
20-tool | 500 | 1,427.5 | 1,768.3 | 1,845.0 | 1,416.6 |
50-tool | 250 | 3,841.1 | 4,421.4 | 4,560.3 | 3,781.3 |
License
MIT — see LICENSE.
Maintained by Khoa Phan as part of an open-core A2A engineering practice (100% written asynchronous execution via GitHub Specs/PRs and Email, zero live meetings). For teams needing production remediation, custom A2A v0.3 -> v1.0 migration adapters, or formal security sign-off, details on the 72h Fixed-Scope A2A v1.0 & MCP Security Hardening Audit are available at khoaphan.dev/mcp/.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Zero-LLM deterministic security auditor for MCP configs, SKILL.md rules, and agent budgets.
12 read-only MCP tools for AI communication rules, instruction linting & 25-model benchmarks.
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
AI-run security lab: 6 free read-only MCP tools for prompt-injection, SKILL.md, MCP & x402 audits.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables authorized security auditing of AI-agent supply chains and agent-facing surfaces: deterministic local skill-bundle audits against eight attack patterns, secrets scanning, and scope-gated read-only recon of agent endpoints and MCP surfaces.MIT
- AlicenseNot gradedqualityDmaintenanceEnables enterprise MCP security auditing through 12 deterministic no-LLM tools for evidence-gated claims, skill/prompt supply-chain audits, token profiling, and server auth-mode checks.MIT
- AlicenseNot gradedqualityBmaintenanceExposes thirty callable tools that let any MCP client audit server manifests, detect poisoned tool descriptions, config files and long-term memory, catch tool rug-pulls, check known vulnerabilities and package authenticity, and statically screen tool code for SSRF, path traversal and command injection risk. It also simulates whether a proposed agent action should auto-approve or be held for human review.MIT
- AlicenseAqualityBmaintenanceEnables users to audit skills, rules, and MCP configurations for prompt injection, Unicode steganography, concealed payloads, secret access, and integrity issues, and to pin and verify live stdio MCP tool schemas against a lockfile to detect post-install rug pulls.3MIT