MCP Directory

codebase-memory-mcp

Code intelligence engine that indexes repos into a persistent knowledge graph for AI coding agents.

Unverified
stdio (local)
No auth
C

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "codebase-memory-mcp": {
      "command": "/path/to/codebase-memory-mcp",
      "args": []
    }
  }
}

Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf

Before you start

  • A supported platform: macOS (arm64/amd64), Linux (arm64/amd64), or Windows (amd64)
  • An MCP-compatible coding agent (e.g. Claude Code, Cursor, Windsurf, Codex CLI, Gemini CLI, Zed, etc.)
  • No runtime dependencies, Docker, or API keys required for the pre-built binary
  • To build from source: a C and C++ compiler (gcc/clang) plus zlib and git

About codebase-memory-mcp

codebase-memory-mcp is a structural analysis backend that builds and queries a knowledge graph of your codebase, designed to give AI coding agents fast, token-efficient code context. It does not include an LLM — it relies on your MCP client (Claude Code or any MCP-compatible agent) as the intelligence layer that translates natural-language questions into graph queries. It full-indexes an average repository in milliseconds and the Linux kernel (28M LOC, 75K files) in about 3 minutes, answering structural queries in under 1ms. The project reports a ~99% token reduction versus file-by-file grep exploration (five structural queries ~3,400 tokens vs ~412,000). Indexes are SQLite-backed and persist at ~/.cache/codebase-memory-mcp/, with a background watcher for git-based auto-sync and an optional team-shared compressed graph artifact (.codebase-memory/graph.db.zst) so teammates can skip the reindex.

Tools & capabilities (14)

index_repository

Index a repository into the graph. Auto-sync keeps it fresh afterward.

list_projects

List all indexed projects with node/edge counts.

delete_project

Remove a project and all its graph data.

index_status

Check indexing status of a project.

search_graph

Structured search by label, name pattern, file pattern, and degree filters, with limit/offset pagination.

trace_path

BFS traversal showing who calls a function and what it calls (alias: trace_call_path), depth 1-5.

detect_changes

Map a git diff to affected symbols and blast radius with risk classification.

query_graph

Execute read-only Cypher-like graph queries (openCypher read subset).

get_graph_schema

Return node/edge counts, relationship patterns, and property definitions per label. Run this first.

get_code_snippet

Read source code for a function by its qualified name.

get_architecture

Codebase overview: languages, packages, routes, hotspots, clusters, and ADRs in a single call.

search_code

Grep-like text search within indexed project files.

manage_adr

CRUD for Architecture Decision Records, persisted across sessions.

ingest_traces

Ingest runtime traces to validate HTTP_CALLS edges.

What this server can do

codebase-memory-mcp provides tools for these capabilities — tap one to see every MCP server that does the same:

When to use it

  • Let an AI coding agent answer 'what calls this function?' across files and packages without grepping the whole repo
  • Get a one-call architecture overview (languages, packages, entry points, routes, hotspots, layers, clusters) of an unfamiliar codebase
  • Map uncommitted git changes to affected symbols and assess blast radius / risk before merging
  • Run Cypher-like queries to find dead code, trace call paths, or explore cross-service HTTP/gRPC/GraphQL links
  • Drastically reduce token usage during agent-driven code exploration via structural graph queries instead of file-by-file reads

Security notes

Reads your codebase and writes to your agent configuration files by design; all processing happens 100% locally and code never leaves your machine. Every release binary is statically linked with zero runtime dependencies, signed with Sigstore cosign, SLSA Level 3 provenance, SHA-256 checksummed, CodeQL-scanned, and scanned by 70+ antivirus engines via VirusTotal (zero detections required to publish). Verify provenance with `gh attestation verify <file> --repo DeusData/codebase-memory-mcp`.

codebase-memory-mcp FAQ

Does it require an API key or send my code anywhere?

No. It has zero API keys and runs 100% locally — all indexing and querying happens on your machine, and your code never leaves it. Bundled embeddings for semantic search are compiled into the binary, so no Ollama or external service is needed.

Does it include its own LLM?

No. It is a structural analysis backend that builds and queries the knowledge graph. It relies on your MCP client (the agent you're already talking to) to translate natural language into graph queries, avoiding extra API keys, cost, and configuration.

How many languages and tools does it support?

It parses 158 languages via vendored tree-sitter grammars and exposes 14 MCP tools. Eleven of those languages additionally get Hybrid LSP semantic type resolution for more accurate call-graph edges.

How do I configure it manually for Claude Code?

Add an 'mcpServers' entry pointing the 'command' to the absolute path of the codebase-memory-mcp binary with empty args in ~/.claude/.mcp.json or a project .mcp.json, then restart your agent and verify with /mcp. The install command can also auto-configure this and 10 other agents.

Alternatives to codebase-memory-mcp

Compare all alternatives →

Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).

Featured
Verified
stdio (local)
No auth
TypeScript
12 tools
Updated 21 days agoRepo

Up-to-date, version-specific library documentation injected into your coding agent.

Verified
stdio (local)
API key
TypeScript
2 tools
Updated 25 days agoRepo

LSP-powered coding agent toolkit: semantic symbol search, references and structural edits.

Verified
stdio (local)
No auth
Python
11 tools
Updated 23 days agoRepo