# Codebase Memory MCP server

Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.

## At a glance

Codebase Memory is an MCP server in the AI & Memory category. It runs locally over stdio via `npx -y codebase-memory-mcp`, and declares no required credentials. It exposes 17 tools, including index_repository, list_projects and delete_project. It scores A (99/100) on the MCP Skills Hub health score as of Oct 28, 2026.

## Install

### How to install Codebase Memory in Claude Code

1. Add the server

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

2. Verify it's connected

```bash
claude mcp list
```

3. Sharing it with your team?

   Add `--scope project` to write it to .mcp.json in the repository root, which you can commit (with the secrets left as environment variables).

4. Use it in a session

   Ask Claude to use the tools this server exposes (e.g. index_repository, list_projects, delete_project). It discovers them automatically.

### How to install Codebase Memory in Claude Desktop

1. Open your MCP config

   macOS: ~/Library/Application Support/Claude/claude_desktop_config.json · Windows: %APPDATA%\Claude\claude_desktop_config.json

2. Add this server

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

3. Restart Claude Desktop

   The tools appear under the 🔌 menu once the app reloads.

### How to install Codebase Memory in Cursor

1. Create / edit .cursor/mcp.json in your project

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

2. Enable it

   Cursor Settings → MCP → toggle the server on. Tools become available to the Composer/Agent.

### How to install Codebase Memory in Codex CLI

1. Add to ~/.codex/config.toml

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

2. Run Codex

   Codex loads MCP servers from config.toml on startup and exposes their tools to the agent.

### How to install Codebase Memory in Windsurf

1. Edit ~/.codeium/windsurf/mcp_config.json

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

2. Reload

   Windsurf → Cascade → refresh MCP servers. Cascade can now call the tools.

### How to install Codebase Memory in Cline

1. Open Cline → MCP Servers → Configure

   Adds to cline_mcp_settings.json.

2. Add the server

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

### How to install Codebase Memory in VS Code

1. Create .vscode/mcp.json

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

2. Start it

   VS Code shows a ▶ Start action above the server entry. Agent mode (Copilot Chat) can then use the tools.

## Tools

- `index_repository` — Index a repository into the graph. A successful call from an active MCP session registers the target for auto-sync while that session remains connected, subject to the global `auto_watch` setting; CLI calls do not register watches. Waits fo
- `list_projects` — List indexed projects with paging; use `detail: "stats"` for node/edge counts and database sizes.
- `delete_project` — Remove a project and all its graph data.
- `index_status` — Check indexing status of a project.
- `check_index_coverage` — Check whether exact paths or a scope are indexed and fresh. A clean result means no recorded gap, not proof of completeness.
- `search_graph` — Structural, BM25, and semantic search. Page structural rows with `offset`/`limit` and ranked semantic rows independently with `semantic_offset`/`semantic_limit`.
- `trace_path` — Trace callers, callees, data flow, or cross-service paths (alias: `trace_call_path`). Depth 1 to 15; tests are excluded by default. `mode`: `calls` (default), `data_flow`, `cross_service`, `topology` (Kubernetes objects, routes, controllers
- `detect_changes` — Map git diff to affected symbols + blast radius with risk classification.
- `query_graph` — Execute Cypher-like graph queries (read-only).
- `get_graph_schema` — Node/edge counts, relationship patterns, property definitions per label. Run this first.
- `compare_graphs` — Compare two indexed snapshots: node/edge additions and removals between a base and a target.
- `get_code_snippet` — Read source code for a function by qualified name.
- `get_file_outline` — Declaration outline of one repository-relative file in source order, with optional label filter and paging.
- `get_architecture` — Codebase overview: languages, packages, routes, hotspots, clusters, ADR.
- `search_code` — Grep-like text search within indexed project files.
- `manage_adr` — CRUD for Architecture Decision Records (`get` reads, `update` replaces the whole document, `set_sections` rewrites only the named sections and leaves every other byte untouched, `sections` lists headings). Query modes do not wait behind a s
- `ingest_traces` — Store observed call paths or caller/callee pairs under a run label. Both endpoints must resolve to indexed symbols; unresolved names are reported.

Source repository: https://github.com/DeusData/codebase-memory-mcp

---

Source: https://mcp-skills-hub.vercel.app/mcps/io-github-deusdata-codebase-memory-mcp · MCP Skills Hub · data as of 2026-10-28T12:31:05Z
