mcp-security-guard is a security scanning and protection tool for MCP servers and AI agents, developed by Stefan Petrovici and licensed under the MIT License. It is primarily used as a Claude Code plugin, and is also published on npm, and can run in clients such as Cursor, VS Code, Windsurf, Claude Desktop, and Cline.
Purpose: This tool focuses on auditing installed MCP servers, checking the content these servers inject into the Claude context, rather than user code. It covers the OWASP MCP Top 10 risks, including tool poisoning, rug pull, shadow attacks, secret leakage, and supply chain risks.
Main capabilities:
- Discover servers: discover MCP servers from user, local and project scopes, installed plugins, plugins synced from a claude.ai account, claude_desktop_config.json, Claude Desktop extensions, organization-managed managed-mcp.json, other clients (Cursor, VS Code, Windsurf), and claude.ai connectors.
- Comprehensive scanning: scans not only tools, but also server instructions, prompts, resources, and resource templates, performing poisoning checks and pinning to detect rug pulls.
- OWASP MCP Top 10 coverage: each finding is tagged with the corresponding OWASP MCP Top 10 number, both in reports and SARIF.
- Runs locally: all operations are performed locally, and no data is sent.
- Detection effectiveness: detected 26/27 attack types in a public technical corpus, with zero false positives on 13 benign samples and 17 real servers (83 tools).
Usage:
- In Claude Code, run /mcp-audit or ask Claude "are my MCP servers safe?".
- Other clients use the npm package: npx mcp-security-guard audit --project-only .
- The command-line tool supports multiple commands, such as scanning servers, testing command injection and path traversal, fixing audit findings, starting team policies, etc.
- Supports --format markdown|json|sarif|html output formats, and the HTML report is a self-contained file.
- Exit codes: 0 means clean, 1 means findings meet or exceed the --fail-on threshold, 2 means usage error.
Use cases:
- Developers check the security of MCP servers before installing them.
- Teams block the addition of risky MCP servers in pull requests via CI/GitHub Action.
- Organizations use team plans to implement centralized policies, approval processes, and compliance reporting.
- Interactive dashboard (MCP App) displays server scores, findings, OWASP breakdown, etc. inline in hosts that support MCP Apps.
Limitations:
- Remote servers that require OAuth cannot be scanned at the tool level, but the configuration is still audited.
- Static checks reduce risk, but cannot prove that a server is safe; malicious behavior in tool responses or server code is out of scope.
- Paid team plans are not yet officially sold, and early access is currently provided through manually issued keys.
- The free version is fully featured, and paid plans add features that require a server, such as daily threat feeds, change alerts, history, team policies, etc.
- Network access occurs only when the user chooses it (such as supply chain checks).
- The hook adds about 40 milliseconds of overhead per MCP call.
Security and privacy: evidence is sanitized, and secrets are masked in all outputs. See PRIVACY.md for the detailed privacy policy.