Provides code intelligence for AI agents by mapping repositories through symbol definitions, callers, outlines, and dependency graphs.
Also known as justrach/codedb, codedeebee
- Stars
- 1,402
- Tools
- 22
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Nov 9, 2026
- License
- BSD-3-Clause
What is codedb MCP?
codedb provides code intelligence for AI agents by mapping repositories through symbol definitions, callers, outlines, and dependency graphs. It exposes 22 tools, such as codedb_tree, codedb_outline, codedb_symbol.
Summary generated from the project's README
About codedb MCP server
Providing structural code intelligence to AI agents is what codedb does by mapping entire repositories through symbol definitions, callers, and dependency graphs. It acts as a context engine rather than an editor, helping developers navigate large codebases by offering focused source excerpts and outlines. The server is built in Zig and runs locally on macOS, Linux, and Windows, connecting to various MCP clients like Claude Code, Cursor, Windsurf, and Cline.
Users can integrate the server via a shell installer or npm, and it supports multiple languages including Python, TypeScript, Rust, Go, and C++. While structural searches run locally, the default hybrid retrieval uses hosted embeddings for semantic search, though users can opt for local-only retrieval by setting semantic to local. The system provides specialized tools such as codedb_callpath for tracing symbol chains and codedb_explain for viewing definitions alongside their callers.
What you can do with it
- 1Trace execution pathsAn agent can trace the shortest resolved chain between two specific symbols in a codebase.
- 2Locate relevant source contextAn AI can find specific files and code excerpts related to a particular task or feature.
- 3Browse repository structureAn agent can inspect the contents of a directory and view the outlines of individual files.
Written from the project's README. Every use case is checked against a quote from it.
How to install codedb MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall codedb MCP in Claude Code
$ claude mcp add codedb -- npx -y codedeebeeInstall codedb MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"codedb": {
"command": "npx",
"args": [
"-y",
"codedeebee"
]
}
}
}Install codedb MCP in VS Code
.vscode/mcp.json
{
"servers": {
"codedb": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"codedeebee"
]
}
}
}Install codedb MCP in VS Code CLI
$ code --add-mcp '{"name":"codedb","type":"stdio","command":"npx","args":["-y","codedeebee"]}'Install codedb MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"codedb": {
"command": "npx",
"args": [
"-y",
"codedeebee"
]
}
}
}Install codedb MCP in Codex
$ codex mcp add codedb -- npx -y codedeebeeInstall codedb MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.codedb] command = "npx" args = ["-y", "codedeebee"]
Install codedb MCP in Gemini CLI
$ gemini mcp add -s user codedb npx -- -y codedeebeeInstall codedb MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"codedb": {
"command": "npx",
"args": [
"-y",
"codedeebee"
]
}
}
}codedb MCP tools 22
Detected from the READMEcodedb_treecodedb_outlinecodedb_symbolcodedb_searchcodedb_wordcodedb_callerscodedb_explaincodedb_callpathcodedb_contextcodedb_hotcodedb_depscodedb_read
| codedb_tree | — | |
| codedb_outline | — | |
| codedb_symbol | — | |
| codedb_search | — | |
| codedb_word | — | |
| codedb_callers | — | |
| codedb_explain | — | |
| codedb_callpath | — | |
| codedb_context | — | |
| codedb_hot | — | |
| codedb_deps | — | |
| codedb_read | — |
Show all 22 toolsShow fewer tools
codedb_changescodedb_statuscodedb_snapshotcodedb_projectscodedb_indexcodedb_findcodedb_globcodedb_lscodedb_list_dircodedb_query
| codedb_changes | — | |
| codedb_status | — | |
| codedb_snapshot | — | |
| codedb_projects | — | |
| codedb_index | — | |
| codedb_find | — | |
| codedb_glob | — | |
| codedb_ls | — | |
| codedb_list_dir | — | |
| codedb_query | — |
Configuration
CODEDB_EMBEDDINGS_DIMENSIONSCODEDB_EMBEDDINGS_MODELCODEDB_EMBEDDINGS_TIMEOUT_MSCODEDB_EMBEDDINGS_TOKENCODEDB_EMBEDDINGS_URLCODEDB_SEMANTIC_INDEX_CONCURRENCY
| Name | Description | |
|---|---|---|
| CODEDB_EMBEDDINGS_DIMENSIONS | — | |
| CODEDB_EMBEDDINGS_MODEL | — | |
| CODEDB_EMBEDDINGS_TIMEOUT_MS | — | |
| CODEDB_EMBEDDINGS_TOKEN | — | |
| CODEDB_EMBEDDINGS_URL | — | |
| CODEDB_SEMANTIC_INDEX_CONCURRENCY | — |
Automated checks
Ran Nov 12, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packagePass
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledPass
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesNot checked
README
View on GitHubYour agent has a task. Somewhere in your repository are the definition it needs, the caller that explains it, and the test that keeps it honest. codedb draws the map: focused source context, symbols, callers, outlines, and dependencies. Your coding client uses its own native tools to make the edit.
A context engine, not an editor. codedb has no edit capability. Use it with Graff, Claude Code, Codex, Gemini CLI, Cursor, Windsurf, Devin, oh-my-pi, Hermes, Qwen Code, ZCode, Trae, Cline, Copilot CLI, Antigravity, Kiro, OpenCode, or another MCP client.
🧭 Give your agent a compass
| Ask your agent… | codedb helps it… |
|---|---|
| “Where does session refresh happen?” | Find relevant files and source excerpts with codedb_context |
| “Explain this function and who uses it.” | Read the definition and callers with codedb_explain |
| “How does this request reach the database?” | Trace a chain between symbols with codedb_callpath |
| “What's in this part of the repo?” | Browse with codedb_list_dir and inspect file outlines |
Structural search runs locally. Default hybrid retrieval also uses hosted
embeddings; choose semantic=local for local-only retrieval. See
Data & Privacy for what each mode sends and stores.
⚡ Install
macOS and Linux
curl -fsSL https://codedb.codegraff.com/install.sh | bash
Downloads the binary for your platform and auto-registers codedb as an MCP server in Claude Code, Codex, Gemini CLI, Cursor, Windsurf, Devin, oh-my-pi, Hermes, Qwen Code, ZCode, Trae, Cline, Copilot CLI, Antigravity, Kiro, and OpenCode — each written directly and additively into that tool's config (only when the tool is present). The installer prints the exact codedb mcp command it registered plus hook setup pointers for Codex and Claude Code.
On Windows, run this command inside WSL only if you want the Linux binary inside WSL. For the native Windows binary, use PowerShell below.
Windows
Run in PowerShell:
irm https://raw.githubusercontent.com/justrach/codedb/v0.2.5841/install/install.ps1 | iex
Run the same command again to update codedb.
npm/npx on macOS and Linux
npx -y codedeebee mcp
Or install globally:
npm install -g codedeebee
codedb mcp
The npm package is named codedeebee (the bare codedb name is restricted on npm); it ships a thin launcher that downloads the matching native binary from GitHub Releases on postinstall and verifies the SHA256 checksum. The installed CLI is still called codedb.
The launcher already knows how to fetch codedb-windows-x86_64.exe, but the currently published codedeebee predates that release asset, so npx -y codedeebee mcp does not work on Windows yet — it becomes available with the next published release. Use the PowerShell installer above until then.
Useful for MCP clients (Claude Code, Cursor, opencode, Claude Desktop) that already use npx:
{
"codedb": {
"type": "local",
"command": ["npx", "-y", "codedeebee"],
"args": ["mcp"],
"enabled": true
}
}
Updating or repairing an older install
On macOS or Linux, if codedb update fails on an older release, rerun the installer:
curl -fsSL https://codedb.codegraff.com/install.sh | bash
This replaces the codedb binary with the latest GitHub Release and keeps your existing MCP registrations, config, caches, and snapshots. Use this path for any release whose built-in updater cannot fetch release checksums.
Self-update works on native Windows from 0.2.5833 onward (codedb update). On older builds, rerun the PowerShell installer above to update or repair the binary.
🪟 Use codedb in Harness
Harness is a free desktop app for macOS and Windows that runs Graff, Claude Code, Codex, Cursor, and your other coding agents in one window, with each session's files, browser, and terminal beside it. The agents you run there use their usual MCP configuration, so the codedb registration from the installer carries over: install codedb once, and every agent in Harness can use the map.
An iPhone and iPad app for following and steering those sessions is in development. Join the waitlist.
🌱 Project status
Alpha: APIs and snapshot formats can change. The core speaks JSON-RPC 2.0 over stdio, with an optional localhost HTTP server.
- Parsers: Zig, C/C++, Python, TypeScript/JavaScript, Rust, Go, PHP, Ruby, HCL, R, Dart/Flutter, and OCaml; more languages have lightweight outlines.
- Navigation: task context, symbol definitions, callers, dependency graphs, trigram search, and portable snapshots.
- Live updates: recursive macOS events on local APFS/HFS volumes; bounded OS watches and periodic content verification on fallback paths. Each MCP process owns its watcher; multiple clients can multiply background work.
- Distribution: macOS, Linux, and Windows binaries; SHA256-verified downloads. macOS releases are signed and notarized.
Documentation
- MCP setup — per-client configurations (Claude Desktop, Cursor, VS Code, Claude Code, Codex CLI, Gemini CLI, oh-my-pi, Hermes, Qwen Code, ZCode, Trae, Cline, Copilot CLI, Antigravity, Kiro, OpenCode), root resolution, troubleshooting
- Skill base & context files —
agents.md/CLAUDE.md/GEMINI.md,.codedbrc, per-developer memory - CLI reference — every command, every flag
- Architecture — engine internals, index layout
- Benchmarks — micro-benchmarks + agentic-eval results vs codegraph, FTS5, lean-ctx
- Raspberry Pi 4 — full-performance ARM64 setup, Cortex-A72 build, and on-device benchmark
- Zig 0.17.0-dev migration guide — repeatable zigup workflow and API change recipes
| Platform | Binary | Signed |
|---|---|---|
| macOS ARM64 (Apple Silicon) | codedb-darwin-arm64 |
✅ codesigned + notarized |
| macOS x86_64 (Intel) | codedb-darwin-x86_64 |
codesigned + notarized (0.2.5833+) |
| Linux ARM64 | codedb-linux-arm64 |
— |
| Linux x86_64 | codedb-linux-x86_64 |
— |
| Windows x86_64 | codedb-windows-x86_64.exe |
SHA256 verified automatically |
Or install manually from GitHub Releases. Always verify the binary against the attached checksums.sha256 before running it.
⚡ Quick Start
As an MCP server (recommended)
The macOS/Linux shell installer registers codedb automatically. For npm/npx installs on macOS/Linux and manual Windows installs, use the MCP configuration above or the client-specific examples in docs/mcp.md. Then open a project and codedb’s tools are available to your AI agent.
# Manual MCP start (auto-configured by install script)
codedb mcp /path/to/your/project
For clients that open many unused MCP sessions (for example, one per worktree),
try experimental lazy MCP startup with
CODEDB_LAZY_MCP=1. Indexing starts on the first code request; eager startup
remains the default.
As an HTTP server
codedb serve /path/to/your/project
# listening on localhost:7719
CLI
codedb tree /path/to/project # file tree with symbol counts
codedb outline src/main.zig # symbols in a file
codedb find AgentRegistry # find symbol definitions
codedb search "handleAuth" # full-text search (trigram-accelerated)
codedb word Store # exact word lookup (inverted index, O(1))
codedb hot # recently modified files
🔧 MCP Tools
Tools over the Model Context Protocol (JSON-RPC 2.0 over stdio). Agents see five one-shots by default (context, explain, callpath, list_dir, status). codedb's job is to give agents context — not to be your editor. codedb has no edit tool; use your client's native edit tools.
| Tool | Description |
|---|---|
codedb_tree |
Full file tree with language, line counts, symbol counts |
codedb_outline |
Symbols in a file: functions, structs, imports, with line numbers |
codedb_symbol |
Find where a symbol is defined across the codebase |
codedb_search |
Trigram-accelerated full-text search (supports regex, scoped results) |
codedb_word |
O(1) inverted index word lookup |
codedb_callers |
Every call site of a symbol — word index ∩ outline scope, in one round-trip |
codedb_explain |
Definition body + callers in one call (CLI aliases: explain, around) |
codedb_callpath |
Shortest resolved call chain A→B (CLI alias: path); duplicate names list candidates—pass from_path / to_path (or CLI --from-path / --to-path) to select a file |
codedb_context |
Task-shaped composer — Pareto-frontier hybrid retrieval by default: local BM25/symbol retrieval first, then local ANN search using a remote task embedding plus a fixed public calibration string when an explicit sidecar exists, or a bounded transient semantic rerank otherwise. Pass semantic=local for an on-device-only call. format=json adds typed provenance and retrieval-privacy metadata; document_hops=1..2 expands linked Markdown |
codedb_hot |
Most recently modified files |
codedb_deps |
Typed dependency graph: imports by default, or Markdown links with edge_type=documents; document traversal is capped at 2 hops / 64 files |
codedb_read |
Read file content (line ranges, if_hash skip-unchanged, compact mode) |
codedb_changes |
Changed files since a sequence number |
codedb_status |
Index status (file count, current sequence, scan phase) |
codedb_snapshot |
Full pre-rendered JSON snapshot of the codebase |
codedb_projects |
List all locally indexed projects on this machine |
codedb_index |
Index a local folder and write codedb.snapshot |
codedb_find |
Fuzzy file-name search (typo-tolerant subsequence match against indexed paths — not a content/symbol search) |
codedb_glob |
Match indexed paths against a glob pattern (src/**/*.zig, *.md, …) |
codedb_ls |
List immediate children of a directory — dirs first, then files with language + counts |
codedb_list_dir |
Live BFS folder listing (gitignore, 10k cap) — works without an index |
codedb_query |
Composable pipeline — chain find, search, filter, deps, outline, read, sort, limit in one request |
codedb_context accepts max_tokens as a conservative approximate response
budget. Compact evidence is admitted progressively; when the remaining
evidence does not fit, the response reports the omission once instead of
overflowing the request with lower-priority sections.
MCP responses are plain text by default, without ANSI styling. Set
CODEDB_MCP_ANSI=1 in the MCP server environment to opt into ANSI-colored
summary and guidance blocks for clients that render terminal colors.
Tool profile: agent harnesses default to mini — five one-shot tools
(context, explain, callpath, list_dir, status). Hop tools stay
callable; they are not advertised. CODEDB_TOOLS_PROFILE=core is the older
10-tool navigation set; slim is the terse hop six; full advertises
everything. GUI clients that emit rich blocks still get full unless the
env var is set.
Public repos — DeepWiki (remote MCP)
codedb indexes your checked-out code. For
questions about public GitHub repos, the installer registers
DeepWiki (https://mcp.deepwiki.com/mcp — free, no
auth) as a separate remote MCP server in each detected client, with tools
read_wiki_structure, read_wiki_contents, and ask_question. Opt out at
install time with CODEDB_INSTALL_DEEPWIKI=0. (The old codedb_remote tool
backed by api.wiki.codes was removed; DeepWiki replaces that role.)
CLI Commands
| Command | Description |
|---|---|
codedb tree |
Show file tree with language and symbol counts |
codedb outline <path> |
List all symbols in a file |
codedb find <name> |
Find where a symbol is defined |
codedb search <query> |
Full-text search (trigram, case-insensitive) |
codedb search --regex <pattern> |
Regex search |
codedb word <identifier> |
Exact word lookup via inverted index |
codedb read <path> |
Read file contents (supports -L FROM-TO, --compact) |
codedb hot |
Recently modified files |
codedb reindex |
Force a fresh filesystem scan, rebuild all local indexes, and refresh the live daemon |
codedb snapshot |
Write codedb.snapshot to project root |
codedb serve |
HTTP daemon on :7719 |
codedb mcp [path] |
JSON-RPC/MCP server over stdio |
codedb update |
Self-update to the latest release; older builds can be repaired with the installer |
codedb nuke |
Uninstall codedb, remove caches/snapshots, and deregister MCP integrations |
codedb --version |
Print version |
Options: --no-telemetry (or set CODEDB_NO_TELEMETRY env var)
Claude Code hook opt-out: the installer registers a PreToolUse hook that nudges agents from grep/cat to codedb inside indexed repos. CODEDB_NO_HOOKS=1 skips it for that run only (it is never persisted from the environment, so a transient export can't be promoted to a permanent opt-out by the background auto-updater). To make it permanent, run the installer with CODEDB_PERSIST_NO_HOOKS=1 or touch ~/.codedb/no-hooks; rm ~/.codedb/no-hooks re-enables it. Deleting the hook entry from ~/.claude/settings.json is also permanent — the installer records its registrations and treats a missing entry as a deliberate removal (it writes ~/.codedb/no-hooks for you, so rm that file to undo).
Example: agent explores a codebase
# 1. Get the file tree
curl localhost:7719/tree
# → src/main.zig (zig, 55L, 4 symbols)
# src/store.zig (zig, 156L, 12 symbols)
# src/agent.zig (zig, 135L, 8 symbols)
# 2. Drill into a file
curl "localhost:7719/outline?path=src/store.zig"
# → L20: struct_def Store
# L30: function init
# L55: function recordSnapshot
# 3. Find a symbol across the codebase
curl "localhost:7719/symbol?name=AgentRegistry"
# → {"path":"src/agent.zig","line":30,"kind":"struct_def"}
# 4. Full-text search
curl "localhost:7719/search?q=handleAuth&max=10"
# 5. Check what changed
curl "localhost:7719/changes?since=42"
📊 Benchmarks
Measured on Apple M4 Pro, 48GB RAM. MCP = pre-indexed warm queries (20 iterations avg). CLI/external tools include process startup (3 iterations avg). Ground truth verified against Python reference implementation.
Latency — codedb MCP vs codedb CLI vs ast-grep vs ripgrep vs grep
codedb repo (20 files, 12.6k lines):
| Query | codedb MCP | codedb CLI | ast-grep | ripgrep | grep | MCP speedup |
|---|---|---|---|---|---|---|
| File tree | 0.04 ms | 52.9 ms | — | — | — | 1,253x vs CLI |
Symbol search (init) |
0.10 ms | 54.1 ms | 3.2 ms | 6.3 ms | 6.5 ms | 549x vs CLI |
Full-text search (allocator) |
0.05 ms | 60.7 ms | 3.2 ms | 5.3 ms | 6.6 ms | 1,340x vs CLI |
Word index (self) |
0.04 ms | 59.7 ms | n/a | 7.2 ms | 6.5 ms | 1,404x vs CLI |
| Structural outline | 0.05 ms | 53.5 ms | 3.1 ms | — | 2.4 ms | 1,143x vs CLI |
| Dependency graph | 0.05 ms | 2.2 ms | n/a | n/a | n/a | 45x vs CLI |
merjs repo (100 files, 17.3k lines):
| Query | codedb MCP | codedb CLI | ast-grep | ripgrep | grep | MCP speedup |
|---|---|---|---|---|---|---|
| File tree | 0.05 ms | 54.0 ms | — | — | — | 1,173x vs CLI |
Symbol search (init) |
0.07 ms | 54.4 ms | 3.4 ms | 6.3 ms | 3.6 ms | 758x vs CLI |
Full-text search (allocator) |
0.03 ms | 54.1 ms | 2.9 ms | 5.1 ms | 3.7 ms | 1,554x vs CLI |
Word index (self) |
0.04 ms | 54.7 ms | n/a | 6.3 ms | 4.2 ms | 1,518x vs CLI |
| Structural outline | 0.04 ms | 54.9 ms | 3.4 ms | — | 2.5 ms | 1,243x vs CLI |
rtk-ai/rtk repo (329 files) — codedb vs rtk vs ripgrep vs grep:
| Tool | Search "agent" | Speedup |
|---|---|---|
| codedb (pre-indexed) | 0.065 ms | baseline |
| rtk | 37 ms | 569x slower |
| ripgrep | 45 ms | 692x slower |
| grep | 80 ms | 1,231x slower |
Token Efficiency
codedb returns structured, relevant results — not raw line dumps. For AI agents, this means dramatically fewer tokens per query:
| Repo | codedb MCP | ripgrep / grep | Reduction |
|---|---|---|---|
codedb (search allocator) |
~20 tokens | ~32,564 tokens | 1,628x fewer |
merjs (search allocator) |
~20 tokens | ~4,007 tokens | 200x fewer |
Indexing Speed
codedb v0.2.57 uses worker-local parallel scan with deterministic merge — each worker builds its own partial index, then results are merged on the main thread:
| Repo | Files | Cold start | Per file | vs v0.2.56 |
|---|---|---|---|---|
| codedb | 20 | 17 ms | 0.85 ms | — |
| merjs | 100 | 16 ms | 0.16 ms | — |
| 5,200 mixed files | 5,200 | 310 ms | 0.06 ms | — |
| openclaw/openclaw | 6,315 | 346 ms | 0.05 ms | 10× faster |
Indexes are built on startup and the watcher keeps them updated. The historical single-file indexing time above excludes event coalescing, polling delay, and queueing. Indexed queries reuse the index; live listing and fallback reads may access the filesystem. For repos >1000 files, file contents are released after indexing to save ~300-500MB.
Historical background measurements (openclaw, 6,315 files, Apple M4 Pro)
| Metric | v0.2.56 | v0.2.57 | Delta |
|---|---|---|---|
| Steady-state RSS | 1,867 MB | 1,706 MB | −161 MB |
git subprocesses / min (idle) |
~30 | ~0 | mtime-gated |
The watcher stats .git/HEAD mtime before forking git rev-parse HEAD. These historical measurements do not bound watcher CPU under filesystem churn; see the issue #748 reproduction.
Why codedb is fast
- MCP server indexes once on startup → all queries hit in-memory data structures (O(1) hash lookups)
- CLI pays ~55ms process startup + full filesystem scan on every invocation
- ast-grep re-parses all files through tree-sitter on every call (~3ms)
- ripgrep/grep brute-force scan every file on every call (~5-7ms)
- The MCP advantage: index once, query thousands of times at sub-millisecond latency
Feature Matrix
| Feature | codedb MCP | codedb CLI | ast-grep | ripgrep | grep | ctags |
|---|---|---|---|---|---|---|
| Structural parsing | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ |
| Trigram search index | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Inverted word index | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Dependency graph | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Version tracking | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Pre-indexed (warm) | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| No process startup | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| MCP protocol | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Full-text search | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| File watcher | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
A map for the next step: structural parsers, search indexes, and a dependency graph in one Zig binary.
codedb MCP questions
How do I add codedb MCP to Claude Code?
Run claude mcp add codedb -- npx -y codedeebee in your terminal. Add --scope user to make it available in every project.
How do I add codedb MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does codedb MCP provide?
It exposes 22 tools, including codedb_tree, codedb_outline, codedb_symbol, codedb_search, codedb_word.
Can codedb edit my code?
No, codedb is a context engine, not an editor, and has no edit capability. You should use your client's native tools to make edits.
What programming languages are supported?
It supports Zig, C/C++, Python, TypeScript/JavaScript, Rust, Go, PHP, Ruby, HCL, R, Dart/Flutter, and OCaml.