If you use Claude Code, OpenAI Codex CLI, Cursor, or VS Code Copilot with Model Context Protocol (MCP) servers, your context window and prompt cache are exposed to three silent failure modes:

  1. Startup Schema Bloat (tools/list): Connecting 3 common MCP servers (github, postgres, playwright) injects 60+ tool JSON schemas (~20,000+ tokens) into every single turn.
  2. Oversized Stdio Frame Teardowns (tools/call): Returning >= 8 MiB in Claude Code kills the stdio server process with <error>Connection closed</error> (anthropics/claude-code#105703); returning >= 16 MiB in Codex CLI discards the frame silently until the 300s tool timeout expires (openai/codex#60383).
  3. Silent Prompt Cache Invalidations & Config Drift: Reordered MCP tools, dynamic prefixes before cache_control, or mid-session "disableAllHooks": true edits (anthropics/claude-code#106225) silently burn tokens or drop guardrails.

We built three zero-telemetry open-source tools to inspect and prevent all three:

  • @framy2/ctxwise (v1.2.0) — Context Firewall, Multi-Editor MCP Auditor & CI Budget Guard (Apache-2.0)
  • @framy2/mcp-diet (v0.1.1) — Stdio MCP Proxy with tools/list Tree-Shaking, 8 MiB Spill-to-Disk Crash Guard & Secret Redaction (MIT)
  • @framy2/agent-wire-tap (v0.2.0) — Local Wire Contract Tester & Live --passthrough Prompt-Prefix Cache-Miss Debugger (MIT)

1. Put Your MCP Servers on a Diet (@framy2/mcp-diet)

{ "mcpServers": { "github": { "command": "npx", "args": [ "-y", "@framy2/mcp-diet@0.1.1", "--read-only", "--max-desc", "160", "--max-result-kb", "512", "--redact-secrets", "--", "npx", "-y", "@modelcontextprotocol/server-github" ] } } } 

mcp-diet sits on stdio between the host CLI and the upstream MCP server:

  • Spills >= 512 KiB tool outputs to a local temp file and returns a compact < 2 KB preview so Claude Code (8 MiB) and Codex (16 MiB) never tear down the pipe.
  • Deterministically sorts tool schemas so prompt prefix caches stay warm.
  • Redacts leaked credentials (sk-ant-*, sk-proj-*, ghp_*, AKIA*, DB passwords) before they reach the model transcript.

2. Audit Every Editor & Lock CI Budgets (@framy2/ctxwise v1.2.0)

# Probe stdio MCP tools safely (works on Windows without shell: true) & profile token weight npx @framy2/ctxwise mcp-xray --probe-stdio # Check CLAUDE.md, .claude/rules/*.md, AGENTS.md, .cursor/mcp.json, and .vscode/mcp.json parity npx @framy2/ctxwise agents --fail-on-divergence # Scan for leaked secrets, Trojan Unicode, disableAllHooks, and unpinned `npx -y` MCP runners npx @framy2/ctxwise shield --strict --sarif ctxwise.sarif # Enforce ctxwise.budget.yaml across Claude, Codex, and Cursor without double-counting synced rules npx @framy2/ctxwise budget 

3. Pinpoint Exact Turn-Over-Turn Cache Misses (@framy2/agent-wire-tap v0.2.0)

# CI contract test at $0.00 API cost (mock mode) npx @framy2/agent-wire-tap \ --assert-contains "AGENTS.md" \ --assert-not-contains "sk-ant-" \ --assert-max-bytes 32768 \ --assert-max-tools 12 \ -- codex exec "ping" # Live transparent pass-through proxy (streams SSE & detects prefix divergence block-by-block) npx @framy2/agent-wire-tap --passthrough https://api.anthropic.com --port 8787 

--passthrough keeps credentials strictly in memory ([REDACTED] in traces/logs) while hashing each prefix segment (model, tools[], system[], messages[]) and flagging the exact firstDivergentLayer / firstDivergentIndex whenever a mutation breaks a cache_control breakpoint.

Try the Client-Side Calculator

Paste your .mcp.json, .vscode/mcp.json, CLAUDE.md, or AGENTS.md right in the browser (100% local, zero uploads):

👉 https://framy2.github.io/ctxwise/