What is MCPGuard?
MCPGuard is an open-source static scanner for MCP manifests and agent tool configs. Point it at a manifest and it flags prompt injection in descriptions, tool poisoning, over-permissioned commands, exposed secrets, excessive scope, unauthenticated dangerous tools and tool-name shadowing, each with a severity and a fix. It uses no network and no LLM, grades the manifest A to F, and exits non-zero on critical or high findings so it can gate CI.
Why scan an MCP manifest at all?
An agent reads each tool's description as part of its context. A third-party tool can therefore carry instructions, such as telling the agent to send data elsewhere before using any other tool. Nothing on the network looks wrong, because the attack is text in a description field.
Does MCPGuard send my manifest anywhere?
No. The checks run with zero network calls and no LLM. The optional LLM second opinion in the Python version is off unless you turn it on.
How do I run MCPGuard in CI?
Run `python -m mcpguard.scan <target.json>` in your pipeline. It exits with a non-zero code when it finds a critical or high issue, which fails the job.
Can an agent call MCPGuard itself?
Yes. `python -m mcpguard.mcp_server` exposes a scan_manifest tool over stdio, so an MCP client can scan a manifest before loading it.