jcodemunch-mcp: a token-efficient MCP server for precise GitHub source code retrieval via AST parsing
What it solves
AI coding agents typically explore repositories by opening entire files and scanning thousands of lines of irrelevant code, which wastes tokens and pollutes the context window. jCodeMunch provides a structured retrieval system that allows agents to fetch only the specific code they need—such as functions, classes, or methods—reducing token usage by an average of 96% compared to traditional grep-and-read methods.
How it works
The project implements a Model Context Protocol (MCP) server that indexes a codebase using tree-sitter AST parsing. It stores structured symbol metadata and byte offsets, enabling byte-level precision when retrieving source code. It also features a compact wire format called "MUNCH" that further reduces the number of bytes sent to the agent by interning path prefixes and packing lists into tagged CSV rows.
Who it’s for
Developers using MCP-compatible AI coding assistants (such as Claude Code, Cursor, Windsurf, VS Code, and Continue) who want to lower their AI spend, reduce context window pollution, and speed up repository exploration.
Highlights
- Extreme Token Efficiency: Benchmarked at 86–99% reduction in code-reading token usage.
- Precise Symbol Retrieval: Ability to fetch exact implementations of functions, classes, and constants without reading the whole file.
- Advanced Structural Queries: Tools for finding dead code, detecting untested symbols, mapping git-diffs to symbols, and analyzing architectural centrality via PageRank.
- Broad Language Support: Uses tree-sitter to support over 70 languages.
- Compact Output: A specialized wire format that saves an additional 45.5% of bytes on tool responses.
- Safety Preflights: Tools to check if deleting or editing a symbol is safe based on importers, references, and runtime evidence.