# jCodeMunch MCP

> Symbol-level code retrieval for agents, over MCP

- Category: Retrieval & Knowledge (RAG) / Code Indexing & Search
- Language: Python
- Licence: Dual-use (free for personal use, commercial licence required otherwise)
- Repository: https://github.com/jgravelle/jcodemunch-mcp
- Website: https://jcodemunch.com/
- Canonical page: https://ai-tldr.dev/tools/jcodemunch-mcp/

## In short

jCodeMunch MCP is a local-first Model Context Protocol server for source code retrieval. It sits in the Code Indexing & Search category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Python and licensed Dual-use (free for personal use, commercial licence required otherwise). To get started: install the server.

## Overview

jCodeMunch MCP is a local-first Model Context Protocol server for source code retrieval. It parses a repository with tree-sitter, stores structured symbol metadata — signature, kind, qualified name, summary and byte offsets — alongside the raw file content in a local index, and then answers agent queries with the exact function or class asked for rather than the file that contains it.

The problem it targets is how coding agents explore a repository by default: open a large file, skim past thousands of irrelevant lines, repeat. jCodeMunch replaces that loop with index-once-then-query. Beyond plain symbol lookup it answers structural questions that grep cannot — `get_blast_radius` for what a change would affect, `find_importers`, `get_class_hierarchy` and `find_dead_code`.

The project publishes a reproducible token benchmark rather than a slogan: measured with `tiktoken cl100k_base` on 2026-09-03 across express, FastAPI and gin pinned to upstream commits, a `search_symbols` plus three `get_symbol_source` calls used 23,467 tokens against 664,975 for a grep-then-read-three-files baseline, a 28.3x reduction over fifteen task runs. The methodology and harness are in the repository. Licensing is dual-use: free for personal use, paid for commercial.

## What it does

- tree-sitter parsing into a local symbol index — signature, kind, qualified name, summary and byte offsets per symbol
- Structural queries grep cannot answer: `get_blast_radius`, `find_importers`, `get_class_hierarchy`, `find_dead_code`
- `jcodemunch-mcp init` auto-detects installed MCP clients and writes their config entries for you
- A compact MUNCH wire encoding that trims a median 45.5% more bytes off responses
- Runs against Claude Code, Claude Desktop, Cursor, VS Code, Codex CLI, Windsurf, Continue and any other MCP client
- Local-first: the index stays on your machine, and `uvx` runs the server without installing anything permanently

## Getting started

Install the server, let `init` wire up your MCP clients, then let the agent query it. The README's recommended path is a uv tool install so the command resolves on PATH.

1. Install the server

   `uv tool install` keeps it out of system Python and works on PEP 668 distros such as Ubuntu 24.04+ and Debian 12+, where a bare `pip install` is refused.

```bash
uv tool install jcodemunch-mcp
jcodemunch-mcp init
```

2. What init does

   It detects your MCP clients (Claude Code, Claude Desktop, Cursor, Windsurf, Continue), writes their config entries, installs the CLAUDE.md prompt policy so the agent actually reaches for the tool, optionally installs enforcement hooks, and optionally indexes the project.

3. Verify the install

   Confirm the executable resolves before pointing a client at it.

```bash
jcodemunch-mcp --version
```

4. Or run it with no install at all

   `uvx` runs the server from an ephemeral environment — this is how the client entries `init` writes invoke it anyway. The exception is enforcement hooks, which are spawned by a minimal-PATH subshell and resolve the executable by name, so they need a real `uv tool install`, pipx or pip.

```bash
uvx jcodemunch-mcp
```

## When to use it

- Cut what a coding agent spends on exploration in a large repository, where reading whole files dominates the token bill
- Answer "what breaks if I change this?" with `get_blast_radius` instead of a manual search for call sites
- Find orphaned files and dead code structurally, which native grep and glob tools cannot do without scripting
- Give an agent precise context in a monorepo where any single file is far too large to read in full
