# jCodeMunch

> An MCP server that cuts AI token costs 95%+ on code exploration by retrieving exact symbols via tree-sitter AST parsing instead of reading entire files.

jCodeMunch is an MCP (Model Context Protocol) server built by J. Gravelle (jMunch LLC) that replaces file-based code reading with surgical symbol-level retrieval, reducing AI token consumption by an average of 96.5% against a grep-and-read agent baseline. It indexes a codebase once using tree-sitter AST parsing and then lets AI agents fetch exact functions, classes, methods, and constants by name — returning tens of lines instead of thousands. The tool is free for personal use and requires a commercial license for for-profit use.

## What It Is

jCodeMunch is a token-efficiency layer for AI coding agents that operate over large codebases. Instead of having an agent open and scan entire source files, jCodeMunch builds a persistent local symbol index and exposes MCP tools like `search_symbols`, `get_symbol_source`, `find_importers`, and `get_blast_radius`. When an agent needs to understand how dependency injection works in a 214K-token codebase, jCodeMunch returns the relevant function bodies in roughly 480 tokens rather than requiring the agent to read every file. It works with any MCP-compatible client, including Claude Code, Cursor, Windsurf, VS Code, Codex CLI, Continue, and Gemini CLI.

## How Symbol Retrieval Works

The architecture follows a three-step pattern:

- **Index once:** Run `index_code_folder(path)` to parse all source files with tree-sitter and store structured symbol metadata (signature, kind, qualified name, byte offsets, summaries) in a local index at `~/.code-index/`.
- **Query by intent:** The AI calls `search_symbols(query)` or `get_symbol(id)`. The server performs semantic and keyword search against the index in milliseconds using a bundled ONNX local model (all-MiniLM-L6-v2, 384-dim) for zero-config semantic search.
- **Surgical retrieval:** Only the matching symbol's source and metadata is returned — not the surrounding file, not unrelated classes. A 6,000-token file read becomes a ~400-token symbol pull.

Symbol summaries fall through a 4-tier chain — Anthropic → Gemini → OpenAI-compatible (Ollama, LM Studio, OpenRouter) → signature-only fallback — so it works with whatever LLM is available, or none. The index format has gone through 9 generations and remains fully backward-compatible.

## Benchmark Evidence

The vendor publishes reproducible benchmarks measured with `tiktoken cl100k_base` across three public repositories pinned to upstream commits (expressjs/express, fastapi/fastapi, gin-gonic/gin), run on v1.108.316. Against a grep-top-3 baseline (the approach a competent agent without the tool actually uses):

- **expressjs/express:** 15.5x fewer tokens
- **fastapi/fastapi:** 38.4x fewer tokens
- **gin-gonic/gin:** 20.3x fewer tokens
- **Grand total (15 task-runs):** 28.3x fewer tokens (96.5% reduction)

Per-query results range from 7.6x to 81.2x (median 26.1x). An independent 50-iteration A/B test on a Vue 3 + Firebase production codebase showed an 80% vs 72% success rate and a 32% vs 40% timeout rate in favor of jCodeMunch. The vendor also reports live telemetry showing over 1.1 trillion tokens saved across 227,000+ reporting installs since March 2026, though these figures are vendor-published and self-reported.

## Structural Capabilities Beyond Search

jCodeMunch exposes over 90 MCP tools. Several answer questions that grep-based approaches cannot:

- `get_blast_radius` — shows what breaks if a symbol changes
- `find_importers` — traces who imports a given symbol across the import graph
- `get_call_hierarchy` — maps call chains through exact function bodies
- `find_dead_code` — surfaces unreachable symbols
- `check_edit_safe` / `check_delete_safe` — preflight risky changes with terminal verdicts
- `get_changed_symbols` — diffs symbol-level changes between commits
- `search_ast` — anti-pattern sweeps across the AST

The tool also ships Claude Code hooks: `PreToolUse` intercepts large file reads and routes to symbol retrieval; `PostToolUse` auto-reindexes edited files; `SubagentStart` injects a condensed repo orientation into every spawned subagent.

## Companion Tools and Starter Packs

jCodeMunch ships alongside two companion MCP servers: **jDocMunch** for surgical retrieval of Markdown and documentation sections, and **jDataMunch** for querying CSV, Excel, Parquet, and JSONL datasets without reading entire files. All three conform to the vendor-published **jMRI v1.0** (Munch Retrieval Interface), an Apache-2.0 open retrieval spec.

Pre-built **starter packs** provide symbol indexes for popular frameworks (Node.js, FastAPI, Django, Flask, React, LangChain, Anthropic SDK, MCP SDK, Laravel, Spring Boot) without requiring a local clone. The Node.js pack (76,700+ symbols) is free. Packs are rebuilt weekly from the latest tagged releases.

## Update: v1.108.318 (September 2026)

The latest release is **v1.108.318**, published 2026-09-11, with the note "the process is code that cannot skip a step, and the field is measured from result files." Recent prior releases include v1.108.317 (2026-09-04, CI harness runs on every change) and v1.108.316 (2026-09-02, benchmark display fix). The project has 2,683 GitHub stars and 366 forks as of the last data snapshot. Language support covers 70+ languages via tree-sitter, including Python, JavaScript/TypeScript, Go, Rust, Java, C/C++, C#, PHP, Ruby, Swift, and Kotlin.

## Features
- Symbol-level code retrieval via tree-sitter AST parsing
- 96.5% average token reduction vs grep-and-read agent baseline
- search_symbols and get_symbol_source MCP tools
- get_blast_radius for impact analysis before refactoring
- find_importers for import graph traversal
- find_dead_code detection
- check_edit_safe and check_delete_safe preflight tools
- get_call_hierarchy for call chain tracing
- assemble_task_context for single-call context assembly
- Bundled ONNX local model (all-MiniLM-L6-v2) for zero-config semantic search
- 4-tier LLM summary chain (Anthropic → Gemini → OpenAI-compatible → signature fallback)
- Claude Code hooks (PreToolUse, PostToolUse, SubagentStart, TaskCompleted, PreCompact)
- Pre-built starter packs for popular frameworks
- jDocMunch companion for documentation retrieval
- jDataMunch companion for data file querying
- jMRI v1.0 open retrieval spec compliance
- Embedding drift canary detection
- Groq Remote MCP cloud-hosted option
- Per-project .jcodemunch.jsonc configuration overlay
- Incremental indexing and watch modes
- MUNCH compact wire encoding
- 70+ language support via tree-sitter
- Monorepo support with workspace-member detection
- Anonymous savings telemetry with opt-out
- SCIP import for compiler-verified references
- Secret redaction before LLM exposure
- 9 generations of backward-compatible index format

## Integrations
Claude Code, Cursor, VS Code, Windsurf, Continue, Codex CLI, Gemini CLI, Google Antigravity, Cline, Zed, Goose, Qwen Code, Kiro, Hermes, Odysseus, Paperclip, Ollama, LM Studio, OpenRouter, Anthropic API, Gemini API, OpenAI API, Groq, GitHub API, tree-sitter, ONNX Runtime

## Platforms
WINDOWS, IOS, WEB, API, VSC_EXTENSION, CLI

## Pricing
Freemium — Free tier available with paid upgrades

## Version
v1.108.318

## Links
- Website: https://jcodemunch.com/
- Documentation: https://github.com/jgravelle/jcodemunch-mcp/blob/main/USER_GUIDE.md
- Repository: https://github.com/jgravelle/jcodemunch-mcp
- EveryDev.ai: https://www.everydev.ai/tools/jcodemunch
