Codebase Memory MCP Server

Persistent codebase knowledge graph. Survives session restarts and context compaction.

Local serverstdioPython

What is the Codebase Memory MCP server?

Connect Codebase Memory to Claude, Cursor or any other MCP client and it stops being a tab you switch to. Persistent codebase knowledge graph. Survives session restarts and context compaction. The codebase memory mcp server is what makes that connection.

What the server does

Built-in 3D graph visualization (UI variant) — explore your knowledge graph at localhost:9749

  • 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 → 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
  • Built-in graph visualization — — 3D interactive UI at localhost:9749 (optional UI binary variant)
  • Infrastructure-as-code indexing — — Dockerfiles, Kubernetes manifests, and Kustomize overlays indexed as graph nodes with cross-references. Resource nodes for K8s kinds, Module nodes for Kustomize overlays with IMPORTS edges to referenced resources

Installation

Installation goes through your MCP client rather than a global install: point it at codebase-memory-mcp on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • Built — in graph visualization** — 3D interactive UI at localhost:9749 (optional UI binary variant)
  • Infrastructure-as — code indexing** — Dockerfiles, Kubernetes manifests, and Kustomize overlays indexed as graph nodes with cross-references. Resource nodes for K8s
  • codebase-memory-mcp — -.tar.gz (macOS/Linux) or .zip (Windows) — standard
  • codebase-memory-mcp-ui — -.tar.gz / .zip — with graph visualization
  • install.sh — ** add --ui (see Quick Start)
  • PyPI — ** CBM_VARIANT=ui pip install codebase-memory-mcp
  • Manual — ** download the codebase-memory-mcp-ui-- archive
  • Cypher — like queries**: MATCH (f:Function)-[:CALLS]->(g) WHERE f.name = 'main' RETURN g.name
  • Multi — galaxy 3D UI layout** for cross-repo architecture visualization
  • Cross — repo architecture summary** combining services, routes, and dependencies across the indexed fleet
  • RAM — first pipeline**: LZ4 compression, in-memory SQLite, single dump at end. Memory released after
  • Auto-sync — Background watcher detects file changes and re-indexes automatically

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Codebase Memory.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Where it fits

This sits in the knowledge and memory group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Codebase Memory's toolset — Built, Infrastructure-as, codebase-memory-mcp and 11 more — is a fair guide to whether it matches your workflow. It is maintained by DeusData; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Codebase Memory's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Available tools

ToolWhat it does
Builtin graph visualization** — 3D interactive UI at localhost:9749 (optional UI binary variant).
Infrastructure-ascode indexing** — Dockerfiles, Kubernetes manifests, and Kustomize overlays indexed as graph nodes with cross-references. Resource nodes for K8s kinds, Module nodes for Kustomize overlays with IMPORTS edges to referenced
codebase-memory-mcp<os>-<arch>.tar.gz (macOS/Linux) or .zip (Windows) — standard
codebase-memory-mcp-ui<os>-<arch>.tar.gz / .zip — with graph visualization
install.sh** add --ui (see [Quick Start](#quick-start))
PyPI** CBM_VARIANT=ui pip install codebase-memory-mcp
Manual** download the codebase-memory-mcp-ui-<os>-<arch> archive
Cypherlike queries**: MATCH (f:Function)-[:CALLS]->(g) WHERE f.name = 'main' RETURN g.name
Multigalaxy 3D UI layout** for cross-repo architecture visualization
Crossrepo architecture summary** combining services, routes, and dependencies across the indexed fleet
RAMfirst pipeline**: LZ4 compression, in-memory SQLite, single dump at end. Memory released after.
Auto-syncBackground watcher detects file changes and re-indexes automatically
FormatSQLite database, indexes stripped, VACUUM INTO compacted, then zstd 1.5.7 compressed (8–13:1 ratio typical)
Bootstrapwhen no local DB exists but the artifact is present, index_repository imports the artifact first, then runs incremental indexing — avoiding the full reindex cost

How to install the Codebase Memory MCP server

{
  "mcpServers": {
    "codebase-memory": {
      "command": "npx",
      "args": ["-y", "codebase-memory-mcp"]
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Example prompts to try

  • Use Codebase Memory to Built.
  • Use Codebase Memory to Infrastructure-as.
  • Use Codebase Memory to codebase-memory-mcp.

Frequently asked questions

It connects Codebase Memory to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (Built, Infrastructure-as, codebase-memory-mcp, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Codebase Memory directly.