# Codebase Memory MCP server

> Provides a local knowledge graph that connects source code, documentation, and infrastructure to give AI agents structural context.

- Repository: https://github.com/DeusData/codebase-memory-mcp
- Page: https://hostedmcp.org/servers/deusdata/codebase-memory-mcp
- Transport: stdio
- Stars: 48609
- License: MIT
- Latest version: 0.12.1

## Install

### Claude Code

```sh
claude mcp add codebase-memory-mcp -- npx -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"
      ]
    }
  }
}
```

### Claude Desktop (`claude_desktop_config.json`)

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

### Codex (`~/.codex/config.toml`)

```toml
[mcp_servers.codebase-memory-mcp]
command = "npx"
args = ["-y", "codebase-memory-mcp"]
```

### Gemini CLI (`~/.gemini/settings.json`)

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

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `CBM_CACHE_DIR` | no | no |  |
| `VITE_EXPERIMENTAL_AGENTS` | no | no |  |

## Tools (17)

- `index_repository`
- `list_projects`
- `delete_project`
- `index_status`
- `check_index_coverage`
- `search_graph`
- `trace_path`
- `detect_changes`
- `query_graph`
- `get_graph_schema`
- `compare_graphs`
- `get_code_snippet`
- `get_file_outline`
- `get_architecture`
- `search_code`
- `manage_adr`
- `ingest_traces`

## FAQ

### Does this require an API key or hosted service?

No, indexing and graph queries do not require any hosted service or API key.

### Where is the data processed?

All source analysis and graph storage are performed locally on your machine.

### What kind of infrastructure relationships can it trace?

It can trace relationships through Docker, Kubernetes, Helm, Kustomize, Terraform/OpenTofu, Terragrunt, Ansible, scripts, Make, and CI configuration.
