{"slug": "code-intelligence-mcp-server", "title": "Code Intelligence MCP Server", "summary": "DeusData released Code Intelligence MCP Server, a code intelligence engine that indexes repositories in milliseconds and the Linux kernel in 3 minutes, providing structural queries in under 1ms via a single static binary for macOS, Linux, and Windows. The tool uses tree-sitter AST analysis and hybrid LSP resolution across 158 languages, offering 14 MCP tools and achieving 83% answer quality with 10x fewer tokens in benchmarks.", "body_md": "**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. Ships as a single static binary for macOS, Linux, and Windows — download, run `install`\n\n, done.\n\nHigh-quality parsing through [tree-sitter](https://tree-sitter.github.io/tree-sitter/) AST analysis across all 158 languages, enhanced with [ Hybrid LSP semantic type resolution](#hybrid-lsp) for Python, TypeScript / JavaScript / JSX / TSX, PHP, C#, Go, C, C++, Java, Kotlin, and Rust — producing a persistent knowledge graph of functions, classes, call chains, HTTP routes, and cross-service links. 14 MCP tools. Zero dependencies. Plug and play across 11 coding agents.\n\nResearch— The design and benchmarks behind this project are described in the preprint[(arXiv:2603.27277). Evaluated across 31 real-world repositories: 83% answer quality, 10× fewer tokens, 2.1× fewer tool calls vs. file-by-file exploration.]Codebase-Memory: Tree-Sitter-Based Knowledge Graphs for LLM Code Exploration via MCP\n\nSecurity & Trust— This tool reads your codebase and writes to your agent configuration files. That is what it is designed to do. If you prefer to audit before running, the[full source is here]— every release binary is signed, checksummed, and scanned by 70+ antivirus engines. All processing happens 100% locally; your code never leaves your machine. Found a security issue? We want to know — see[SECURITY.md]. Security is Priority #1 for us.\n\n[\n](/DeusData/codebase-memory-mcp/blob/main/docs/graph-ui-screenshot.png)\n\n*Built-in 3D graph visualization (UI variant) — explore your knowledge graph at localhost:9749*\n\n**Extreme indexing speed**— Linux kernel (28M LOC, 75K files) in 3 minutes. RAM-first pipeline: LZ4 compression, in-memory SQLite, fused Aho-Corasick pattern matching. Memory released after indexing.**Plug and play**— single static binary for macOS (arm64/amd64), Linux (arm64/amd64), and Windows (amd64). No Docker, no runtime dependencies, no API keys. Download →`install`\n\n→ restart agent → done.**158 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. One graph query replaces dozens of grep/read cycles.**11 agents, one command**—`install`\n\nauto-detects Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode, VS Code, OpenClaw, and Kiro — configures MCP entries, instruction files, and pre-tool hooks for each.**Built-in graph visualization**— 3D interactive UI at`localhost:9749`\n\n(optional UI binary variant).**Infrastructure-as-code indexing**— Dockerfiles, Kubernetes manifests, and Kustomize overlays indexed as graph nodes with cross-references.`Resource`\n\nnodes for K8s kinds,`Module`\n\nnodes for Kustomize overlays with`IMPORTS`\n\nedges to referenced resources.**14 MCP tools**— search, trace, architecture, impact analysis, Cypher queries, dead code detection, cross-service HTTP linking, ADR management, and more.\n\n**One-line install** (macOS / Linux):\n\n```\ncurl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash\n```\n\nWith graph visualization UI:\n\n```\ncurl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash -s -- --ui\n```\n\n**Windows** (PowerShell):\n\n```\n# 1. Download the installer\nInvoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1\n\n# 2. (Optional but recommended) Inspect the script\nnotepad install.ps1\n\n# 3. Run it\n.\\install.ps1\n```\n\nOptions: `--ui`\n\n(graph visualization), `--skip-config`\n\n(binary only, no agent setup), `--dir=<path>`\n\n(custom location).\n\nRestart your coding agent. Say **\"Index this project\"** — done.\n\n## Manual install\n\n-\n**Download** the archive for your platform from the[latest release](https://github.com/DeusData/codebase-memory-mcp/releases/latest):`codebase-memory-mcp-<os>-<arch>.tar.gz`\n\n(macOS/Linux) or`.zip`\n\n(Windows) — standard`codebase-memory-mcp-ui-<os>-<arch>.tar.gz`\n\n/`.zip`\n\n— with graph visualization\n\n-\n**Extract and install**(each archive includes`install.sh`\n\nor`install.ps1`\n\n):macOS / Linux:\n\n```\ntar xzf codebase-memory-mcp-*.tar.gz\n./install.sh\n```\n\nWindows (PowerShell):\n\n```\nExpand-Archive codebase-memory-mcp-windows-amd64.zip -DestinationPath .\n.\\install.ps1\n```\n\n-\n**Restart** your coding agent.\n\nThe `install`\n\ncommand automatically strips macOS quarantine attributes and ad-hoc signs the binary — no manual `xattr`\n\n/`codesign`\n\nneeded.\n\nThe `install`\n\ncommand auto-detects all installed coding agents and configures MCP server entries, instruction files, skills, and pre-tool hooks for each.\n\nIf you downloaded the `ui`\n\nvariant:\n\n```\ncodebase-memory-mcp --ui=true --port=9749\n```\n\nOpen `http://localhost:9749`\n\nin your browser. The UI runs as a background thread alongside the MCP server — it's available whenever your agent is connected.\n\nEnable automatic indexing on MCP session start:\n\n```\ncodebase-memory-mcp config set auto_index true\n```\n\nWhen enabled, new projects are indexed automatically on first connection. Previously-indexed projects are registered with the background watcher for ongoing git-based change detection. Configurable file limit: `config set auto_index_limit 50000`\n\n.\n\n```\ncodebase-memory-mcp update\n```\n\nThe MCP server also checks for updates on startup and notifies on the first tool call if a newer release is available.\n\n```\ncodebase-memory-mcp uninstall\n```\n\nRemoves all agent configs, skills, hooks, and instructions. Does not remove the binary or SQLite databases.\n\n**Architecture overview**:`get_architecture`\n\nreturns languages, packages, entry points, routes, hotspots, boundaries, layers, and clusters in a single call**Architecture Decision Records**:`manage_adr`\n\npersists architectural decisions across sessions**Louvain community detection**: Discovers functional modules by clustering call edges** Git diff impact mapping**:`detect_changes`\n\nmaps uncommitted changes to affected symbols with risk classification**Call graph**: Resolves function calls across files and packages (import-aware, type-inferred)** Dead code detection**: Finds functions with zero callers, excluding entry points** Cypher-like queries**:`MATCH (f:Function)-[:CALLS]->(g) WHERE f.name = 'main' RETURN g.name`\n\n**Semantic search**(`semantic_query`\n\n): vector search across the entire graph, powered by bundled Nomic`nomic-embed-code`\n\nembeddings (40K tokens, 768d int8) compiled into the binary — no API key, no Ollama, no Docker. 11-signal combined scoring (TF-IDF, RRI, API/Type/Decorator signatures, AST profiles, data flow, Halstead-lite, MinHash, module proximity, graph diffusion).**BM25 full-text search** via SQLite FTS5 with`cbm_camel_split`\n\ntokenizer (camelCase / snake_case aware)**Structural search**(`search_graph`\n\n): regex name patterns, label filters, min/max degree, file scoping**Code search**(`search_code`\n\n): graph-augmented grep over indexed files only\n\n**HTTP** route ↔ call-site matching with confidence scoring**gRPC, GraphQL, tRPC** service detection with protobuf Route extraction**Channel detection**(`EMITS`\n\n/`LISTENS_ON`\n\n) for Socket.IO, EventEmitter, and generic pub-sub patterns across 8 languages with constant resolution\n\nlink nodes across multiple repos indexed under the same store`CROSS_*`\n\nedges**Multi-galaxy 3D UI layout** for cross-repo architecture visualization**Cross-repo architecture summary** combining services, routes, and dependencies across the indexed fleet\n\n`CALLS`\n\n,`IMPORTS`\n\n,`DEFINES`\n\n,`IMPLEMENTS`\n\n,`INHERITS`\n\n`HTTP_CALLS`\n\n,`ASYNC_CALLS`\n\n(cross-service)`EMITS`\n\n,`LISTENS_ON`\n\n(channels)`DATA_FLOWS`\n\nwith arg-to-param mapping + field access chains`SIMILAR_TO`\n\n(MinHash + LSH near-clone detection, Jaccard scored)`SEMANTICALLY_RELATED`\n\n(vocabulary-mismatch, same-language, score ≥ 0.80)\n\n**158 vendored tree-sitter grammars** compiled into the binary**Generic package / module resolution**— bare specifiers like`@myorg/pkg`\n\n,`github.com/foo/bar`\n\n,`use my_crate::foo`\n\nresolved via manifest scanning (`package.json`\n\n,`go.mod`\n\n,`Cargo.toml`\n\n,`pyproject.toml`\n\n,`composer.json`\n\n,`pubspec.yaml`\n\n,`pom.xml`\n\n,`build.gradle`\n\n,`mix.exs`\n\n,`*.gemspec`\n\n)**Infrastructure-as-code indexing**— Dockerfiles, Kubernetes manifests, Kustomize overlays as graph nodesfor Python, TypeScript / JavaScript / JSX / TSX, PHP, C#, Go, C, C++, Java, Kotlin, and Rust — a lightweight C implementation of language type-resolution algorithms, structurally inspired by and compatible with major language servers including tsserver / typescript-go, pyright, gopls, Roslyn, Eclipse JDT, and rust-analyzer (parameter binding, return-type inference, generic substitution, JSX component dispatch, JSDoc inference for plain JS files, namespace + trait + late-static-binding resolution for PHP, file-scoped namespaces + records + LINQ method syntax for C#, class-hierarchy + overload + lambda resolution for Java, extension-function + scope-function resolution for Kotlin, trait-method + UFCS resolution for Rust)[Hybrid LSP semantic type resolution](#hybrid-lsp)**RAM-first pipeline**: LZ4 compression, in-memory SQLite, single dump at end. Memory released after.\n\n**Single static binary, zero infrastructure**: SQLite-backed, persists to`~/.cache/codebase-memory-mcp/`\n\n**Auto-sync**: Background watcher detects file changes and re-indexes automatically** Route nodes**: REST endpoints are first-class graph entities** CLI mode**:`codebase-memory-mcp cli search_graph '{\"name_pattern\": \".*Handler.*\"}'`\n\n**Available on**: npm, PyPI, Homebrew, Scoop, Winget, Chocolatey, AUR,`go install`\n\nCommit a single compressed file to your repo and your teammates skip the reindex.\n\n`.codebase-memory/graph.db.zst`\n\nis a zstd-compressed snapshot of the knowledge graph that lives next to your source. When you index, the artifact is written or refreshed; when a teammate clones the repo and runs `codebase-memory-mcp`\n\nfor the first time, the artifact is decompressed and incremental indexing fills in their local diff.\n\n**Format**: SQLite database, indexes stripped,`VACUUM INTO`\n\ncompacted, then zstd 1.5.7 compressed (8–13:1 ratio typical)**Two tiers**:** Best**(`zstd -9`\n\n+ index strip +`VACUUM INTO`\n\n) — written on explicit`index_repository`\n\n**Fast**(`zstd -3`\n\n) — written by the watcher for low-latency incremental updates\n\n**Bootstrap**: when no local DB exists but the artifact is present,`index_repository`\n\nimports the artifact first, then runs incremental indexing — avoiding the full reindex cost**No merge pain**: a`.gitattributes`\n\nline with`merge=ours`\n\nis auto-created on first export, so concurrent edits don't produce conflicts on the binary artifact**Optional**: never committed unless you want it. Add`.codebase-memory/`\n\nto`.gitignore`\n\nif you prefer everyone to reindex from scratch.\n\nThe result is similar in spirit to graphify's `graphify-out/`\n\ndirectory, but as a single compressed file with explicit two-tier export, integrity-checked import, and zero merge friction.\n\ncodebase-memory-mcp is a **structural analysis backend** — it builds and queries the knowledge graph. It does **not** include an LLM. Instead, it relies on your MCP client (Claude Code, or any MCP-compatible agent) to be the intelligence layer.\n\n```\nYou: \"what calls ProcessOrder?\"\n\nAgent calls: trace_path(function_name=\"ProcessOrder\", direction=\"inbound\")\n\ncodebase-memory-mcp: executes graph query, returns structured results\n\nAgent: presents the call chain in plain English\n```\n\n**Why no built-in LLM?** Other code graph tools embed an LLM for natural language → graph query translation. This means extra API keys, extra cost, and another model to configure. With MCP, the agent you're already talking to *is* the query translator.\n\nBenchmarked on Apple M3 Pro:\n\n| Operation | Time | Notes |\n|---|---|---|\nLinux kernel full index |\n3 min |\n28M LOC, 75K files → 4.81M nodes, 7.72M edges |\n| Linux kernel fast index | 1m 12s | 1.88M nodes |\n| Django full index | ~6s | 49K nodes, 196K edges |\n| Cypher query | <1ms | Relationship traversal |\n| Name search (regex) | <10ms | SQL LIKE pre-filtering |\n| Dead code detection | ~150ms | Full graph scan with degree filtering |\n| Trace call path (depth=5) | <10ms | BFS traversal |\n\n**RAM-first pipeline**: All indexing runs in memory (LZ4 HC compressed read, in-memory SQLite, single dump at end). Memory is released back to the OS after indexing completes.\n\n**Token efficiency**: Five structural queries consumed ~3,400 tokens via codebase-memory-mcp versus ~412,000 tokens via file-by-file grep exploration — a **99.2% reduction**.\n\n| Platform | Standard | With Graph UI |\n|---|---|---|\n| macOS (Apple Silicon) | `codebase-memory-mcp-darwin-arm64.tar.gz` |\n`codebase-memory-mcp-ui-darwin-arm64.tar.gz` |\n| macOS (Intel) | `codebase-memory-mcp-darwin-amd64.tar.gz` |\n`codebase-memory-mcp-ui-darwin-amd64.tar.gz` |\n| Linux (x86_64) | `codebase-memory-mcp-linux-amd64.tar.gz` |\n`codebase-memory-mcp-ui-linux-amd64.tar.gz` |\n| Linux (ARM64) | `codebase-memory-mcp-linux-arm64.tar.gz` |\n`codebase-memory-mcp-ui-linux-arm64.tar.gz` |\n| Windows (x86_64) | `codebase-memory-mcp-windows-amd64.zip` |\n`codebase-memory-mcp-ui-windows-amd64.zip` |\n\nEvery release includes `checksums.txt`\n\nwith SHA-256 hashes. All binaries are statically linked — no shared library dependencies.\n\nWindows note: SmartScreen may show a warning for unsigned software. Click\"More info\"→\"Run anyway\". Verify integrity with`checksums.txt`\n\n.\n\n## Automated download + install\n\n**macOS / Linux:**\n\n```\ncurl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/scripts/setup.sh | bash\n```\n\n**Windows (PowerShell):**\n\n```\nirm https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/scripts/setup-windows.ps1 | iex\nyay -S codebase-memory-mcp-bin\nparu -S codebase-memory-mcp-bin\n```\n\nThe `codebase-memory-mcp-bin`\n\npackage is available at: [https://aur.archlinux.org/packages/codebase-memory-mcp-bin](https://aur.archlinux.org/packages/codebase-memory-mcp-bin)\n\n```\nYou: \"Install this MCP server: https://github.com/DeusData/codebase-memory-mcp\"\n```\n\n## Prerequisites: C compiler + zlib\n\n| Requirement | Check | Install |\n|---|---|---|\nC compiler (gcc or clang) |\n`gcc --version` or `clang --version` |\nmacOS: `xcode-select --install` , Linux: `apt install build-essential` |\nC++ compiler |\n`g++ --version` or `clang++ --version` |\nSame as above |\nzlib |\n— | macOS: included, Linux: `apt install zlib1g-dev` |\nGit |\n`git --version` |\nPre-installed on most systems |\n\n```\ngit clone https://github.com/DeusData/codebase-memory-mcp.git\ncd codebase-memory-mcp\nscripts/build.sh                    # standard binary\nscripts/build.sh --with-ui          # with graph visualization\n# Binary at: build/c/codebase-memory-mcp\n```\n\n## If you prefer not to use the install command\n\nAdd to `~/.claude/.mcp.json`\n\n(global) or project `.mcp.json`\n\n:\n\n```\n{\n  \"mcpServers\": {\n    \"codebase-memory-mcp\": {\n      \"command\": \"/path/to/codebase-memory-mcp\",\n      \"args\": []\n    }\n  }\n}\n```\n\nRestart your agent. Verify with `/mcp`\n\n— you should see `codebase-memory-mcp`\n\nwith 14 tools.\n\n`install`\n\nauto-detects and configures all installed agents:\n\n| Agent | MCP Config | Instructions | Hooks |\n|---|---|---|---|\n| Claude Code | `.claude/.mcp.json` |\n4 Skills | PreToolUse (Grep/Glob graph augment, non-blocking) |\n| Codex CLI | `.codex/config.toml` |\n`.codex/AGENTS.md` |\nSessionStart reminder |\n| Gemini CLI | `.gemini/settings.json` |\n`.gemini/GEMINI.md` |\nBeforeTool (grep reminder) + SessionStart reminder |\n| Zed | `settings.json` (JSONC) |\n— | — |\n| OpenCode | `opencode.json` |\n`AGENTS.md` |\n— |\n| Antigravity | `.gemini/config/mcp_config.json` (shared) |\n`antigravity-cli/AGENTS.md` |\nSessionStart reminder |\n| Aider | — | `CONVENTIONS.md` |\n— |\n| KiloCode | `mcp_settings.json` |\n`~/.kilocode/rules/` |\n— |\n| VS Code | `Code/User/mcp.json` |\n— | — |\n| OpenClaw | `openclaw.json` |\n— | — |\n| Kiro | `.kiro/settings/mcp.json` |\n— | — |\n\n**Hooks are structurally non-blocking** (exit code 0, every failure path).\nFor Claude Code, the `PreToolUse`\n\nhook intercepts `Grep`\n\n/`Glob`\n\n(never `Read`\n\n—\ngating `Read`\n\nbreaks the read-before-edit invariant) and, when the search\ntoken matches indexed symbols, injects them as `additionalContext`\n\nvia\n`search_graph`\n\nso the agent gets structured context alongside its normal\nsearch results. For Codex, Gemini CLI, and Antigravity, a `SessionStart`\n\nhook\ninjects a one-line code-discovery reminder as session context (Gemini CLI also\nkeeps its `BeforeTool`\n\nreminder).\nThe installed Claude shim file is named `cbm-code-discovery-gate`\n\nfor\nbackward compatibility with existing installs; despite the legacy name it\nnever gates and never blocks.\n\nEvery MCP tool can be invoked from the command line:\n\n```\ncodebase-memory-mcp cli index_repository '{\"repo_path\": \"/path/to/repo\"}'\ncodebase-memory-mcp cli search_graph '{\"name_pattern\": \".*Handler.*\", \"label\": \"Function\"}'\ncodebase-memory-mcp cli trace_path '{\"function_name\": \"Search\", \"direction\": \"both\"}'\ncodebase-memory-mcp cli query_graph '{\"query\": \"MATCH (f:Function) RETURN f.name LIMIT 5\"}'\ncodebase-memory-mcp cli list_projects\ncodebase-memory-mcp cli --raw search_graph '{\"label\": \"Function\"}' | jq '.results[].name'\n```\n\n| Tool | Description |\n|---|---|\n`index_repository` |\nIndex a repository into the graph. Auto-sync keeps it fresh after that. |\n`list_projects` |\nList all indexed projects with node/edge counts. |\n`delete_project` |\nRemove a project and all its graph data. |\n`index_status` |\nCheck indexing status of a project. |\n\n| Tool | Description |\n|---|---|\n`search_graph` |\nStructured search by label, name pattern, file pattern, degree filters. Pagination via limit/offset. |\n`trace_path` |\nBFS traversal — who calls a function and what it calls (alias: `trace_call_path` ). Depth 1-5. |\n`detect_changes` |\nMap git diff to affected symbols + blast radius with risk classification. |\n`query_graph` |\nExecute Cypher-like graph queries (read-only). |\n`get_graph_schema` |\nNode/edge counts, relationship patterns, property definitions per label. Run this first. |\n`get_code_snippet` |\nRead source code for a function by qualified name. |\n`get_architecture` |\nCodebase overview: languages, packages, routes, hotspots, clusters, ADR. |\n`search_code` |\nGrep-like text search within indexed project files. |\n`manage_adr` |\nCRUD for Architecture Decision Records. |\n`ingest_traces` |\nIngest runtime traces to validate HTTP_CALLS edges. |\n\n`Project`\n\n, `Package`\n\n, `Folder`\n\n, `File`\n\n, `Module`\n\n, `Class`\n\n, `Function`\n\n, `Method`\n\n, `Interface`\n\n, `Enum`\n\n, `Type`\n\n, `Route`\n\n, `Resource`\n\n`CONTAINS_PACKAGE`\n\n, `CONTAINS_FOLDER`\n\n, `CONTAINS_FILE`\n\n, `DEFINES`\n\n, `DEFINES_METHOD`\n\n, `IMPORTS`\n\n, `CALLS`\n\n, `HTTP_CALLS`\n\n, `ASYNC_CALLS`\n\n, `IMPLEMENTS`\n\n, `HANDLES`\n\n, `USAGE`\n\n, `CONFIGURES`\n\n, `WRITES`\n\n, `MEMBER_OF`\n\n, `TESTS`\n\n, `USES_TYPE`\n\n, `FILE_CHANGES_WITH`\n\n`get_code_snippet`\n\nuses qualified names: `<project>.<path_parts>.<name>`\n\n. Use `search_graph`\n\nto discover them first.\n\n`query_graph`\n\nis a read-only openCypher subset:\n\n**Clauses**:`MATCH`\n\n,`OPTIONAL MATCH`\n\n, multiple`MATCH`\n\n,`WHERE`\n\n,`WITH`\n\n(+`WITH … WHERE`\n\n),`RETURN`\n\n,`ORDER BY`\n\n,`SKIP`\n\n,`LIMIT`\n\n,`DISTINCT`\n\n,`UNWIND`\n\n,`UNION`\n\n/`UNION ALL`\n\n,`CASE`\n\n.**Patterns**: labelled nodes, label alternation`(n:A|B)`\n\n, relationship types/direction, variable-length paths`[*1..3]`\n\n, inline property maps.**WHERE**:`= <> < <= > >=`\n\n,`AND/OR/XOR/NOT`\n\n,`IN`\n\n,`CONTAINS`\n\n,`STARTS WITH`\n\n,`ENDS WITH`\n\n,`IS [NOT] NULL`\n\n, regex`=~`\n\n, label test`n:Label`\n\n, and`EXISTS { (n)-[:TYPE]->() }`\n\n(single-hop existence — great for dead-code, e.g.`WHERE NOT EXISTS { (f)<-[:CALLS]-() }`\n\n).**Aggregates**:`count`\n\n(+`DISTINCT`\n\n),`sum`\n\n,`avg`\n\n,`min`\n\n,`max`\n\n,`collect`\n\n.**Functions**:`labels`\n\n,`type`\n\n,`id`\n\n,`keys`\n\n,`properties`\n\n;`toLower/toUpper/toString/toInteger/toFloat/toBoolean`\n\n;`size`\n\n,`length`\n\n,`trim/ltrim/rtrim`\n\n,`reverse`\n\n;`coalesce`\n\n,`substring`\n\n,`replace`\n\n,`left`\n\n,`right`\n\n.\n\nAnything outside this subset (write/`MERGE`\n\n/`CALL`\n\nclauses, unsupported functions, list/map literals, comprehensions, path functions, parameters) **fails with a clear unsupported … error** rather than returning empty results.\n\nLayered: hardcoded patterns (`.git`\n\n, `node_modules`\n\n, etc.) → `.gitignore`\n\nhierarchy → `.cbmignore`\n\n(project-specific, gitignore syntax). Symlinks are always skipped.\n\n```\ncodebase-memory-mcp config list                          # show all settings\ncodebase-memory-mcp config set auto_index true           # auto-index on session start\ncodebase-memory-mcp config set auto_index_limit 50000    # max files for auto-index\ncodebase-memory-mcp config reset auto_index              # reset to default\n```\n\n| Variable | Default | Description |\n|---|---|---|\n`CBM_CACHE_DIR` |\n`~/.cache/codebase-memory-mcp` |\nOverride the database storage directory. All project indexes and config are stored here. |\n`CBM_DIAGNOSTICS` |\n`false` |\nSet to `1` or `true` to enable periodic diagnostics output to `/tmp/cbm-diagnostics-<pid>.json` . |\n`CBM_DOWNLOAD_URL` |\n(GitHub releases) |\nOverride the download URL for updates. Used for testing or self-hosted deployments. |\n`CBM_LOG_LEVEL` |\n`info` |\nSet the minimum log level. Accepted values (case-insensitive): `debug` , `info` , `warn` , `error` , `none` — or their numeric equivalents `0` –`4` matching the internal enum. Logs go to stderr; stdout is reserved for MCP JSON-RPC. |\n`CBM_WORKERS` |\n(detected) |\nOverride the parallel-indexing worker count returned by `cbm_default_worker_count` . Useful inside containers where `sysconf(_SC_NPROCESSORS_ONLN)` reports host CPUs rather than the cgroup's effective quota. Range 1–256; invalid values are ignored with a warning. |\n\n```\n# Store indexes in a custom directory\nexport CBM_CACHE_DIR=~/my-projects/cbm-data\n```\n\nMap additional file extensions to supported languages via JSON config files. Useful for framework-specific extensions like `.blade.php`\n\n(Laravel) or `.mjs`\n\n(ES modules).\n\n**Per-project** (in your repo root):\n\n```\n// .codebase-memory.json\n{\"extra_extensions\": {\".blade.php\": \"php\", \".mjs\": \"javascript\"}}\n```\n\n**Global** (applies to all projects):\n\n```\n// ~/.config/codebase-memory-mcp/config.json  (or $XDG_CONFIG_HOME/...)\n{\"extra_extensions\": {\".twig\": \"html\", \".phtml\": \"php\"}}\n```\n\nProject config overrides global for conflicting extensions. Unknown language values are silently skipped. Missing config files are ignored.\n\nSQLite databases stored at `~/.cache/codebase-memory-mcp/`\n\n. Persists across restarts (WAL mode, ACID-safe). To reset: `rm -rf ~/.cache/codebase-memory-mcp/`\n\n.\n\n| Problem | Fix |\n|---|---|\n`/mcp` doesn't show the server |\nCheck `.mcp.json` path is absolute. Restart agent. Test: `echo '{}' | /path/to/binary` should output JSON. |\n`index_repository` fails |\nPass absolute path: `index_repository(repo_path=\"/absolute/path\")` |\n`trace_path` returns 0 results |\nUse `search_graph(name_pattern=\".*PartialName.*\")` first to find the exact name. |\n| Queries return wrong project results | Add `project=\"name\"` parameter. Use `list_projects` to see names. |\n| Binary not found after install | Add to PATH: `export PATH=\"$HOME/.local/bin:$PATH\"` |\n| UI not loading | Ensure you downloaded the `ui` variant and ran `--ui=true` . Check `http://localhost:9749` . |\n\n**Semantic type resolution beyond tree-sitter.**\n\nTree-sitter alone gives a syntactic AST. That handles naming, structure, and call sites well, but it can't tell you that `user.profile.display_name()`\n\nresolves to `Profile.display_name`\n\ndeclared three modules away — tree-sitter doesn't track imports, generics, inheritance, or stdlib types.\n\ncodebase-memory-mcp ships a **lightweight C implementation of language type-resolution algorithms, structurally inspired by and compatible with major language servers** (tsserver / typescript-go, pyright, gopls, Roslyn, Eclipse JDT, rust-analyzer), embedded directly into the static binary. No language server process, no per-project setup, no API key. We call this layer **Hybrid LSP**: it runs alongside tree-sitter on every parse and refines `CALLS`\n\n, `USAGE`\n\n, and `RESOLVED_CALLS`\n\nedges with type information, so the resulting graph mirrors what an IDE \"Go to Definition\" would resolve.\n\n**Languages with full Hybrid LSP:**\n\n| Language | What it handles |\n|---|---|\nPython (new in v0.7.0) |\nimports + dotted submodule walks, dataclasses, `Self` return types, generics, `@property` , `match/case` class patterns, SQLAlchemy 2.0 `Mapped[T]` , Pydantic `BaseModel` , `typing.Annotated` / `ClassVar` / `Final` / `InitVar` , async/await, classmethod/staticmethod, narrowing (`isinstance` / `is not None` / walrus), `typing.cast` / `assert_type` , common stdlib (logging, pathlib, json, functools). Target ~95% resolution on idiomatic code. |\nTypeScript / JavaScript / JSX / TSX |\ngenerics, JSX component dispatch, JSDoc inference for plain JS, `.d.ts` declarations, module re-exports, method chaining via return-type propagation, per-file overlay chained to a shared cross-file registry |\nPHP (new in v0.7.0) |\nnamespaces, traits, late-static-binding, PHPDoc inference, parameter binding, return-type inference |\nC# (new in v0.7.0) |\nglobal usings, file-scoped namespaces, records (incl. C# 12 primary constructors), LINQ method syntax, `async Task<T>` / `ValueTask<T>` unwrap, generic methods, `this` / `base` dispatch, `var` inference, common BCL stdlib |\nGo (sharpened in v0.7.0) |\npre-built per-package cross-file registry, generics, embedded structs, interface satisfaction, package-aware import resolution |\nC / C++ (sharpened in v0.7.0) |\npre-built per-language cross-file registry shared across C and C++; C side handles macros + `typedef` chains + header-vs-source linking; C++ side handles templates, namespaces, `auto` inference, and method resolution via class hierarchy |\nJava (new in v0.8.0) |\nimports (single-type, on-demand, static), class hierarchies with `this` / `super` dispatch, generics, annotations, overload matching by arity and parameter types, lambdas / method references bound to functional interfaces, field-type inference, common JDK stdlib |\nKotlin (new in v0.8.0) |\nimports + same-package resolution, classes / objects / companion objects, extension functions, data classes, nullable-type unwrapping, scope functions (`let` / `apply` / `run` / `also` / `with` ), infix calls, common stdlib |\nRust (new in v0.8.0) |\n`use` declarations + module paths, `impl` blocks and trait methods, struct fields, generics with trait bounds, operator-trait desugaring, derive-macro method synthesis, UFCS static paths, common std prelude |\n\n**Two-layer architecture:**\n\n**Tree-sitter pass**— fast, syntactic, runs for every one of the 158 languages. Extracts definitions, calls, imports.** Hybrid LSP pass**— type-aware, runs above the tree-sitter pass per-language. Refines call edges using the import graph plus a per-file or pre-built cross-file definition registry. Languages without a Hybrid LSP pass yet fall back to textual resolution, so you always get*some*answer.\n\nThe result is a knowledge graph accurate enough to drive `trace_path`\n\nacross packages, inheritance hierarchies, and stdlib calls — without paying for a language server process per project.\n\n158 languages, all parsed via vendored tree-sitter grammars compiled into the binary. Benchmarked against 64 real open-source repositories (78 to 49K nodes):\n\n| Tier | Score | Languages |\n|---|---|---|\nExcellent (>= 90%) |\nLua, Kotlin, C++, Perl, Objective-C, Groovy, C, Bash, Zig, Swift, CSS, YAML, TOML, HTML, SCSS, HCL, Dockerfile | |\nGood (75-89%) |\nPython, TypeScript, TSX, Go, Rust, Java, R, Dart, JavaScript, Erlang, Elixir, Scala, Ruby, PHP, C#, SQL | |\nFunctional (< 75%) |\nOCaml, Haskell |\n\nAlso supported (not yet benchmarked): Ada, Agda, Apex, Assembly (NASM), Astro, AWK, Beancount, BibTeX, Bicep, Bitbake, Blade, Cairo, Cap'n Proto, Clojure, CMake, COBOL, Common Lisp, Crystal, CSV, CUDA, D, Devicetree, Diff, .env, Elm, Emacs Lisp, F#, Fennel, Fish, FORM, Fortran, FunC, GDScript, .gitattributes, .gitignore, Gleam, GLSL, GN, Go module, Go template, GraphQL, Hare, HLSL, Hyprlang, INI, ISPC, Janet, Jinja2, JSDoc, JSON, JSON5, Jsonnet, Julia, Just, Kconfig, KDL, Lean 4, Linker Script, Liquid, LLVM IR, Luau, Magma, Makefile, Markdown, MATLAB, Mermaid, Meson, Move, Nickel, Nim, Nix, Odin, Pascal, Pkl, PO (gettext), Pony, PowerShell, Prisma, .properties, Protobuf, Puppet, PureScript, Racket, Regex, requirements.txt, ReScript, RON, reStructuredText, Scheme, Slang, Smali, Smithy, Solidity, SOQL, SOSL, Squirrel, SSH config, Starlark, Svelte, Sway, SystemVerilog, TableGen, Tcl, Teal, Templ, Thrift, TLA+, Typst, Verilog, VHDL, Vim script, Vue, WGSL, WIT, Wolfram, XML, Zsh.\n\n```\nsrc/\n  main.c              Entry point (MCP stdio server + CLI + install/update/config)\n  mcp/                MCP server (14 tools, JSON-RPC 2.0, session detection, auto-index)\n  cli/                Install/uninstall/update/config (10 agents, hooks, instructions)\n  store/              SQLite graph storage (nodes, edges, traversal, search, Louvain)\n  pipeline/           Multi-pass indexing (structure → definitions → calls → HTTP links → config → tests)\n  cypher/             Cypher query lexer, parser, planner, executor\n  discover/           File discovery (.gitignore, .cbmignore, symlink handling)\n  watcher/            Background auto-sync (git polling, adaptive intervals)\n  traces/             Runtime trace ingestion\n  ui/                 Embedded HTTP server + 3D graph visualization\n  foundation/         Platform abstractions (threads, filesystem, logging, memory)\ninternal/cbm/         Vendored tree-sitter grammars (158 languages) + AST extraction engine\n```\n\nEvery release binary is verified through a multi-layer pipeline before publication:\n\n**VirusTotal**— all binaries scanned by 70+ antivirus engines (zero detections required to publish)** SLSA Level 3**— cryptographic build provenance generated by GitHub Actions; verify with`gh attestation verify <file> --repo DeusData/codebase-memory-mcp`\n\n**Sigstore cosign**— keyless signatures on all artifacts; bundles included in every release** SHA-256 checksums**—`checksums.txt`\n\npublished with every release; verified by both install scripts before extraction**CodeQL SAST**— blocks release pipeline if any open alerts remain** Zero runtime dependencies**— no transitive supply chain; all libraries vendored at compile time\n\n| Binary | SHA-256 | VirusTotal |\n|---|---|---|\n`linux-amd64` |\n`8e12bb2d6ead7f20a6d3...` |\n|\n\n`linux-arm64`\n\n`10f7136bfbf3950c6b2a...`\n\n[0/72 ✅](https://www.virustotal.com/gui/file/10f7136bfbf3950c6b2a1a950bbf85e88b97ee55ab00b4dfbc2a5e9c2ede8672/detection)`darwin-arm64`\n\n`7062a7408906344bf4f8...`\n\n[0/72 ✅](https://www.virustotal.com/gui/file/7062a7408906344bf4f835e9580048af85d12dd2b7cec0edf869df93ad9a0592/detection)`darwin-amd64`\n\n`28c6d640e1a0ac7bfcab...`\n\n[0/72 ✅](https://www.virustotal.com/gui/file/28c6d640e1a0ac7bfcab5094c2186eced5264a20dcdffcb4455a1b28c5df2171/detection)`windows-amd64`\n\n`9c3ddcf78368fd4fa891...`\n\n[0/72 ✅](https://www.virustotal.com/gui/file/9c3ddcf78368fd4fa89156a553641bf1e03640b4fb6dd29a12c84aa5bc98cd86/detection)Scan links for every release are also included in the GitHub Release notes automatically.\n\nMIT", "url": "https://wpnews.pro/news/code-intelligence-mcp-server", "canonical_source": "https://github.com/DeusData/codebase-memory-mcp", "published_at": "2026-06-18 01:51:41+00:00", "updated_at": "2026-06-18 02:22:40.207752+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "large-language-models", "machine-learning"], "entities": ["DeusData", "tree-sitter", "Linux", "MCP", "Claude Code", "Codex CLI", "Gemini CLI", "Zed"], "alternates": {"html": "https://wpnews.pro/news/code-intelligence-mcp-server", "markdown": "https://wpnews.pro/news/code-intelligence-mcp-server.md", "text": "https://wpnews.pro/news/code-intelligence-mcp-server.txt", "jsonld": "https://wpnews.pro/news/code-intelligence-mcp-server.jsonld"}}