What RugSnare MCP server does
RugSnare MCP server establishes an approved baseline for MCP tool contracts and checks whether a connected server still matches it. The canonical contract includes each tool's name, description, and input schema; scans can also pin prompts and resources. Hash comparisons detect changed descriptions, hidden schema parameters, added tools, and removed tools while ignoring cosmetic ordering changes.
Findings are classified into categories such as breaking, loosened, expanded, and notation changes. The CLI can also flag paywall introduction and supports assertions for required or forbidden tools. A nonzero result from a failed comparison makes the check suitable for CI.
How it works
RugSnare MCP server reads an MCP configuration, starts or connects to the specified server, canonicalizes the relevant contract data, and stores hashes for later comparison. The diff command performs a live check and reports changes against the approved baseline.
For runtime monitoring, the run command places a proxy in front of a server. In observe mode it watches and reports changes. Enforce mode quarantines new or drifted tools during the session. The proxy supports stdio and HTTP paths according to the project description. It is fail-open by default; failMode: closed or --fail-closed blocks messages if the proxy itself encounters an error.
The optional canary workflow records local, correlated tool-call traces and replays them against a new server version. Replay compares contract and behavior changes, skips write-class calls by default, and returns CI-oriented exit codes. Receipts can sign the local event log with an Ed25519 hash chain so later edits, deletions, or reordering can be identified.
Setup and configuration
RugSnare MCP server requires Node.js 18 or newer and has no npm dependencies. Install the published package with npx rugsnare init, or clone the repository and run node src/cli.js init from the product directory. The initializer discovers MCP configurations, including those associated with Claude Code, Cursor, Windsurf, VS Code, and Zed.
A typical workflow is:
- Run
scan --config .mcp.json to create the baseline.
- Run
diff --config .mcp.json in CI to detect drift.
- Use
run --name <name> --mode enforce -- <command> for runtime enforcement.
- Use
canary record and canary replay to compare behavior across versions.
Pins are intended to be reviewed and committed; canary traces are local and gitignored by initialization. Enable canaryRecord in .rugsnare/config.json to record traces by default, or use the command-line recording mode for one session.
Tools and capabilities
The RugSnare MCP server CLI provides these documented command groups and operations:
init, scan, diff, approve, verify, and history for baselines, comparisons, approvals, artifact checks, and audit history.
run and wrap for proxying servers and applying runtime policy.
canary record and canary replay for recorded-call testing.
skills for the documented skills workflow.
receipts sign and receipts verify for tamper-evident event logs.
--expect-tool and --forbid-tool assertions for CI.
Limitations and notes
RugSnare MCP server does not treat version pinning alone as proof that tool behavior is unchanged; it compares the observed contract instead. Canary replay is read-only by default, and destructive-looking calls require explicit inclusion. Array comparison examines the first element's shape, so changes affecting only later elements of a heterogeneous array may go undetected.
Recorded arguments and responses are user data, so canary recording is disabled by default and entries are capped at 64 KB. Replay should target a development instance rather than production. The default fail-open proxy behavior favors availability; strict environments must explicitly select closed mode. The project requires Node.js 18 or newer and is licensed under Apache 2.0.