🔌

Codebase Memory MCP

DevTools14,500

High-performance code intelligence MCP server — indexes codebases into a persistent knowledge graph with sub-millisecond queries.

Claude DesktopCursorClaude Code

Overview

High-performance code intelligence MCP server — indexes codebases into a persistent knowledge graph with sub-millisecond queries.

Setup

Run with npx:

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

Configuration

codebase-memory-mcp serve

Documentation

Codebase Memory MCP

Overview

Codebase Memory MCP is a high-performance code intelligence MCP server that indexes codebases into a persistent knowledge graph. Developed by DeusData, it supports 158 languages with sub-millisecond queries, and reduces token usage by up to 99% compared to file-by-file exploration during code analysis. The server ships as a single static binary with zero dependencies, making it easy to deploy in any environment.

The server uses vendored tree-sitter grammars for language parsing and provides 14 MCP tools for search, trace, architecture analysis, and Cypher queries. It also features a built-in 3D graph visualization interface accessible at localhost:9749, allowing developers to explore their codebase structure visually.

Features

  • Blazing Fast Indexing: Linux kernel (28M LOC) indexed in approximately 3 minutes
  • Language Support: 158 languages via vendored tree-sitter grammars
  • Hybrid LSP: Semantic type resolution for 9 languages (Python, TypeScript, Rust, Go, Java, C++, C, C#, Ruby)
  • 14 MCP Tools: Search, trace, architecture analysis, Cypher queries, and more
  • Cross-Service Linking: HTTP/gRPC route matching and channel detection
  • Graph UI: Built-in 3D visualization at localhost:9749
  • Single Binary: Zero dependencies, easy deployment
  • Token Efficiency: Reduces token usage by up to 99% compared to file-by-file exploration
  • Knowledge Graph: Persistent codebase knowledge that persists across sessions

Installation

macOS/Linux

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

Windows (PowerShell)

Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1
.\install.ps1

Manual Installation

Download the latest binary from the releases page.

Configuration

Claude Desktop Setup

Add the following to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "codebase-memory": {
      "command": "codebase-memory-mcp",
      "args": ["serve"],
      "env": {
        "CODEBASE_MEMORY_PORT": "9749"
      }
    }
  }
}

Cursor Configuration

{
  "mcpServers": {
    "codebase-memory": {
      "command": "codebase-memory-mcp",
      "args": ["serve"]
    }
  }
}

Available Tools

ToolDescription
search_graphSearch the codebase knowledge graph for symbols by name pattern
trace_pathTrace dependency paths between functions (inbound/outbound)
get_nodeGet detailed information about a specific code symbol
get_edgesGet relationships (calls, extends, implements) for a symbol
find_implementationsFind all implementations of an interface or abstract class
get_architectureAnalyze the high-level architecture of the codebase
query_cypherExecute custom Cypher queries on the knowledge graph
list_symbolsList all symbols matching a given type or category
get_callersFind all functions that call a given function
get_calleesFind all functions called by a given function
get_file_symbolsList all symbols defined in a specific file
detect_patternsDetect architectural patterns in the codebase
get_dependenciesGet dependency graph for a specific module or package
index_repositoryIndex a repository for the first time or re-index

Usage Examples

Indexing a Repository

# CLI mode
codebase-memory-mcp cli index_repository '{"repo_path": "/path/to/repo"}'

# Or via the MCP server tool
# Call the index_repository tool with the repo path

Searching for Symbols

codebase-memory-mcp cli search_graph '{"name_pattern": ".*Handler.*"}'

Tracing Function Calls

# Inbound trace - find all callers
codebase-memory-mcp cli trace_path '{"function_name": "ProcessOrder", "direction": "inbound"}'

# Outbound trace - find all callees
codebase-memory-mcp cli trace_path '{"function_name": "ProcessOrder", "direction": "outbound"}'

Using in Claude Code

Once configured, Codebase Memory MCP integrates seamlessly with Claude Code and other Claude-based tools. When working on a codebase, simply ask Claude to analyze the code structure, find dependencies, or trace function calls, and it will use the MCP tools automatically.

Claude Desktop Setup

  1. Download and install the binary
  2. Add the configuration to claude_desktop_config.json
  3. Restart Claude Desktop
  4. Open a project and start asking questions about your codebase

Architecture

Codebase Memory MCP works by:

  1. Scanning your codebase and parsing all files using tree-sitter grammars
  2. Building a knowledge graph with nodes for functions, classes, interfaces, and variables
  3. Extracting relationships (calls, extends, implements, contains) between symbols
  4. Storing the graph in a persistent format for fast retrieval
  5. Serving queries through the MCP protocol and CLI

Pros

  • ✅ Sub-millisecond queries on indexed codebases
  • ✅ 99% token reduction vs file-by-file exploration
  • ✅ 158 language support via tree-sitter
  • ✅ Single binary with zero dependencies
  • ✅ Built-in 3D visualization UI
  • ✅ Cross-service linking (HTTP/gRPC route matching)
  • ✅ Fast indexing (28M LOC in ~3 minutes)
  • ✅ Open source (MIT license)

Cons

  • ❌ Initial indexing time for very large codebases
  • ❌ Semantic type resolution limited to 9 languages
  • ❌ Requires re-indexing when codebase changes significantly
  • ❌ Binary size may be large due to bundled tree-sitter grammars

When to Use

Codebase Memory MCP is ideal for:

  • Large codebases where file-by-file exploration is inefficient
  • Onboarding new developers to complex projects
  • Code review requiring deep understanding of dependencies
  • Refactoring analysis to understand impact of changes
  • Documentation generation based on code structure
  • Architecture analysis and visualization

Resources