MCP security scanner - detect prompt injection in tool descriptions
mcp-guardian defines 5 security-focused tools with clear naming (verb_noun pattern: security_audit, tool_pin_check, tool_pin_save, pattern_test, tool_diff). Descriptions are present and domain-specific (avg ~120 chars), explaining what each tool does. However, schemas are incomplete: tool_pin_check and tool_diff have empty input objects ({}), violating the pattern that every parameter needs a description. security_audit has 3 params with types and descriptions; tool_pin_save has 2 params; pattern_test has 2 params. Output schemas are not documented anywhere in the source. Error handling is minimal, no recovery guidance, no categorization of retryable vs fatal errors. The tool definitions appear hardcoded in bin/mcp-guardian.ts rather than explicitly registered via SDK methods, making composition and introspection difficult.
Test if a description would trigger security findings. Useful for validating tool descriptions before deployment.
Audit MCP tool definitions for potential prompt injection attacks. Scans tool descriptions for cross-tool instructions, privilege escalation attempts, and data exfiltration patterns.
Show detailed changes to MCP tool definitions since last pin. Returns added, removed, and changed tools with hash and description length changes.
Check if MCP tool definitions have changed since last verification. Uses SHA-256 hashes to detect tampering.
Save current tool definitions as the trusted baseline. Creates or updates the tool manifest for future verification.
Two tools (tool_pin_check, tool_diff) have empty input schemas ({}). This violates pattern:tool which requires documented parameters.
No output schemas documented for any tool. LLMs cannot plan downstream calls or extract fields without knowing what each tool returns. Violates pattern:tool and pattern:response-shaper.
Error handling is absent. No recovery guidance (e.g., 'If manifest not found, call tool_pin_save first'), no error categorization (retryable vs fatal), no actionable error messages. Violates pattern:recovery-guide.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 55 | 2026-07-28+ | v2 |
tool_pin_save has a 'force' parameter defaulting to false, but no description explains what happens if force=false and a manifest already exists. Does it error? Prompt? Silently skip? Undocumented behavior invites misuse.
security_audit's 'config_path' parameter description says 'If not provided, scans the current server's tools' but does not specify the default value or what 'current server' means in a multi-server context. Ambiguous for LLM invocation.