Skip to content
MCP server

Codebase Memory

Local MCP server that builds a code knowledge graph for AI coding agents

Runs locallyActively maintainedStatus and history

The repository was last updated 2 days ago and is published under MIT.

Pricing
Open source
Platforms
CLI, macOS, Linux
Runs
Locally
GitHub stars
48.7K
Last commit
2 days ago
Language
C

About Codebase Memory

Codebase Memory is an open-source MCP server for knowledge and memory. It runs locally on your machine and is started by your AI client.

Codebase Memory builds a persistent knowledge graph of a repository's code, documentation and infrastructure and serves it through 17 MCP tools. Agents can search symbols, follow call paths and retrieve source evidence instead of rereading files.

It parses code with tree-sitter and supports docs, Docker, Kubernetes, Terraform and CI configuration. The same graph can be queried from a native CLI, and an optional visual companion called Lens is in beta.

It is written in C, runs locally on macOS, Linux and Windows, and suits developers working with AI coding agents on large repositories.

Install

Run in a terminal

claude mcp add codebase-memory-mcp -- npx -y codebase-memory-mcp

Add to claude_desktop_config.json

{
  "mcpServers": {
    "codebase-memory-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "codebase-memory-mcp"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "codebase-memory-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "codebase-memory-mcp"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "codebase-memory-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "codebase-memory-mcp"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

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

Add to your client's MCP settings (most use this shape)

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

What it does

Code knowledge graph
Persistent graph of symbols, calls and dependencies.
Multiple search modes
Structural, full-text and local semantic search.
Documentation links
Indexes Markdown, reStructuredText, AsciiDoc and ADRs.
Infrastructure tracing
Connects Docker, Kubernetes, Terraform and CI to source.
Change impact
Maps a diff to affected symbols and related tests.
Native CLI
Query the same graph from the command line.

Good for

  • Find callers of a function
  • Assess the impact of a diff
  • Link documentation to code
  • Trace a service to its deployment
  • Explore several repositories together

Pricing

Open source

Prices change. Check deusdata.github.io before you buy.

Codebase Memory FAQ

How many tools does it expose?

Seventeen MCP tools.

Which platforms are supported?

macOS, Linux and Windows.

What license is it under?

MIT.

Does it read PDFs?

Only PDFs with a text layer; there is no OCR.

Is Codebase Memory free?

Yes. Codebase Memory is open source, so you can use and self-host it for free.

How do I add Codebase Memory to Claude Code?

Run this command in your terminal: claude mcp add codebase-memory-mcp -- npx -y codebase-memory-mcp

What are the best alternatives to Codebase Memory?

The closest alternatives to Codebase Memory are REA, GitHub, Serena MCP: the IDE for your agent, XERJ and Ouroboros.

Alternatives to Codebase Memory

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    Not checked yet
    • Remote
    • Open source
    • 34.5K GitHub stars
    • Developer tools
  3. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.5K GitHub stars
    • Developer tools
  4. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  5. Ouroboros

    MCP server

    Spec-first layer that pins requirements and verifies results of AI coding agent work

    Runs locally
    • Open source
    • 6.4K GitHub stars
    • Developer tools
  6. MCP server for searching the Claude Code Ultimate Guide from any MCP client

    Runs locally
    • Open source
    • 6.5K GitHub stars
    • AI models and LLM tooling