CacheSurgeon: in-flight MCP firewall + prompt-cache surgeon, open-sourced

Fickle-Connection851 · reddit · 2026-12-01

The same author's intro post for CacheSurgeon targets devs wiring multiple MCP servers into Claude Code, Codex, or Cursor. Two quiet failure modes: tool schema order drift between turns invalidates strict KV prefix caching (up to 10× uncached rates), and dangerous tool calls are only caught after the model emits them. The 2ms FastAPI proxy canonicalizes tool schemas and injects cachecontrol breakpoints (verified 0% → 98.7% hits locally), inspects toolcalls/tooluse blocks before execution to neutralize destructive commands, and scrubs .env/API keys before cloud egress with cross-SSE-chunk re-hydration. MIT core, 30-second setup.

Related event: CacheSurgeon Open-Sourced to Fix Silent Cache Misses in Coding Agents(2 posts)→

Original post →

More from coding & agent

coding & agent channel →