Contents (4)
Consider an illustrative agent session over twenty-four hours. You wrap three local servers for filesystem, github, and postgres. The proxy logs each tool call locally. It flags a hidden instruction tucked inside a read_file tool description. It also identifies an attempt by the agent to call delete_repo on the github server, an unknown tool missing from the server manifest.
Inspection takes zero trust.
a local firewall
I built mcp-guard to place an explicit verification layer between your AI client and your local MCP servers. It is an open source proxy under the MIT license, built for Python 3.10 or newer with zero runtime dependencies. It wraps stdio servers in place, records argument names, flags poisoned tool descriptions, and blocks rule violations when enforce mode is active.

Installation takes two commands.
Restart your client and check status.
Audit mode is the default. Nothing breaks. The proxy logs every tool invocation to ~/.mcp-integrity/audit.jsonl with argument names only, never values. You inspect the stream with mcp-integrity log, which prints entries in structured format and supports tail or follow flags. When you want active enforcement, run mcp-integrity enforce to reject violating calls with an MCP error response. Run mcp-integrity audit to return to passive logging. You can also wrap an individual server manually with mcp-integrity run -- <server_command>.
what the proxy checks
The current mcp-integrity release checks tool calls against the server's advertised manifest. no_manifest rejects a call before the client has listed tools. unknown_tool catches calls to tools missing from that list. extra_argument catches argument names absent from a tool's input schema. tool_changed detects a schema or description that changed after it was pinned, a possible rug-pull. These rules block in enforce mode and produce findings without blocking in audit mode.
The suspicious_description scanner checks tool descriptions for hidden instructions, exfiltration targets, sensitive paths, invisible Unicode, and cross-tool references. In enforce mode, a high-confidence finding quarantines the tool by removing it from tools/list before the model sees it. Cross-tool references remain warning-only. You can inspect and accept a legitimate tool change with mcp-integrity pin --accept, or trust a clean tool that was quarantined with mcp-integrity pin --trust. Restart the client after a mode or trust change.
The scanner is heuristic. In the project's MCPTox evaluation, quarantine removed 924 of 1,312 poisoned tools (70.4%) and 3 of 362 clean tools (0.8%). Its estimate that quarantine would remove the tool in 66.9% of recorded successful attacks is an upper bound from replay, not a live rerun. The repository includes the script and result file so you can inspect the method.
explicit boundaries
Every security tool needs clear operational boundaries.
The proxy does not see your chat messages, so it cannot verify whether arguments match what the user requested. That verification exists in the underlying research and will ship as a library API for developers who run their own agent loop. The proxy does not inspect tool results returned by the server. It does not protect remote HTTP or SSE servers yet. The heuristic scanner can miss novel attacks.
If you decide to remove protection, mcp-integrity uninstall restores each client configuration from its original backup file. Clean rollback matters.
the empirical foundation
I grounded this tool in concrete research data. In FAULTLINE P8, we evaluated client-side provenance contracts on the MCPTox benchmark. That contract cut pooled attack success from 30% down to 7% across six models. The mcp-guard proxy implements the subset of that contract that operates without inspecting user chat turns.
You can run the proxy today from mcp-guard or audit the repository on GitHub. Code beats blind trust.



