jcodemunch-mcp
Cut AI token costs 95%+ on code exploration. The leading MCP server for precise, symbol-level GitHub code retrieval via tree-sitter AST. Works with Claude Code, Cursor & any MCP client. 313B+ tokens saved.
Install / Use
claude mcp add jgravelle -- npx -y github:jgravelle/jcodemunch-mcpIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Skill content
View source on GitHubjCodeMunch MCP
The most token-efficient MCP server for precise source code retrieval via tree-sitter AST parsing. Cut AI token costs 86-99% on code exploration (96% average, benchmarked at 27.9x fewer tokens than a grep-and-read agent) and stop burning your context window reading entire files.
Real results, live from production 645B+ tokens saved · 95,000+ reporting installs · $3.2M+ in AI spend avoided · 77,000+ kg CO₂ prevented Counter figures as of 2026-08-05, valued at the $5/MTok Claude Opus input rate. All four only grow, so read them as floors. Live at jcodemunch.com.
Works with Claude Code, Cursor, VS Code, Codex CLI, Windsurf, Continue, and any MCP-compatible client.
Install now · Quickstart · See the evidence · Pricing
<!-- mcp-name: io.github.jgravelle/jcodemunch-mcp -->Free for personal use. Use it to make money, and Uncle J. gets a taste. Fair enough? Commercial licenses below. Our guarantee: if jCodeMunch doesn't pay for itself, you don't pay for jCodeMunch.
Why jCodeMunch?
Most AI agents explore repositories the expensive way: open entire files, skim thousands of irrelevant lines, repeat. That is not "a little inefficient." That is a token incinerator.
jCodeMunch indexes a codebase once and lets agents retrieve only the exact code they need: functions, classes, methods, constants, outlines, and tightly scoped context bundles, with byte-level precision. It parses source with tree-sitter, stores structured symbol metadata (signature, kind, qualified name, summary, byte offsets) alongside raw file content in a local index, and fetches exact implementations on demand instead of re-reading files over and over.
| Task | Traditional approach | With jCodeMunch |
| --- | --- | --- |
| Find a function | Open and scan large files | Search symbol, fetch exact implementation |
| Understand a module | Read broad file regions | Pull only relevant symbols and imports |
| Explore repo structure | Traverse file after file | Query outlines, trees, and targeted bundles |
| "What breaks if I change X?" | Not possible | get_blast_radius |
Index once. Query cheaply. Keep moving. Precision context beats brute-force context.
Evidence
Reproducible token efficiency benchmark
Measured with tiktoken cl100k_base across three public repos pinned to upstream commits, run 2026-08-03 on v1.108.233. Workflow: search_symbols (top 5) + get_symbol_source × 3 per query. Two baselines, same run, same corpus, same file reader:
- Grep-top-3:
rg -lthe query terms, rank files by match count, open the top 3 whole. This is what a competent agent without the tool actually does, and it is the number to quote. - Read-all: every indexed source file concatenated. A ceiling nobody pays; retained for continuity with previously published figures.
| Repository | Files | Symbols | Grep-top-3 baseline | jCodeMunch | vs grep | vs read-all | |------------|------:|--------:|--------------------:|-----------:|--------:|------------:| | expressjs/express | 182 | 200 | 15,724 avg | 1,007 avg | 15.6x | 153.2x | | fastapi/fastapi | 1,182 | 6,841 | 85,296 avg | 2,209 avg | 38.6x | 372.9x | | gin-gonic/gin | 98 | 1,179 | 31,975 avg | 1,545 avg | 20.7x | 98.3x | | Grand total (15 task-runs) | | | 664,975 | 23,805 | 27.9x | 237.3x |
Against a grep-and-read agent: 96.4% reduction, 27.9x fewer tokens. Per-query results range from 7.3x to 84.3x (median 25.5x); no single multiple describes every query. Against read-all the figure is 99.6%, but nobody pays that ceiling. Compact MUNCH wire encoding then trims a median 45.5% more bytes off responses.
Full methodology, pinned commits, harness, and known caveats: benchmarks/METHODOLOGY.md · Reproduce it yourself · TOKEN_SAVINGS.md
Independent A/B test on a production codebase
50-iteration A/B test on a real Vue 3 + Firebase production codebase, jCodeMunch vs native tools (Grep/Glob/Read), Claude Sonnet 4.6, fresh session per iteration: success rate 80% vs 72%, timeout rate 32% vs 40%, mean cache creation down 10.5%. Tool-layer savings isolated from fixed overhead: 15-25%. One finding category appeared exclusively in the jCodeMunch variant: orphaned file detection via find_importers, a structural query native tools cannot answer without scripting. Full report: benchmarks/ab-test-naming-audit-2026-03-18.md
Mentioned by
- Artur Skowroński (VirtusLab): "roughly 80% fewer tokens, or 5× more efficient — index once, query cheaply forever" · GitHub All-Stars #15
- Traci Lim (AWS · ASEAN AI Lead): "structural queries that native tools can't answer: find_importers, get_blast_radius, get_class_hierarchy, find_dead_code" · 5 Repos That Save Token Usage in Claude Code
- Julian Horsey (Geeky Gadgets): "3,850 tokens reduced to just 700 — a 5.5× improvement" · JCodeMunch AI Token Saver
- Eric Grill: "context is the scarce resource. Cut it by 90% and the whole stack gets cheaper and more reliable" · jCodemunch: Context Engine for AI Agents
Install
One-click installs
Recommended: one command
pip install jcodemunch-mcp
jcodemunch-mcp init
init auto-detects your MCP clients (Claude Code, Claude Desktop, Cursor, Windsurf, Continue), writes their config entries, installs the CLAUDE.md prompt policy so your agent actually uses jCodeMunch, optionally installs enforcement hooks, optionally indexes your project, and audits your agent config files for token waste.
Ubuntu 24.04+ / Debian 12+: system Python is externally managed (PEP 668). Use
pipx install jcodemunch-mcporuv tool install jcodemunch-mcpinstead of barepip install.
Verify:
jcodemunch-mcp --version
Manual Claude Code setup
pip install jcodemunch-mcp
claude mcp add -s user jcodemunch jcodemunch-mcp
Then tell the agent to prefer the tools. This matters more than people think; installation makes the tools available but does not break the agent's brute-reading habit. One line in your CLAUDE.md does it:
Call the jcodemunch_guide tool and strictly follow its instructions.
Using Cursor, Windsurf, Codex CLI, Antigravity, Gemini CLI, Qwen Code, Kiro, Cline, Zed, Goose, Hermes, Odysseus, or Paperclip? Every tested client configuration lives in CLIENTS.md. Optional extras (local semantic search, AI summaries per provider) are in QUICKSTART.md; the system surfaces each extra pulls in are documented in SECURITY.md.
Quickstart
Full walkthrough: QUICKSTART.md. The two-minute version, inside your agent after init:
- Ask: "Index this repo with jcodemunch."
- Ask: "Using jcodemunch, find the function that handles authentication and show me its source."
The agent should answer via search_symbols and get_symbol_source, returning tens of lines instead of whole files. Confirm with get_session_stats: it reports tokens served and savings for the session. That is where the numbers on the meter come from.
Want to skip initial indexing for popular frameworks? Pre-built starter packs: jcodemunch-mcp install-pack --list (free packs need no license).
What you can do
- Retrieve one symbol instead of loading a file.
get_symbol_sourcereturns the exact function body, byte-precise, for the majority of edits that touch one function in a 700-line file (~95% savings on that read). - Assemble a whole task's context in one call.
assemble_task_contextclassifies the task intent, extracts anchor symbols, and runs the right tool sequence under one token budget.plan_turnroutes the turn before the first read. - Ask structural questions grep can't answer.
find_importers,get_blast_radius,get_call_hierarchy,find_dead_code,get_changed_symbols,get_hotspots,search_astanti-pattern sweeps, and more. - Preflight risky changes.
check_edit_safe,check_delete_safe,get_pr_risk_profile, andplan_refactoringwith edit-ready{old_text, new_text}blocks. - Trust the answers. Calibrated confidence scores, freshness flags, coverage contracts on absence claims, compiler-verified references via SCIP import, and automatic secret redaction before anything reaches the LLM.
- Keep the index fresh automatically. Watch modes, agent hooks, and a VS Code extension close the staleness gap.
That's the highlight reel. The complete tour of 90+ tools, the MUNCH compact wire format, evidence receipts, offloadable-work annotation, and the session-economics instrumentation is in CAPABILITIES.md, with internals in UNDER_THE_HOOD.md.
<!-- WHATSNEW:START -->What's new
- v1.108.267 (2026-08-08) — Kotlin and Bash constants are extracted, and a declared pattern must now prove itself
- v1.108.266 (2026-08-08) — A blank line inside a table cell no longer truncates it
- v1.108.265 (2026-08-08) — Retrieval confidence grades ranking quality, not units
When does it help (and when doesn't it)?
| Scenario | Native tool | jCodeMunch | Savings |
|----------|-------------|------------|---------|
| Edit one function (700-line file) | Read → 700 lines | get_symbol_source → 30 lines | ~95% |
| Understand a file's structure | Read → full content | get_file_outline → names + signatures | ~80% |
| Find which file to edit | Grep many files | search_symbols → exact match | comparable |
| Edit requires whole-file context
Truncated for display — read the full file on GitHub.
Related Skills
caveman
107.2k🪨 why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.
claude-mem
94.4kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
84.4kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
83.6kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
