Local MCP server · Open source

Understand the
whole repository.

Codebase Memory (CBM) is an open-source server for the Model Context Protocol (MCP). Give your AI coding agent a persistent knowledge graph of code, documentation and infrastructure. Search symbols, trace relationships and retrieve source evidence through 17 MCP tools.

Focused graph queries help reduce repeated code reading and token use. See the evidence →

macOS · Linux · Windows  /  Native C · MIT licensed

For your agent

17 MCP tools, source evidence and coverage checks, with client-specific skills, profiles and hooks.

For your workflow

Native CLI access, persistent indexes and optional visual exploration in Lens.

CBM LENS · OPEN BETA v0.0.1codebase-memory-mcp / architectureLOCAL WORKSPACE
CBM Lens architecture walkthrough: open src/foundation, select arena.c and read its source beside the map
See the MCP server’s graph through CBM Lens, its optional visual companion. Open beta v0.0.1, captured in October 2026. Capture details ↗
One connected graphSource, docs and infrastructure
17 MCP toolsPlus native CLI access
45 client surfacesAutomatic or conditional setup
Local processingYour index stays on your machine

Beyond file search

Find the relationship.
Then read the evidence.

A function rarely tells the whole story. Follow its callers, find the decision behind it, and trace the infrastructure that runs it.

01 / CODE

What calls this?

Explore symbols, call paths, types, dependencies and routes. Move across files, services and indexed repositories.

  • Structural, full-text and local semantic search
  • Hybrid LSP type resolution for supported languages
  • HTTP, gRPC, GraphQL, tRPC and async links
Explore code intelligence →
02 / DOCUMENTATION

Why does it work this way?

Bring documentation into the graph. Search sections, follow resolved code references, and keep architecture decisions close to their implementation.

  • Markdown, reStructuredText and AsciiDoc sections
  • Searchable pages from PDFs with text layers
  • ADRs, supersession and supported doc comments
Documentation support →
03 / INFRASTRUCTURE

What builds and deploys it?

Connect supported infrastructure and configuration to source. Trace the path from a service to the program inside its container.

  • Docker, Compose, Kubernetes, Helm and Kustomize
  • Terraform / OpenTofu, Terragrunt and Ansible
  • Shell, Make and supported CI steps
Infrastructure support →
A deployment pathServiceWorkloadImageDockerfileProgram

Relationships come from supported source forms. Dynamic values and unresolved references can leave gaps; PDF extraction requires a text layer and does not perform OCR.

Code intelligence

Ask better questions
of your repository.

Give your coding agent structural context through 17 MCP tools. Query the same graph from the CLI and open source evidence whenever a result needs verification.

Follow actual relationships

Tree-sitter parsing and Hybrid LSP resolution build call and dependency relationships for supported languages. Trace callers, callees, data flow and supported cross-service links; query more complex patterns with Cypher.

Language and framework coverage varies. Check the support matrix →

Understand change

Map a diff to affected symbols, investigate the blast radius, compare graph snapshots and inspect related tests. Near-clone and semantic relationships help surface related implementations worth reviewing.

detect_changescompare_graphsSIMILAR_TO

Connect the wider system

Link multiple repositories in the same store. Explore service relationships across HTTP, gRPC, GraphQL, tRPC and supported async patterns, or ingest runtime traces to add observed relationships.

Cross-repo intelligenceingest_tracesget_architecture

Know what the index knows

Inspect index status and recorded coverage before making a claim. Coverage diagnostics identify skipped, partial or stale evidence so you can read the relevant source directly. Preserve architecture decisions with ADR management.

check_index_coverageindex_statusmanage_adr
Explore all 17 MCP tools
index_repositorysearch_graphquery_graphtrace_pathget_code_snippetget_file_outlineget_graph_schemacompare_graphsget_architecturesearch_codelist_projectsdelete_projectindex_statuscheck_index_coveragedetect_changesmanage_adringest_traces

Tool reference, inputs and examples →

Smart CI Experimental

Turn change impact
into test selection.

Combine static reachability, changed tests and admitted per-test coverage to explain which tests a change reaches. Use the result to focus supported CI runs.

Job selection uses repository-specific path rules. Test narrowing currently supports C/C++ with supported TEST/SUITE-style harnesses or declared equivalents.

Start in shadow mode and validate your harness before enabling gating. This repository narrows its Linux x86_64 PR unit-test leg; release and dry-run workflows retain full execution.

Read the Smart CI setup guide →
FROM CHANGE TO EXPLAINED SELECTION
01
Establish a baseline

Publish the graph and compatible per-test coverage with test-impact publish.

02
Trace the change

Combine changed tests, static relationships and admitted coverage.

03
Select with reasons

test-impact select explains its selection for a runner that accepts named tests or suites.

↳
Broaden when evidence is insufficient

Missing, stale or incomplete evidence broadens the selection or returns run_all. Static reachability alone never omits a suite.

Agent setup

Context that fits
your coding workflow.

The installer configures 45 automatic/conditional client surfaces. MCP connections, instructions, skills, profiles and hooks are installed according to each client's supported capabilities.

01 / CONNECTSet up your clients

Configure supported integrations for clients such as Claude Code, Codex CLI, Gemini CLI, Cursor, Zed and OpenCode.

02 / GUIDEGive agents a working method

Skills and instructions guide graph queries, coverage checks and source verification. Supported custom-agent formats get Scout, Verify and Auditor profiles.

03 / MAINTAIN CONTEXTUse supported hooks

Client-specific lifecycle and read/search hooks help surface relevant graph context. Hook and subagent capabilities differ by client and platform.

See the supported clients and integration boundaries

Detected automatically (39): 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, Grok Build, 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, Pi, and Oh My Pi (omp).

Conditional or explicit (6): Continue / cn, Visual Studio, TRAE, Roo Code, IBM Bob IDE, and Sourcegraph Cody.

These are client surfaces, not a promise of identical MCP, hook or subagent support. For example, Pi receives instructions and a skill; Warp's detected skill installation is counted while its MCP connection remains manual. Other manual, UI, cloud and repository-managed integrations are documented separately.

Review the client matrix and setup details →

CBM Lens · Open beta v0.0.1

A visual companion
to the MCP server.

An optional way to explore the same graph your agent queries. Included in standard native releases, with source navigation, architecture maps and the Galaxy view.

Lens source reader beside the file impact summary and graph dependencies for limits.c
Source navigation with indexed relationships and impact context.

Read code in context

Browse files and symbols, inspect callers and dependencies, and keep the relevant source beside the graph.

See the shape of the system

Explore architecture, system structure and the Galaxy graph. Inspect coverage diagnostics and architecture decisions from the same workspace.

Lens is served on loopback. Browser AI downloads its optional model after you enable it. Its explanations should be checked against the displayed source.

Read the Lens guide and watch the walkthroughs →

Get started

Install. Index. Explore.

Install the MCP server and configure your coding agent. The native runtime needs no Docker or language runtime; indexing and graph queries need no API key. Standard releases also include the optional Lens open beta.

TERMINAL · macOS / Linux
# Install the native release and agent integrations
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash

# Restart your agent, then ask:
"Index this project"

# Optional: open CBM Lens (open beta)
codebase-memory-mcp daemon start --open

Your machine. Your index.

Source analysis and graph storage run locally. Native releases contain the executable and authenticated release-owned assets, including the Lens frontend and agent integration templates.

Use native packages or the npm, PyPI and Go wrappers. Package wrappers use their respective runtimes. Nix and source builds also offer builds without the UI.

Choose the clients you want to configure, restart them after installation, then build your first index.

Download the latest release

Performance and research

More useful context.
Less repeated work.

Reuse the graph to find relevant symbols, follow relationships and retrieve focused source snippets. Compact, paged results help keep repeated repository exploration out of your agent’s context window.

Our March 2026 preprint reports 10× lower token use and 2.1× fewer tool calls across 31 repositories compared with file-by-file exploration.

These measurements cover the study’s backend workloads from March 2026. See the paper for the evaluation setup and full results.

Common questions

Is Codebase Memory
right for your workflow?

When should I use Codebase Memory?

Choose CBM when your coding agent needs a persistent local graph of code, docs and infrastructure. The MCP server brings structural search, source evidence, agent integrations and experimental test selection into one open-source package. The CLI provides direct access, and CBM Lens adds an optional visual workspace in open beta. Native releases run on macOS, Linux and Windows without Docker or a language runtime. Explore the capabilities and Smart CI’s current scope.

How does Codebase Memory reduce AI token use?

Your agent can query indexed relationships and retrieve the relevant symbols or source snippets instead of repeatedly exploring whole files. Compact results and pagination control how much context each query returns. The benefit depends on the task; explore the published token-use measurements.

Does Codebase Memory send my source code anywhere?

The backend indexes source and stores and queries its graph locally. Your coding agent has its own data-handling settings. Lens can optionally download a browser model after you enable it, with inference on-device. Installers and update checks use the network to obtain releases and assets.

How does the index stay current?

Incremental indexing updates changed files. With auto-watch enabled, an eligible active MCP session can watch an already indexed project. Automatic first indexing is a separate opt-in setting. The local UI daemon is not a promise of a permanent background watcher.

How much language coverage is available?

Bundled tree-sitter grammars cover a broad range of languages and formats. Supported language families also have Hybrid LSP semantic resolution. Extraction depth, type resolution and framework relationships vary; the language support matrix describes the details.

Does Smart CI select tests for every indexed language?

No. Test narrowing currently supports C/C++ family code with supported test-harness conventions or declared equivalents. It requires configuration, admitted coverage and a compatible runner. Missing or incompatible evidence broadens execution or returns run_all. See the Smart CI guide.

How do I verify the release?

Use the signed release artifacts and checksums, and review the release's verification information. The security policy explains artifact verification, antivirus reports and vulnerability reporting.

Is it free and open source?

Yes. Codebase Memory is MIT licensed. Source, release binaries, detailed documentation and contribution guidelines are available on GitHub.

Project updates

What's shipping.

Recent releases from GitHub, with the implementation details and fixes behind each version.

Loading recent releases from GitHub…

View all releases on GitHub →