Restoring files from two different pre-revert commits left the package wrappers internally inconsistent, and one of them did not compile. Found by actually building and running them rather than by grepping for removed symbols. pkg/npm — bin.js was never restored, so main's version was destructuring runtimeSetReady/acquireRuntimeLock out of an install.js restored from an older base that does not export them. `npx codebase-memory-mcp` would have died at require time on Windows. install.js, bin.js and the launcher test now all sit on the pre-externalization base, where installWindowsBinaryAtomically is the right primitive for publishing exactly one file. The runtime-set locking that goes away with it existed only to publish binary+sidecars atomically. pkg/go — main.go kept the Windows lock work while main_test.go had been reverted past it, so the package did not build at all: main.go:805: no new variables on left side of := (my edit dropped uiPack) main_test.go: undefined: windowsPayloadName (reverted past its removal) The test is back on main's base, keeping every lock-race test from #1495/#1496 (TestRuntimeSetLock*, TestExpiredLease*, TestStalledRuntimeLockCreator*, TestRuntimeSetLockSerializesProcesses). Dropped 19 whose premise -- a multi-file runtime set with content-addressed sidecars -- no longer exists, and reduced the writeTestRuntimeSet/assertRuntimeTag helpers to the single file that now ships. pkg/pypi — same base repair, keeping the lock and orphan-reconciliation tests. The three archive-SAFETY tests (hardlink members, symlink metadata, unexpected root member) were ADAPTED rather than dropped: they only named a removed file in their fixtures, and they guard traversal properties that still matter. test_release_archives_require_the_integrations_sidecar is inverted rather than deleted -- asserting the sidecar is ABSENT is the stronger guard, since a returning sidecar is exactly what broke `pip install` on Windows. Verified: go vet + go build + go test ok; pypi 24 tests OK; npm 10/10; Windows single-binary bundle contract still passes. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
codebase-memory-mcp
The fastest and most efficient code intelligence engine for AI coding agents. Full-indexes an average repository in milliseconds, the Linux kernel (28M LOC, 75K files) in 3 minutes. Answers structural queries in under 1ms. This npm wrapper downloads, verifies, and caches the selected native runtime set: the executable, its authenticated integration asset, and—when requested—the content-addressed UI pack.
High-quality parsing through tree-sitter AST analysis across 159 languages — producing a persistent knowledge graph of functions, classes, call chains, HTTP routes, and cross-service links. 14 MCP tools. No hosted service or API key; this package requires Node.js to manage and launch the cached native runtime set. Plug and play across 43 automatic/conditional client surfaces.
Installation
npm install -g codebase-memory-mcp
The standard runtime set for your platform is downloaded automatically at install time. To select the UI runtime set and its verified frontend pack, set CBM_VARIANT=ui while installing and when invoking the wrapper:
CBM_VARIANT=ui npm install -g codebase-memory-mcp
Then configure your coding agents:
codebase-memory-mcp install
Restart your agent. Say "Index this project" — done.
Why codebase-memory-mcp
- Extreme indexing speed — Linux kernel (28M LOC, 75K files) in 3 minutes. RAM-first pipeline with LZ4 compression and in-memory SQLite.
- Plug and play — verified native runtime sets for macOS (arm64/amd64), Linux (arm64/amd64), and Windows (arm64/amd64). No Docker or API keys; Node.js owns package download, cache repair, and launch.
- 159 languages — vendored tree-sitter grammars compiled into the binary. Nothing to install, nothing that breaks.
- 120x fewer tokens — 5 structural queries: ~3,400 tokens vs ~412,000 via file-by-file search.
- 43 supported automatic/conditional client surfaces —
installconfigures the appropriate MCP, durable-context, and documented hook surfaces without widening client permissions. - Detected automatically (37) — Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode, VS Code, Cursor, Windsurf, Augment / Auggie, OpenClaw, Kiro, Junie, Hermes, OpenHands, Cline, Warp, Qwen Code, GitHub Copilot CLI, Factory Droid, Crush, Goose, Mistral Vibe, Qoder CLI, Kimi Code CLI, GitLab Duo CLI, Rovo Dev CLI, Amp, Devin CLI / Local, Tabnine, Amazon Q Developer IDE, CodeBuddy Code CLI, IBM Bob Shell, Pochi, and Pi.
- Conditional or explicit (6) — Continue / cn, Visual Studio, TRAE, Roo Code, IBM Bob IDE, and Sourcegraph Cody. Bob IDE is touched only when
~/.bob/mcp.jsonalready exists. - New documented adapters — CodeBuddy uses
~/.codebuddy/.mcp.jsonwhile preserving active older files; Bob Shell uses~/.bob/mcp_settings.json; Pochi uses themcpsection in~/.pochi/config.jsonc; Amazon Q Developer IDE defaults to~/.aws/amazonq/default.jsonwhile preserving either documented alternative. - Lifecycle hooks stay conservative — Kimi uses
UserPromptSubmit; on macOS/Linux, GitLab Duo gets a fail-open userSessionStart, while Devin getsUserPromptSubmit,PostCompaction, and a deduplicatedSessionStartwhen Claude does not already provide it. Qoder, GitLab Duo, Devin, and Factory hooks are withheld on Windows without a documented shell/executor contract. Cline's auto-activating file hooks are withheld because their context output is not reliably consumed, CodeBuddy beta hooks are not auto-installed, and Cursor context hooks remain withheld. - Subagent access is explicit — Claude, Gemini, Kiro, Qwen, CodeBuddy, KiloCode, Mistral Vibe, Qoder, Junie, and Factory get documented graph profiles with the narrowest tool/server filters their schemas support. KiloCode and Vibe enumerate read-only query tools rather than using server wildcards. Cursor, Rovo, Pochi, and Cline use explicit parent handoff where child MCP is unavailable or unsafe; IBM Bob receives no invented hook or agent.
- Manual, UI, cloud, or repository-managed (not counted) — Qodo, Warp MCP, JetBrains AI/ACP, GitHub Copilot coding agent, Jules, CodeRabbit, Replit, BLACKBOX AI, Plandex, and SWE-agent. Warp is counted above for its detected skill installation; its MCP connection remains manual.
- 14 MCP tools — search, trace, architecture, impact analysis, Cypher queries, dead code detection, cross-service HTTP linking, ADR management, and more.
Supported Platforms
| OS | Architecture |
|---|---|
| macOS | arm64, amd64 |
| Linux | arm64, amd64 |
| Windows | arm64, amd64 |
Usage
codebase-memory-mcp install # configure all detected coding agents
codebase-memory-mcp --version
codebase-memory-mcp --help
codebase-memory-mcp update # update to latest release
codebase-memory-mcp uninstall # remove agent configs
CLI Mode
Every MCP tool is also available directly from the command line:
codebase-memory-mcp cli index_repository '{"repo_path": "/path/to/repo"}'
codebase-memory-mcp cli search_graph '{"name_pattern": ".*Handler.*", "label": "Function"}'
codebase-memory-mcp cli trace_call_path '{"function_name": "main", "direction": "both"}'
codebase-memory-mcp cli get_architecture '{}'
MCP Tools
| Category | Tools |
|---|---|
| Indexing | index_repository, list_projects, delete_project, index_status |
| Querying | search_graph, trace_call_path, detect_changes, query_graph |
| Analysis | get_architecture, get_graph_schema, get_code_snippet, search_code |
| Advanced | manage_adr, ingest_traces |
Performance
Benchmarked on Apple M3 Pro:
| Operation | Time |
|---|---|
| Linux kernel full index (28M LOC, 75K files) | 3 min |
| Django full index | ~6s |
| Cypher query | <1ms |
| Trace call path (depth=5) | <10ms |
Full Documentation
See github.com/DeusData/codebase-memory-mcp for the full README including all MCP tools, configuration options, graph data model, and language support details.
License
MIT