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 | bashConfiguration
codebase-memory-mcp serveDocumentation
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
| Tool | Description |
|---|---|
search_graph | Search the codebase knowledge graph for symbols by name pattern |
trace_path | Trace dependency paths between functions (inbound/outbound) |
get_node | Get detailed information about a specific code symbol |
get_edges | Get relationships (calls, extends, implements) for a symbol |
find_implementations | Find all implementations of an interface or abstract class |
get_architecture | Analyze the high-level architecture of the codebase |
query_cypher | Execute custom Cypher queries on the knowledge graph |
list_symbols | List all symbols matching a given type or category |
get_callers | Find all functions that call a given function |
get_callees | Find all functions called by a given function |
get_file_symbols | List all symbols defined in a specific file |
detect_patterns | Detect architectural patterns in the codebase |
get_dependencies | Get dependency graph for a specific module or package |
index_repository | Index 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
- Download and install the binary
- Add the configuration to
claude_desktop_config.json - Restart Claude Desktop
- Open a project and start asking questions about your codebase
Architecture
Codebase Memory MCP works by:
- Scanning your codebase and parsing all files using tree-sitter grammars
- Building a knowledge graph with nodes for functions, classes, interfaces, and variables
- Extracting relationships (calls, extends, implements, contains) between symbols
- Storing the graph in a persistent format for fast retrieval
- 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
