mcp-bouncer: A 500-Line Policy Proxy That Blocks Dangerous MCP Tool Calls

princejain756 · reddit · 2026-10-14

Frustrated that existing MCP security tools only audit tool descriptions, the author built mcp-bouncer—a 500-line, zero-dependency policy proxy for stdio MCP servers that sits on the JSON-RPC pipe and refuses dangerous calls at request time.

Key features: per-tool allowlists (unapproved tools are also hidden from tools/list so the agent never sees them), path traversal defense by resolving ./.. before matching, blocking of private hosts and 169.254.169.254 metadata endpoints in URL args, per-tool rate limits and response caps, and an audit log with sha256-digested args. A scan mode audits servers standalone—flagging injection-style descriptions, tool shadowing, and unconstrained params—and exits nonzero for CI use. The author notes it's protocol-level enforcement, not a kernel sandbox.

Original post →

More from coding & agent

coding & agent channel →