Faultgate 0.5.0, Faultgate-Zero 0.2, Trace-to-Fixture 0.1 and Fault-Contract 0.1 are on PyPISee products →

What is FAULTLINE mcp-guard?

FAULTLINE mcp-guard is a local integrity monitor for stdio Model Context Protocol (MCP) servers. It sits between an AI client and its servers, records tool-call structure without argument values, detects changed or suspicious tool definitions, and can reject calls that violate its rules. The open-source package and command are named mcp-integrity; install it with pip install mcp-integrity.

It is for teams securing local MCP tools in clients such as Claude Desktop and Cursor. Audit mode logs findings by default. Enforce mode blocks unknown tools, extra arguments, and changed tool definitions; it also quarantines high-confidence poisoned tool descriptions. This release has been tested on macOS and Linux; Windows has not been validated. See the source and current limitations.

For a worked explanation of tool poisoning, audit mode, enforcement, and the measured limits, read A local firewall for MCP tool calls.

30-SECOND INSTALL

pip install mcp-integrity
mcp-integrity init
# restart Claude Desktop / Cursor, then:
mcp-integrity status
EXAMPLE STATUS OUTPUT
mode: audit (nothing is blocked; run 'mcp-integrity enforce' to block)
servers: filesystem, github, postgres
last 24h: 142 calls, 0 would-block, 1 suspicious description, 0 changed tools
would block:
  github   delete_repo   unknown_tool   x3
suspicious:
  filesystem   read_file   hidden_instruction
changed tools: none
30.32 → 7.41 %
POOLED ASR, RESEARCH CONTRACT (P08)
6
RULES
0
DEPENDENCIES
MIT
LICENSE

01 / WHAT IT CHECKS

Current call checks, scanner warnings, and quarantine behavior.
RuleWhat it catchesBlocks in enforce?
no_manifestA call arrives before tools/list, or after the server announces that its tool list changedYes
unknown_toolClient calls a tool not declared in the server's tools/list manifestYes
extra_argumentClient sends arguments not defined in the tool's inputSchemaYes
tool_changedServer silently altered a tool's schema or description after first run (rug-pull)Yes
suspicious_descriptionTool description contains prompt injection heuristics (finding labels:
hidden_instructionexfiltration_targetsensitive_pathinvisible_unicodecross_tool_reference)
Warns; high-confidence findings quarantine the tool in enforce mode
quarantinedA high-confidence poisoned tool description is removed from tools/list in enforce modeYes

02 / AUDIT VS ENFORCE

Safe logging by default. Active rejection on command.
DEFAULT

AUDIT

Nothing is blocked. Every call is logged to ~/.mcp-integrity/audit.jsonl with argument names only, never values.

ACTIVE GATE

ENFORCE

Rule violations are answered with an MCP error response; high-confidence poisoned tools are removed from tools/list. Use mcp-integrity enforce to switch on and mcp-integrity audit to switch back. Restart the client after changing modes.

AI client
mcp-guard
MCP server

stdio servers wrapped in place; a .mcp-integrity.bak is written next to each client config; mcp-integrity uninstall restores everything.

03 / COMMANDS

Complete CLI command reference.
mcp-integrity init
Finds client configs and wraps stdio MCP servers in audit mode.
mcp-integrity status
Displays protection mode, configured servers, 24h call counts, would-blocks, and warnings.
mcp-integrity log
Displays audit log entries in <time> <server> <tool> <rule> format; supports --tail N and --follow.
mcp-integrity enforce
Switches all wrapped servers to enforce mode.
mcp-integrity audit
Switches all wrapped servers to audit mode.
mcp-integrity pin --list / --accept / --trust
Lists pins, accepts legitimate changes, or trusts a clean tool that was quarantined.
mcp-integrity uninstall
Restores all wrapped client configs to their original unwrapped commands.
mcp-integrity run
Wraps a single server by hand (mcp-integrity run -- <server_command>).

04 / WHAT IT DOES NOT DO

Explicit design non-goals and known scanner limitations.
  • Does not see your chat messages, so it cannot check whether a tool call's arguments match what you asked (that check exists in the underlying research but needs the user turn — coming as a library API for people who run their own agent loop).
  • Does not inspect tool RESULTS.
  • Does not protect remote (HTTP/SSE) servers yet.
  • The heuristic scanner can miss poisoned tools and can quarantine clean ones in enforce mode. Review findings and use pin --trust when a clean tool was removed.

05 / WHY

Research provenance and empirical evaluation results.

Built from FAULTLINE's P08 study on the MCPTox benchmark, where a client-side provenance contract cut pooled attack success from 30.32% to 7.41% across six models. mcp-guard implements the subset of that contract that does not need the user's message.

SIX MODEL RUNGS · MCPTOX VALID-ONLY ASR
RUNGMODELASR A → B
R1qwen/qwen3.7-flash32.94% → 8.26%
R2z-ai/glm-5.3-flash17.23% → 4.11%
R3qwen/qwen3.8-flash41.84% → 9.76%
R4openai/gpt-5.6-luna40.81% → 5.26%
R5google/gemini-3.7-flash3.01% → 1.68%
R6deepseek/deepseek-v4-pro47.64% → 15.46%
POOLEDall six30.32% → 7.41%

VALID-ONLY ASR, %. 1,800 PAIRED EVALUATION RUNS.