# Codebase Memory

> Codebase Memory is an open-source MCP server for knowledge and memory. Local MCP server that builds a code knowledge graph for AI coding agents. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Linux, Windows, self-hosted
- **Website:** https://deusdata.github.io/codebase-memory-mcp/
- **Repository:** https://github.com/deusdata/codebase-memory-mcp
- **GitHub stars:** 48,740
- **License:** MIT
- **MCP Registry name:** io.github.DeusData/codebase-memory-mcp
- **Categories:** knowledge and memory, developer tools
- **Listing updated:** 2026-11-14

## About

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.

## Features

- **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

## Install

### Claude Code (Terminal)

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

### Claude Desktop (claude_desktop_config.json)

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

### Cursor (~/.cursor/mcp.json)

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

### VS Code (.vscode/mcp.json)

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

### Windsurf (~/.codeium/windsurf/mcp_config.json)

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

### Other clients (your client's MCP settings (most use this shape))

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

## 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

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Nautilus Compass Memory](https://ai-powered.com/mcp/nautilus-compass-memory): Nautilus Compass Memory is an open-source MCP server for knowledge and memory.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/codebase-memory
