Open Source · MIT License · Zero DependenciesNode.js 20+
mcp-guard: B2B security middleware for MCP servers.
A lightweight, zero-dependency MIT library, CLI scanner, and bidirectional stdio MCP firewall built by 4sails. Deterministically scrub secrets & client PII in both directions, enforce fail-closed inherited ACLs, and detect or taint-quarantine indirect prompt injections before Jira, Slack, or Git data reaches Claude Code or Cursor.
Strips AWS keys, GitHub/GitLab/npm/GCP tokens, Slack webhooks, Stripe keys, OpenAI/Anthropic keys, JWTs, PEM blocks, database URIs, and external PII with precedence-safe rules that never corrupt IPv4s or semver strings.
Fail-Closed ACL & Taint Quarantine
Intersects fact citations against the caller's live Jira, Slack, and Git scopes, and runs NFKC-normalized prompt-injection thresholds with optional --taint-untrusted quarantine wrapping.
Bidirectional Stdio MCP Proxy & CI Scanner
Wraps any existing stdio MCP server to scrub both outbound tool-call arguments and inbound JSON-RPC responses live, or scans Jira/Slack JSON exports in CI with non-zero exit codes on leaks.
Run the multi-client audit demo in 10 seconds
No API keys or npm dependencies required — runs directly on Node 20+.
Quickstart & Stdio MCP Proxybash
git clone https://github.com/cbip191/mcp-guard.git
cd mcp-guard
# Run built-in multi-client agency audit demo
node ./bin/mcp-guard.mjs demo
# Run the automated Node test suite
npm test
# Wrap any existing stdio MCP server (bidirectional redaction + taint quarantine)
node ./bin/mcp-guard.mjs proxy --taint-untrusted -- <your-mcp-server-cmd>
What mcp-guard covers (Open Source)
Precedence-safe secret & PII redaction on JSON/text payloads