Skip to content

Guide · Open source

How to use codebase-memory-mcp: install, run and query your code graph

Updated · written with AI from the project's own documentation and checked against our catalogue data

codebase-memory-mcp is an open-source MCP server, licensed under MIT and written in C, that reads a code repository and builds a persistent local knowledge graph of its symbols, files, documentation and infrastructure files. This guide is for developers who use an MCP-capable AI coding agent on a larger codebase. After reading it you will know how to install the tool, start the optional CBM Lens visual companion, understand what the MCP server offers, and decide whether it fits your project.

codebase-memory-mcpDeusData/codebase-memory-mcp · ★ 48k · MIT

Quick start

  1. 1Check prerequisites. On macOS or Linux, confirm curl and bash are available. On Windows, confirm PowerShell is available.
  2. 2Install the latest release. Run the README's curl and bash install command on macOS or Linux, or the PowerShell install from the project README on Windows.
  3. 3Start CBM Lens. Run codebase-memory-mcp daemon start --open --port=9749 to open the visual companion.
  4. 4Connect your agent. Let the installer write configuration for the MCP clients you select, then confirm your agent lists the codebase-memory-mcp tools.
  5. 5Ask structural questions. Query the graph for callers, dependencies or where a feature lives instead of reading many files.
  6. 6Review changes. Use affected-symbol and related-test views before running a change, and treat Smart CI results as experimental.

Check whether this tool fits your setup

codebase-memory-mcp is aimed at developers who work with an MCP-capable AI coding agent on a large codebase, engineers who want to see where a feature lives and how calls connect across files, and teams that want to estimate which code and tests a change could affect. It suits people who prefer that source analysis stays on their own machine.

  • Indexing and graph queries run on your own machine, and the README says no hosted service or API key is needed.
  • Setup assumes some terminal comfort. If you have no MCP-capable agent and no CLI experience, this tool is not a good starting point.
  • Smart CI is described as experimental and limited to supported C/C++ test harnesses.

Install codebase-memory-mcp on macOS or Linux

The README's install method uses curl and bash on macOS and Linux. Run the install command below to install the latest release.

  • Prerequisites: curl and bash (macOS / Linux).
  • The standard native release includes CBM Lens.
  • Nix packages and source builds are also available and offer builds without the UI.
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash

Install codebase-memory-mcp on Windows

On Windows the README lists PowerShell as the prerequisite. The Windows install command is not reproduced in the source excerpt this guide is based on, so check the project README for the exact PowerShell command before running anything.

  • Prerequisite: PowerShell (Windows).
  • Standard releases include CBM Lens for macOS, Linux, and Windows.

Start CBM Lens to explore the graph visually

CBM Lens is the optional visual companion and is in open beta. The MCP server is the core of the project. After installation you can start CBM Lens with the command below, which opens it in your browser on port 9749.

CBM Lens includes a source reader, architecture maps, the Galaxy 3D graph, coverage diagnostics, architecture decisions, and local code chat. Its local chat can use a model that runs on your device once you enable it.

  • Folders appear as nested platforms, and files and symbols as selectable blocks with arrows for indexed relationships.
  • Explore shows files in an IDE-style workspace with syntax-highlighted source beside file impact and symbol callers and calls.
codebase-memory-mcp daemon start --open --port=9749

Connect the MCP server to your AI coding agent

The MCP server is the core of the project. It exposes 17 MCP tools that let an agent ask structural questions, such as what calls a function or what depends on a file, instead of reading many files. The installer supports 45 automatic or conditional client integrations, including client configuration, skills, agent profiles, and applicable hooks.

Support varies by client, so check the integration matrix in the README for what your specific agent receives.

  • The installer writes agent configuration for the clients you select.
  • Indexes persist between sessions, and eligible active MCP sessions can keep them synchronized.
  • You can also query the graph directly from the CLI.

Use the graph for everyday code questions

Ask focused questions rather than broad ones. The project says targeted graph queries can reduce repeated file reads and token use, and the README links to scoped measurements in its Performance section. The tool also supports symbol, text and semantic search, callers, dependencies, source snippets and file outlines.

Documentation is indexed too: document sections, PDF text pages, architecture decisions and supported references can be connected to code, so you can find an explanation next to the symbol it describes.

  • Find where a feature lives and how calls connect across files.
  • Trace supported relationships through Docker, Kubernetes, Helm, Kustomize, Terraform/OpenTofu, Terragrunt, Ansible, scripts, Make, and CI configuration.
  • Inspect affected symbols and compare indexed snapshots before running a change.

Estimate what a change affects with Smart CI

Smart CI is experimental. It combines static relationships and per-test coverage for supported C/C++ test harnesses and falls back to broader runs when evidence is insufficient. Do not rely on it for languages beyond the supported C/C++ harnesses.

  • Treat it as an estimate and check results for your project.
  • Fallback to broader test runs is intentional when evidence is weak.

What people use it for

  • Finding where a feature lives in a large repository and following its call path across files.
  • Asking an MCP-capable coding agent what calls a function or what depends on a file.
  • Tracing a deployment from Kubernetes or Helm configuration back to the source it relates to.
  • Estimating which code and tests a change could affect before running a full test suite.
  • Browsing a repository visually in CBM Lens to read source beside its dependencies.

Frequently asked questions

Is codebase-memory-mcp free?

The project is licensed under MIT, as stated in the README. Check the LICENSE file in the repository for the full terms.

What do I need to install codebase-memory-mcp?

The README lists curl and bash for macOS and Linux, and PowerShell for Windows. No Docker or language runtime is needed for the native runtime, according to the project's description.

Does codebase-memory-mcp need an API key or a hosted service?

No. The README says indexing and graph queries need no hosted service or API key, and source analysis and graph storage run on your machine.

How do I start CBM Lens?

After installation, run codebase-memory-mcp daemon start --open --port=9749. CBM Lens is in open beta, version v0.0.1 per the README.

Which AI agents does it work with?

The installer supports 45 automatic or conditional client integrations, but support varies by client. Check the integration matrix in the README for your agent.

Is there an alternative to codebase-memory-mcp?

The project's analysis lists no comparable projects, so this guide cannot make a comparison. Evaluate it against your own needs.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use codebase-memory-mcp if you work with an MCP-capable AI coding agent on a large codebase and want source analysis to stay on your machine. Pick something else if you need a hosted or cloud-managed indexing service, have no terminal or agent setup, or need change-aware test selection beyond C/C++ test harnesses.

Install options & downloads