Zero-Dependency Gate Hook & Sandbox Isolation
The Problem: Adding an MCP server takes one line of JSON. After that, an unvetted third-party server injects tool descriptions directly into your coworker's LLM context window, enabling covert prompt injection, schema bloat, and unauthorized execution.
Our Solution:
- Offline Security Hook: A 180-line standalone Bash hook (
mcp-gate.sh) executing in < 5ms with zero external runtime dependencies. Fails closed (exit 2). - Dual-Sandbox Harness Adapter: Isolates execution in local Docker containers, driving Claude Code via native CLI flags without credential leakage.
- EIP-712 x402 Micropayments: Protocol-level HTTP 402 challenge negotiation on Base USDC with bounded spend caps ($1/run, $5/day).
- Deterministic Schema Synthesis: Prunes bloated MCP schemas from 3,400 tokens down to 420 tokens in pinned
recipe.mdfiles.
Verified in: src/vet.mjs · bin/mcp-gate.sh · src/budget.mjs