Troubleshooting and slimming down MCP memory leaks and cache invalidation for AI agents like Claude Code
Addresses the 8MB/16MB crashes, schema bloat, and prompt cache invalidation issues encountered when using the Model Context Protocol (MCP) with tools like Claude Code and OpenAI Codex CLI, utilizing open-source tools for MCP slimming, configuration auditing, and cache miss troubleshooting.
DEV.to #claudecode
Claude CodeOpenAI Codex CLICursorVS Code Copilot@framy2/ctxwise@framy2/mcp-diet@framy2/agent-wire-tap
Added 2026-11-14 · originally published Fri, 13 Nov 2026 18:12:05 +0000
Steps
- 1Use the @framy2/mcp-diet proxy configuration to limit maximum return results from MCP tools (such as the GitHub service) and spill over to local temporary files when thresholds are exceeded, preventing pipeline crashes.
- 2Run npx @framy2/ctxwise mcp-xray --probe-stdio to safely probe stdio MCP tools and analyze token weights.
- 3Run npx @framy2/ctxwise agents --fail-on-divergence to check the consistency of configuration files such as CLAUDE.md and .cursor/mcp.json.
- 4Run npx @framy2/ctxwise shield --strict --sarif ctxwise.sarif to scan for leaked secrets and Unicode risks.
- 5Use @framy2/agent-wire-tap to run CI contract tests or detect prompt prefix cache misses in real time via --passthrough.
Copy-ready prompt
Please help me inspect the following MCP configuration file [content of .mcp.json or .vscode/mcp.json], analyze whether there are issues with oversized tool schemas leading to token waste, and provide optimization recommendations.
#AI Agent#Claude Code#MCP#Prompt Optimization
Related use cases
Summarized by AI from the original source - refer to the original post for details. Copyright belongs to the original author.