Open-Source MCP Server: Precise Code Slicing for Claude Code/Codex, Saving ~87% Input Tokens
naruto_uzumaki00 · reddit · 2026-07-05
The author open-sourced a vendor-neutral token reduction layer centered around an MCP server. By using retrievecode(query) and explainsymbol(name), it returns only relevant AST slices (based on tree-sitter, supporting 12 languages), preventing agents from stuffing entire files into the context. A single STDIO server can connect to both Claude Code and Codex.
Benchmark tests on heavy tasks (based on actual billed tokens) show: GPT-5.5 input dropped from 16,875 to 2,232 (an 86.8% reduction) with a constant quality score of 3/3; Opus 4.8 dropped from 26,573 to 3,343 (an 87.4% reduction). The repository is Apache-2.0 licensed and includes reproducible benchmarks. The author acknowledged limitations, noting that the test set was small and slightly favorable, and that static embeddings did not outperform standard keyword search in evaluations.
Related event: Open MCP Server Slashes LLM Input Tokens by 87%(2 posts)→
More from coding & agent
- Codex tip: use Sol with Astra and Luna sub-agents to save usage — pvncher · 2026-09-11
- agents-best-practices: a provider-neutral Agent Skill for designing and auditing agentic harnesses — tom_doerr · 2026-09-11
- Cognition's SWE-2 uses a KKT duality argument in RL to shift the effort Pareto curve — YouJiacheng · 2026-09-11
- First-ever Three.js Conference lands in Paris, with a panel on AI-shortened design workflows — OdinLovis · 2026-09-11
- Data engineering, not agent frameworks, is the real bottleneck for enterprise AI agents — dhruv2038 · 2026-09-11
- RTK Terminal Compression Cuts Tokens but Leaves Your AI Coding Bill Unchanged — Bartaseth · 2026-09-11