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
- BELL: Open-Source Stack Combines Browserbase, Eve, iMessage and Stripe Link for Personal Agents — jeff_weinstein · 2026-10-27
- Two engineers rebuilt a FedEx supplier's billing core in 3.5 months vs an estimated 7-8 — alex_verem · 2026-10-27
- GPT-6.1 Terra gains ~20 points on Terminal-Bench 4.0, rivalling GPT-6.1 Sol — ArtificialAnlys · 2026-10-27
- GPT-6.1 Terra scores 48 on AA Coding Agent Index at one-third the cost of GPT-5.6 Terra — ArtificialAnlys · 2026-10-27
- Shift-1 router cuts coding agent spend up to 55% while keeping SWE-bench accuracy — ypatil125 · 2026-10-27
- Non-coder vibe-codes a Godot JRPG with Claude Code in two weeks, music and art synced — ADHDavid · 2026-10-27