|
10 | 10 |
|
11 | 11 | jCodeMunch indexes a codebase once using tree-sitter AST parsing, then lets MCP-compatible agents (Claude Desktop, VS Code, etc.) **discover and retrieve code by symbol** instead of brute-reading files. Every symbol stores its signature + one-line summary, with full source retrievable on demand via O(1) byte-offset seeking. |
12 | 12 |
|
| 13 | +> **Part of the Munch Trio** — see [The Munch Trio](#the-munch-trio) below for the full ecosystem including documentation indexing and unified orchestration. |
| 14 | +
|
13 | 15 | --- |
14 | 16 |
|
15 | 17 | ## Proof first: Token savings in the wild |
@@ -69,33 +71,57 @@ IDs are stable across re-indexing when file path, qualified name, and kind are u |
69 | 71 |
|
70 | 72 | --- |
71 | 73 |
|
72 | | -## Quickstart |
| 74 | +## Installation |
| 75 | + |
| 76 | +### Prerequisites |
| 77 | + |
| 78 | +- **Python 3.10+** |
| 79 | +- **pip** (or any Python package manager) |
73 | 80 |
|
74 | 81 | ### Install |
75 | 82 |
|
76 | 83 | ```bash |
77 | | -pip install jcodemunch-mcp |
| 84 | +pip install git+https://github.com/jgravelle/jcodemunch-mcp.git |
| 85 | +``` |
| 86 | + |
| 87 | +Verify: |
| 88 | + |
| 89 | +```bash |
| 90 | +jcodemunch-mcp --help 2>&1 | head -1 # should not error |
78 | 91 | ``` |
79 | 92 |
|
80 | | -### Configure MCP |
| 93 | +### Configure MCP Client |
| 94 | + |
| 95 | +#### Claude Code / Claude Desktop (claude_desktop_config.json) |
81 | 96 |
|
82 | | -Add to your `claude_desktop_config.json`: |
| 97 | +**macOS/Linux** — `~/.config/claude/claude_desktop_config.json` |
| 98 | +**Windows** — `%APPDATA%\Claude\claude_desktop_config.json` |
83 | 99 |
|
84 | 100 | ```json |
85 | 101 | { |
86 | 102 | "mcpServers": { |
87 | 103 | "jcodemunch": { |
88 | 104 | "command": "jcodemunch-mcp", |
89 | 105 | "env": { |
90 | | - "GITHUB_TOKEN": "your_github_token", |
91 | | - "ANTHROPIC_API_KEY": "your_anthropic_key" |
| 106 | + "GITHUB_TOKEN": "ghp_...", |
| 107 | + "ANTHROPIC_API_KEY": "sk-ant-..." |
92 | 108 | } |
93 | 109 | } |
94 | 110 | } |
95 | 111 | } |
96 | 112 | ``` |
97 | 113 |
|
98 | | -Both env vars are optional. `GITHUB_TOKEN` enables private repos + higher rate limits. `ANTHROPIC_API_KEY` enables AI-generated summaries. |
| 114 | +Both env vars are optional: |
| 115 | +- **GITHUB_TOKEN** — enables private repos + higher GitHub API rate limits |
| 116 | +- **ANTHROPIC_API_KEY** — enables AI-generated symbol summaries (falls back to docstrings/signatures without it) |
| 117 | + |
| 118 | +#### Other MCP clients |
| 119 | + |
| 120 | +Any MCP client that supports stdio transport can use jcodemunch-mcp. Point it at the `jcodemunch-mcp` command with the environment variables above. |
| 121 | + |
| 122 | +### Verify |
| 123 | + |
| 124 | +Once configured, ask your MCP client to list tools. You should see 11 tools. |
99 | 125 |
|
100 | 126 | ### Usage |
101 | 127 |
|
@@ -189,10 +215,29 @@ See [SECURITY.md](SECURITY.md) for full details. |
189 | 215 |
|
190 | 216 | ## Troubleshooting |
191 | 217 |
|
192 | | -- **Rate limits:** Set `GITHUB_TOKEN` for higher GitHub API limits |
193 | | -- **Large repos:** First 500 files indexed (priority: `src/`, `lib/`, `pkg/`) |
194 | | -- **Encoding issues:** Invalid UTF-8 handled gracefully with replacement characters |
195 | | -- **Stale index:** Use `invalidate_cache` to force a clean re-index |
| 218 | +| Problem | Cause | Fix | |
| 219 | +|---------|-------|-----| |
| 220 | +| Rate limits on GitHub API | No token configured | Set `GITHUB_TOKEN` for higher limits | |
| 221 | +| Large repos only partially indexed | Default 500-file limit | Priority given to `src/`, `lib/`, `pkg/` | |
| 222 | +| Encoding issues | Invalid UTF-8 in source files | Handled gracefully with replacement characters | |
| 223 | +| Stale index | Source code changed since indexing | Use `invalidate_cache` to force clean re-index | |
| 224 | +| `jcodemunch-mcp` command not found | Package not installed or not on PATH | Re-run `pip install` and check `which jcodemunch-mcp` | |
| 225 | + |
| 226 | +--- |
| 227 | + |
| 228 | +## The Munch Trio |
| 229 | + |
| 230 | +jCodeMunch is part of a three-package ecosystem for giving AI agents structured access to both code and documentation: |
| 231 | + |
| 232 | +| Package | Purpose | Repo | |
| 233 | +|---------|---------|------| |
| 234 | +| **jcodemunch-mcp** (this repo) | Token-efficient code symbol indexing via tree-sitter AST parsing | 11 tools | |
| 235 | +| [jdocmunch-mcp](https://github.com/jgravelle/jdocmunch-mcp) | Token-efficient documentation section indexing | 8 tools | |
| 236 | +| [jcontextmunch-mcp](https://github.com/jgravelle/jcontextmunch-mcp) | Unified orchestration — hybrid search, context assembly, cross-references | 9 tools | |
| 237 | + |
| 238 | +**Using all three?** You only need to configure [jcontextmunch-mcp](https://github.com/jgravelle/jcontextmunch-mcp) in your MCP client — it spawns jcodemunch-mcp and jdocmunch-mcp as subprocesses automatically. See the [jcontextmunch-mcp installation guide](https://github.com/jgravelle/jcontextmunch-mcp#full-installation-guide) for details. |
| 239 | + |
| 240 | +--- |
196 | 241 |
|
197 | 242 | ## Documentation |
198 | 243 |
|
|
0 commit comments