claudeers.

🔓 unclaimed — this page was auto-generated from GitHub. Are you the creator?

Claim this page →
// MCP Servers

codedb

Zig code intelligence server and MCP toolset for AI agents. Fast tree, outline, symbol, search, read, edit, deps, snapshot, and remote GitHub repo queries.

// MCP Servers[ cli ][ api ][ desktop ][ web ][ mobile ][ claude ]#claude#agentic-ai#agents#anthropic#cursor#gemini#mcp#openai#mcp-serversBSD-3-Clause$open-sourceupdated 15 days ago
Actively maintained
100/100
last commit 4 days ago
last release 4 days ago
releases 51
open issues 5
// install
{
  "mcpServers": {
    "codedb": {
      "command": "npx",
      "args": ["-y", "https://github.com/justrach/codedb"]
    }
  }
}

codedb


justrach%2Fcodedb | Trendshift

codedb

Code intelligence server for AI agents. Zig core. MCP native. Zero dependencies.

Structural indexing · Trigram search · Word index · Dependency graph · File watching · MCP + HTTP

A context engine, not an editor. codedb helps agents find and understand code — search, symbols, callers, dependencies, outlines — and hands editing back to your native tools. codedb_edit is only a fallback.

Status · Install · Quick Start · MCP Tools · Benchmarks · Architecture · Data & Privacy · Building


Status

Alpha software — API is stabilizing but may change

codedb works and is used daily in production AI workflows, but:

  • Parser support — Zig, C/C++, Python, TypeScript/JavaScript, Rust, Go, PHP, Ruby, HCL, R, Dart/Flutter
  • Lightweight outline support — Java, Kotlin, Svelte, Vue, Astro, shell, CSS/SCSS, SQL, protobuf, Fortran, LLVM IR, MLIR, and TableGen
  • No auth — HTTP server binds to localhost only
  • Snapshot format may change between versions
  • MCP protocol is JSON-RPC 2.0 over stdio (stable)
What works todayWhat's in progress
21 MCP tools for full codebase intelligenceDeeper parser coverage and edge-case handling
Trigram v2: integer doc IDs, batch-accumulate, merge intersectIncremental segment-based indexing
538x faster than ripgrep on pre-indexed queriesWASM target for Cloudflare Workers
O(1) inverted word index for identifier lookupMulti-project support
Structural outlines (functions, structs, imports)mmap-backed trigram index
Reverse dependency graph
Fallback editor: atomic line-range edits + version tracking
Auto-registration in Claude, Codex, Gemini, Cursor, Windsurf, Devin
Polling file watcher with filtered directory walker
Portable snapshot for instant MCP startup
Singleton MCP with PID lock + 1h idle timeout
Sensitive file blocking (.env, credentials, keys)
Codesigned macOS ARM64 binary; Intel slice temporarily unsigned
SHA256 checksum verification in installer
Cross-platform: macOS (ARM/x86), Linux (ARM/x86)

⚡ Install

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, and Devin — 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.

Or via npm/npx (zero-install for MCP clients)

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.

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

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.

Documentation

  • MCP setup — per-client configurations (Claude Desktop, Cursor, VS Code, Claude Code, Codex CLI, Gemini CLI), root resolution, troubleshooting
  • Skill base & context filesagents.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
PlatformBinarySigned
macOS ARM64 (Apple Silicon)codedb-darwin-arm64✅ codesigned + notarized
macOS x86_64 (Intel)codedb-darwin-x86_64temporarily unsigned
Linux ARM64codedb-linux-arm64
Linux x86_64codedb-linux-x86_64

Or install manually from GitHub Releases.


⚡ Quick Start

After installing, codedb is automatically registered. Just open a project and the 21 MCP tools are available to your AI agent.

# Manual MCP start (auto-configured by install script)
codedb mcp /path/to/your/project

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

21 tools over the Model Context Protocol (JSON-RPC 2.0 over stdio). codedb's job is to give agents context — fast structural search, symbols, callers, dependencies, and outlines — not to be your editor. Editing is intentionally a fallback (codedb_edit); prefer your client's native edit tools.

ToolDescription
codedb_treeFull file tree with language, line counts, symbol counts
codedb_outlineSymbols in a file: functions, structs, imports, with line numbers
codedb_symbolFind where a symbol is defined across the codebase
codedb_searchTrigram-accelerated full-text search (supports regex, scoped results)
codedb_wordO(1) inverted index word lookup
codedb_callersEvery call site of a symbol — word index ∩ outline scope, in one round-trip
codedb_contextTask-shaped composer — pass a NL task, get keywords + symbol defs + ranked files + top snippets in one block (replaces 3–5 sequential calls)
codedb_hotMost recently modified files
codedb_depsDependency graph: imported_by (default) or depends_on; transitive=true for full BFS
codedb_readRead file content (line ranges, if_hash skip-unchanged, compact mode)
codedb_editFallback editorstr_replace/replace/insert/delete/create (atomic writes, optional if_hash guard). Prefer your client's native edit tool; codedb is for context, not editing
codedb_changesChanged files since a sequence number
codedb_statusIndex status (file count, current sequence, scan phase)
codedb_snapshotFull pre-rendered JSON snapshot of the codebase
codedb_remoteQuery indexed public repos via api.wiki.codes — no local clone needed
codedb_projectsList all locally indexed projects on this machine
codedb_indexIndex a local folder and write codedb.snapshot
codedb_findFuzzy file-name search (typo-tolerant subsequence match against indexed paths — not a content/symbol search)
codedb_globMatch indexed paths against a glob pattern (src/**/*.zig, *.md, …)
codedb_lsList immediate children of a directory — dirs first, then files with language + counts
codedb_queryComposable pipeline — chain find, search, filter, deps, outline, read, sort, limit in one request

codedb_remote — Cloud Intelligence

Query any indexed public GitHub repo without cloning it. codedb_remote always uses api.wiki.codes; the old codegraff backend name is no longer a supported route. Omit backend, or keep backend="wiki" only for older prompts.

# Check what the remote slug supports
codedb_remote repo="vercel/next.js" action="actions"

# Get a compact directory summary instead of dumping a huge file list
codedb_remote repo="vercel/next.js" action="tree" expand=false

# Page a file tree by prefix and limit
codedb_remote repo="vercel/next.js" action="tree" prefix="packages/" limit=100

# Search for code in a dependency
codedb_remote repo="justrach/merjs" action="search" query="handleRequest"

# Read a small file slice
codedb_remote repo="openai/codex" action="read" path="codex-rs/core/src/codex.rs" lines="1-80"

# Exact symbol lookup
codedb_remote repo="justrach/codedb" action="symbol" query="buildSnapshot"

# Check dependency CVE evidence; scope can be runtime or all
codedb_remote repo="axios/axios" action="cves" scope="runtime"

# Raw wiki slugs are accepted for repos that are indexed that way
codedb_remote repo="chromium" action="policy"

Remote actions: actions, tree, outline, search, read, symbol, policy, deps, score, cves, commits, branches, dep-history

For Codex and Claude Code hook examples around codedb_remote, see docs/hooks-labs.md.

Note: This tool calls https://api.wiki.codes. No API key required. The repo must already be indexed by the public service.

CLI Commands

CommandDescription
codedb treeShow 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 hotRecently modified files
codedb snapshotWrite codedb.snapshot to project root
codedb serveHTTP daemon on :7719
codedb mcp [path]JSON-RPC/MCP server over stdio
codedb updateSelf-update to the latest release; if it fails on an older build, rerun the curl installer above
codedb nukeUninstall codedb, remove caches/snapshots, and deregister MCP integrations
codedb --versionPrint version

Options: --no-telemetry (or set CODEDB_NO_TELEMETRY env var)

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):

Querycodedb MCPcodedb CLIast-grepripgrepgrepMCP speedup
File tree0.04 ms52.9 ms1,253x vs CLI
Symbol search (init)0.10 ms54.1 ms3.2 ms6.3 ms6.5 ms549x vs CLI
Full-text search (allocator)0.05 ms60.7 ms3.2 ms5.3 ms6.6 ms1,340x vs CLI
Word index (self)0.04 ms59.7 msn/a7.2 ms6.5 ms1,404x vs CLI
Structural outline0.05 ms53.5 ms3.1 ms2.4 ms1,143x vs CLI
Dependency graph0.05 ms2.2 msn/an/an/a45x vs CLI

merjs repo (100 files, 17.3k lines):

Querycodedb MCPcodedb CLIast-grepripgrepgrepMCP speedup
File tree0.05 ms54.0 ms1,173x vs CLI
Symbol search (init)0.07 ms54.4 ms3.4 ms6.3 ms3.6 ms758x vs CLI
Full-text search (allocator)0.03 ms54.1 ms2.9 ms5.1 ms3.7 ms1,554x vs CLI
Word index (self)0.04 ms54.7 msn/a6.3 ms4.2 ms1,518x vs CLI
Structural outline0.04 ms54.9 ms3.4 ms2.5 ms1,243x vs CLI

rtk-ai/rtk repo (329 files) — codedb vs rtk vs ripgrep vs grep:

ToolSearch "agent"Speedup
codedb (pre-indexed)0.065 msbaseline
rtk37 ms569x slower
ripgrep45 ms692x slower
grep80 ms1,231x slower

Token Efficiency

codedb returns structured, relevant results — not raw line dumps. For AI agents, this means dramatically fewer tokens per query:

Repocodedb MCPripgrep / grepReduction
codedb (search allocator)~20 tokens~32,564 tokens1,628x fewer
merjs (search allocator)~20 tokens~4,007 tokens200x 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:

RepoFilesCold startPer filevs v0.2.56
codedb2017 ms0.85 ms
merjs10016 ms0.16 ms
5,200 mixed files5,200310 ms0.06 ms
openclaw/openclaw6,315346 ms0.05 ms10× faster

Indexes are built once on startup. After that, the file watcher keeps them updated incrementally (single-file re-index: <2ms). Queries never re-scan the filesystem. For repos >1000 files, file contents are released after indexing to save ~300-500MB.

Background Resource Usage (openclaw, 6,315 files, Apple M4 Pro)

Metricv0.2.56v0.2.57Delta
Steady-state RSS1,867 MB1,706 MB−161 MB
git subprocesses / min (idle)~30~0mtime-gated

The watcher now stats .git/HEAD mtime before forking git rev-parse HEAD. On an idle repo the subprocess never fires.

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

Featurecodedb MCPcodedb CLIast-grepripgrepgrepctags
Structural parsing
Trigram search index
Inverted word index
Dependency graph
Version tracking
Multi-agent locking
Pre-indexed (warm)
No process startup
MCP protocol
Full-text search
Atomic file edits
File watcher

codedb = tree-sitter + search index + dependency graph + agent runtime. Zero external dependencies. Pure Zig. Single binary.


🏗️ Architecture

┌─────────────┐     ┌─────────────┐
│  HTTP :7719 │     │  MCP stdio  │
│  server.zig │     │  mcp.zig    │
└──────┬──────┘     └──────┬──────┘
       │                   │
       └───────┬───────────┘
               │
    ┌──────────▼──────────┐
    │     Explorer        │
    │   explore.zig       │
    │  ┌───────────────┐  │
    │  │ WordIndex      │  │
    │  │ TrigramIndex   │  │
    │  │ Outlines       │  │
    │  │ Contents       │  │
    │  │ DepGraph       │  │
    │  └───────────────┘  │
    └──────────┬──────────┘
               │
    ┌──────────▼──────────┐
    │      Store          │──── data.log
    │    store.zig        │
    └──────────┬──────────┘
               │
    ┌──────────▼──────────┐
    │     Watcher         │ ← polls every 2s
    │   watcher.zig       │
    │  (FilteredWalker)   │
    └─────────────────────┘

No SQLite. No dependencies. Purpose-built data model:

  • Explorer — structural index engine. Parses Zig, Python, TypeScript/JavaScript, Rust, Go, PHP, Ruby, HCL, R, and Dart. Maintains outlines, trigram index, inverted word index, content cache, and dependency graph behind a single mutex.
  • Store — append-only version log. Every mutation (snapshot, edit, delete) gets a monotonically increasing sequence number. Version history capped at 100 per file.
  • Watcher — polling file watcher (2s interval). FilteredWalker prunes .git, node_modules, zig-cache, __pycache__, etc. before descending.
  • Agents — first-class structs with cursors, heartbeats, and exclusive file locks. Stale agents reaped after 30s.

Threading Model

ThreadRole
MainHTTP accept loop or MCP read loop
WatcherPolls filesystem every 2s via FilteredWalker
ISRRebuilds snapshot when stale flag is set
ReapCleans up stale agents every 5s
Per-connectionHTTP server spawns a thread per connection

All threads share a shutdown: atomic.Value(bool) for graceful termination.


🔒 Data & Privacy

codedb collects anonymous usage telemetry to improve the tool. Telemetry is on by default — written to ~/.codedb/telemetry.ndjson and periodically synced to the codedb analytics endpoint. No source code, file contents, file paths, or search queries are collected — only aggregate tool call counts, latency, and startup stats.

LocationContentsPurpose
~/.codedb/projects/<hash>/Trigram index, frequency table, data logPersistent index cache
~/.codedb/telemetry.ndjsonAggregate tool calls and startup statsLocal telemetry log
./codedb.snapshotFile tree, outlines, content, frequency tablePortable snapshot for instant MCP startup

Not stored: No source code is sent anywhere. No file contents, file paths, or search queries are collected in telemetry. Sensitive files auto-excluded (.env*, credentials.json, secrets.*, .pem, .key, SSH keys, AWS configs).

To disable telemetry: set CODEDB_NO_TELEMETRY=1 or pass --no-telemetry.

To sync the local NDJSON file into Postgres for analysis or dashboards, use scripts/sync-telemetry.py with the schema in docs/telemetry/postgres-schema.sql. The data flow is documented in docs/telemetry.md.

codedb nuke                # uninstall binary, clear caches/snapshots, remove MCP registrations
rm -rf ~/.codedb/          # cache-only cleanup if you want to keep the binary installed
rm -f codedb.snapshot      # remove snapshot from current project only

🔨 Building from Source

Requirements: Zig 0.16+

git clone https://github.com/justrach/codedb.git
cd codedb
zig build                              # debug build
zig build -Doptimize=ReleaseFast       # release build
zig build test                         # run tests
zig build bench                        # run benchmarks

Binary: zig-out/bin/codedb

Cross-compilation

zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux
zig build -Doptimize=ReleaseFast -Dtarget=aarch64-linux
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-macos

Releasing

./release.sh 0.2.0              # build, codesign, notarize, upload to GitHub Releases
./release.sh 0.2.0 --dry-run    # preview without executing

License

See LICENSE for details.

// compatibility

Platformscli, api, desktop, web, mobile
Operating systems
AI compatibilityclaude
LicenseBSD-3-Clause
Pricingopen-source
LanguageZig

// faq

What is codedb?

Zig code intelligence server and MCP toolset for AI agents. Fast tree, outline, symbol, search, read, edit, deps, snapshot, and remote GitHub repo queries.. It is open-source on GitHub.

Is codedb free to use?

codedb is open-source under the BSD-3-Clause license, so it is free to use.

What category does codedb belong to?

codedb is listed under mcp-servers in the Claudeers registry of Claude-compatible tools.

0 views
1,341 stars
unclaimed
updated 15 days ago

// embed badge

codedb on Claudeers
[![Claudeers](https://claudeers.com/api/badge/codedb.svg)](https://claudeers.com/codedb)

// retro hit counter

codedb hit counter
[![Hits](https://claudeers.com/api/counter/codedb.svg)](https://claudeers.com/codedb)

// reviews

// guestbook

0/500

// related in MCP Servers

🔓

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete…

// mcp-serversf/HTML164,687NOASSERTION[ claude ]
🔓

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io

// mcp-serversfarion1231/Rust112,854MIT[ claude ]
🔓

An open-source AI agent that brings the power of Gemini directly into your terminal.

// mcp-serversgoogle-gemini/TypeScript105,729Apache-2.0[ claude ]
🔓

A collection of MCP servers.

// mcp-serverspunkpeye/90,251MIT[ claude ]

// built by

Ecosystem hubone of the most connected projects in the claude ecosystem · 47 connections

1 of its contributors also build on official projectsclaude-code, claude-cookbooks, claude-plugins-official

→ see how codedb connects across the ecosystem