Skip to content

MCP Gate

MCP stdio proxy — runtime constraint verification for AI tool calls.


munio gate sits between your AI client (Claude Desktop, Cursor, etc.) and MCP servers. It intercepts tools/call requests, verifies them against safety constraints, and blocks dangerous calls before they reach the server.

MCP servers execute tool calls from AI agents with no built-in safety checks. munio gate adds a verification layer:

Claude Desktop → munio gate → MCP Server
Guard.check()
(constraints)
  • Zero code changes — works with any MCP server
  • Transparent — passes through all non-tool traffic unchanged
  • Fail-closed — blocks on verification errors
  • Built-in constraints — ships with generic + OpenClaw constraint packs
Terminal window
pip install munio
munio init

This auto-detects MCP configs (Claude Desktop, Cursor, etc.) and wraps servers with munio gate. Use --dry-run to preview changes first.

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

Before (direct connection):

{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
}
}
}

After (through munio gate):

{
"mcpServers": {
"filesystem": {
"command": "munio",
"args": [
"gate", "--",
"npx", "-y", "@modelcontextprotocol/server-filesystem", "/tmp"
]
}
}
}

munio gate now intercepts all tool calls to the filesystem server.

Terminal window
munio status

Shows discovered MCP configs and which servers are wrapped with munio gate.

  1. Claude Desktop spawns munio gate -- <server-command>
  2. munio gate starts the MCP server as a subprocess
  3. All JSON-RPC messages flow through the async proxy
  4. On tools/call requests:
    • Extract tool name and arguments
    • Run Guard.check() against loaded constraints
    • ALLOWED: forward request to server, return response to client
    • BLOCKED: return error response to client, never forward to server
  5. All other messages (notifications, tools/list, etc.) pass through unchanged

munio gate uses the constraint engine. Built-in packs include:

ConstraintWhat it blocks
URL denylistInternal IPs, metadata endpoints, file:// URLs
SQL injection' OR 1=1 -- patterns in query fields
Command injectionrm -rf, curl|sh, chmod 777
Path traversal../, absolute paths, ~/.ssh/
Credential harvestingReads of .env, .aws/, .ssh/
Spend limitsAPI calls exceeding cost thresholds
Rate limitsToo many calls in a time window

Start the stdio proxy wrapping an MCP server.

Terminal window
munio gate [OPTIONS] -- COMMAND [ARGS...]
OptionTypeDefaultDescription
--constraints-dir, -dpathbundledDirectory containing constraint YAML packs
--packs, -pstringall foundComma-separated constraint pack names
--mode, -menumenforceVerification mode: enforce, shadow, disabled
--log, -lpathnonePath to JSON lines log file
--verbose, -vflagfalseEnable debug logging

Example:

Terminal window
munio gate \
--packs generic \
--mode enforce \
--verbose \
-- npx -y @modelcontextprotocol/server-filesystem /tmp

Auto-detect MCP configs (Claude Desktop, Cursor, etc.) and wrap servers with munio gate.

Terminal window
munio init [--dry-run] [--config PATH]
OptionDescription
--dry-runPreview changes without writing
--config, -cPath to a specific config file

Show discovered MCP configs and their munio gate status.

Terminal window
munio status

Remove munio wrapper and restore original MCP server commands.

Terminal window
munio restore [--dry-run] [--config PATH]
OptionDescription
--dry-runPreview changes without writing
--config, -cPath to a specific config file

Show interception statistics from a JSONL log file.

Terminal window
munio stats LOG_FILE [--top N] [--json]
OptionDefaultDescription
LOG_FILE(required)Path to JSONL log file
--top, -t10Number of top blocked tools to show
--json, -jfalseOutput as JSON

Output includes:

  • Total requests intercepted
  • Allowed / blocked counts
  • Top violations by constraint name
ModeBehaviorUse Case
enforceBlock violating tool calls, return error to clientProduction
shadowLog violations but allow all calls throughTesting, rollout
disabledNo verification, pure passthroughDebugging

When a tool call is blocked, munio gate logs to stderr:

INFO: Blocked: exec — Field 'command' matched denied pattern (0.12ms)

In shadow mode:

WARNING: [SHADOW] Would block: exec — URL contains blocked domain (0.08ms)

Set --verbose for full JSON-RPC message tracing.

munio gate ships with built-in constraint packs:

  • generic/ — General-purpose constraints (URL denylist, SQL injection, path traversal, spend limits, rate limits)
  • openclaw/ — OpenClaw-specific constraints (exec, web_fetch, browser, read/write/edit path safety)

To use custom constraints, create a directory with YAML files and pass --constraints-dir:

Terminal window
munio gate --constraints-dir ./my-constraints -- npx server

See Constraint Authoring for the YAML format.