/ Directory / Playground / codebase-memory-mcp
● Community DeusData ⚡ Instant

codebase-memory-mcp

by DeusData · DeusData/codebase-memory-mcp

Index any codebase into a persistent knowledge graph — 66 languages, sub-ms queries, 99% fewer tokens than file-by-file exploration.

codebase-memory-mcp builds a persistent knowledge graph from entire codebases using tree-sitter parsing across 66 languages. It indexes the Linux kernel (28M LOC) in 3 minutes, supports Cypher-like queries, call graph tracing, git diff mapping, and optional 3D visualization. Single static binary with zero dependencies, auto-configures for 11+ AI agents.

Why use it

Key features

Live Demo

What it looks like in practice

codebase-memory.replay ▶ ready
0/0

Install

Pick your client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "codebase-memory": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/DeusData/codebase-memory-mcp"
      ],
      "_inferred": true
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "codebase-memory": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/DeusData/codebase-memory-mcp"
      ],
      "_inferred": true
    }
  }
}

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "codebase-memory": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/DeusData/codebase-memory-mcp"
      ],
      "_inferred": true
    }
  }
}

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "codebase-memory": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/DeusData/codebase-memory-mcp"
      ],
      "_inferred": true
    }
  }
}

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "codebase-memory",
      "command": "TODO",
      "args": [
        "See README: https://github.com/DeusData/codebase-memory-mcp"
      ]
    }
  ]
}

Continue uses an array of server objects rather than a map.

~/.config/zed/settings.json
{
  "context_servers": {
    "codebase-memory": {
      "command": {
        "path": "TODO",
        "args": [
          "See README: https://github.com/DeusData/codebase-memory-mcp"
        ]
      }
    }
  }
}

Add to context_servers. Zed hot-reloads on save.

claude mcp add codebase-memory -- TODO 'See README: https://github.com/DeusData/codebase-memory-mcp'

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use codebase-memory-mcp

How to quickly understand a new codebase with codebase-memory

👤 Developers onboarding onto an unfamiliar project ⏱ ~15 min beginner

When to use: You just joined a team or started working on a new repo and need to understand its architecture fast.

Prerequisites
  • codebase-memory installed — curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash
Flow
  1. Index the codebase
    Index this project repository and give me an architecture overview.✓ Copied
    → High-level module map with key entry points and dependencies
  2. Explore a specific module
    Show me the call graph for the authentication module. What functions does login() call?✓ Copied
    → Call chain from login through middleware, validation, and database
  3. Find related code
    Search the graph for all functions that interact with the user table.✓ Copied
    → List of functions with file locations and relationships

Outcome: A solid mental model of the codebase architecture in minutes instead of hours.

Pitfalls
  • Indexing very large monorepos takes time on first run — Use index_status to check progress. Subsequent queries are instant since the graph persists.
Combine with: filesystem · github

Analyze the impact of a code change before refactoring

👤 Senior engineers planning a refactoring effort ⏱ ~20 min intermediate

When to use: You want to know what will break before you rename, move, or delete a function or class.

Prerequisites
  • Codebase indexed — Run index_repository first
Flow
  1. Trace all callers
    Trace all call paths to the deprecated processPayment() function across the entire codebase.✓ Copied
    → Complete list of callers with file paths and call depths
  2. Map git changes to symbols
    I changed these files in my branch. Use detect_changes to show which symbols in the graph are affected.✓ Copied
    → List of affected functions and their downstream dependents

Outcome: A complete impact analysis showing all code that needs to change.

Pitfalls
  • Graph may be stale if code changed since last index — Re-run index_repository after significant code changes
Combine with: github · filesystem

Combinations

Pair with other MCPs for X10 leverage

codebase-memory + github

Index a repo, then use GitHub MCP to find PRs that affect critical call paths

Index our repo, trace all callers of the auth middleware, then check if any open PRs modify those paths.✓ Copied
codebase-memory + filesystem

Index locally, query the graph, then edit the found files directly

Find all functions that call the deprecated API, then update each one to use the new API.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
index_repository path: str Index a codebase into the knowledge graph (run once, persists) 0
search_graph label?: str, pattern?: str Search the graph by label or pattern 0
trace_call_path from: str, to: str Find call chains between two functions 0
detect_changes diff: str Map git diffs to affected symbols in the graph 0
get_architecture project?: str Get a high-level architecture overview of the indexed codebase 0
query_graph query: str Run a Cypher-like query against the graph 0
search_code pattern: str Grep-style text search across indexed code 0

Cost & Limits

What this costs to run

API quota
N/A — fully local
Tokens per call
50–500 tokens per query (vs 2000+ for reading files directly)
Monetary
Free
Tip
Index once, query many times. The graph persists between sessions so you don't re-index.

Security

Permissions, secrets, blast radius

Credential storage: N/A — no external credentials
Data egress: 100% local processing. Your code never leaves your machine.

Troubleshooting

Common errors and fixes

Indexing fails on large repo

Ensure sufficient disk space for the graph database. For very large repos (>1M LOC), first indexing may take several minutes.

Verify: Check index_status for progress
Language not parsed correctly

Verify your language is in the 66 supported languages. Check tree-sitter grammar availability.

Verify: list_projects to see indexed stats
Graph queries return empty results

The codebase may not be indexed yet. Run index_repository first, then wait for completion.

Verify: index_status

Alternatives

codebase-memory-mcp vs others

AlternativeWhen to use it insteadTradeoff
filesystem MCPYou just need to read specific files rather than understand the whole codebaseNo graph, no call tracing — but zero setup

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills