jcodemunch-mcp: a token-efficient MCP server for precise GitHub source code retrieval via AST parsing

jcodemunch-mcp: a token-efficient MCP server for precise GitHub source code retrieval via AST parsing

What it solves

AI agents typically explore codebases by reading entire files, which wastes tokens and pollutes the context window with irrelevant code. jCodeMunch provides a structured, symbol-level retrieval system that allows agents to fetch only the specific functions, classes, or methods they need, reducing token usage by 95% or more in many workflows.

How it works

The project indexes a codebase once using tree-sitter AST parsing to store structured symbol metadata and byte offsets. This allows agents to perform precise retrieval instead of brute-force file reading. It also features a compact wire format called "MUNCH" that further reduces the bytes sent to the model by interning path prefixes and packing lists into CSV-like rows.

Who it’s for

Developers using MCP-compatible AI clients (such as Claude Code, Cursor, VS Code, Windsurf, and Continue) who want to reduce AI token costs and improve the reliability of code exploration for their agents.

Highlights

  • Symbol-Level Retrieval: Fetch exact implementations of functions, classes, and constants without reading full files.
  • Task Orchestration: Tools like assemble_task_context and plan_turn allow agents to gather all necessary context for a task in a single call rather than chaining multiple requests.
  • Structural Analysis: Provides advanced queries that standard tools cannot, such as blast-radius analysis, dead code detection, and class hierarchy traversal.
  • Token Efficiency: Combines AST-based retrieval with a compact output format to significantly lower token spend and CO2 emissions.
  • Wide Language Support: Uses tree-sitter to support over 70 languages.

Sources