Purpose
mcp-context-condenser is a context reduction tool for AI coding agents that reduces the number of tokens sent to large language models through AST-based code outline generation, precise symbol extraction, log compression, and context budget analysis. Its official positioning is to solve two problems caused by sending complete 1000–3000 line source code files directly into the context window of Claude 3.7 Sonnet or GPT-4o: first, high prompt token consumption (active pair programming sessions can reach more than $15–50 per day), and second, the increased model hallucination rate and decreased adherence to architectural rules caused by "lost in the middle." Most agent interactions actually only need exported interfaces, type signatures, or one specific helper function.
Main capabilities
The tool provides four MCP tools:
- condense_source: input sourceCode (string, the original code for which an outline is to be generated), optional preserveDocstrings (boolean, whether to preserve JSDoc/TSDoc comments). Returns the condensed outline, line count difference, and token reduction percentage.
- extract_symbol: input sourceCode (complete source code) and symbolName (function, class, interface, or type name). Returns the extracted symbol along with its file imports and line numbers.
- compress_log: input rawLog (raw test, compiler, or build output). Returns isolated failure information, root-cause assertion messages, and source code line pointers.
- token_budget: input filePath (the path of the file being evaluated) and content (raw file content). Returns the estimated token count, an over-limit flag, and optimization suggestions.
Usage
Can be run as an MCP stdio server or a standalone terminal CLI.
- Claude Desktop: add configuration in claude_desktop_config.json.
- Cursor: add configuration in .cursor/mcp.json.
- Terminal CLI (zero configuration): run directly from the terminal. Official materials do not provide the specific configuration code or running command content.
Applicable scenarios
Suitable for developers using Cursor, Claude Desktop, Cline, and Antigravity and other AI coding agents, to reduce context usage and API costs in scenarios such as pair programming, code review, and log analysis.
Limitations and notes
Officially stated to reduce token usage and LLM API costs by up to 85%; this figure comes from its benchmark test (processing the 450-line TypeScript payment gateway service PaymentGatewayService.ts). The tool is pre-bundled with esbuild into a single self-contained standalone binary (dist/index.js), with zero dependencies, startup time of less than 10 milliseconds, support for Firecracker and Docker, and no runtime installation required. It uses the MIT license and is distributed on Gumroad (purchase or PWYW, starting at $5.00) and itch.io. Other specific features, pricing details, platform support, etc. are not yet available.