Skip to content
Codebase Memory MCP

Codebase Memory MCP

MIT
code-intelligenceknowledge-graphtree-sitterlocal-first

Summary

Local code-intelligence MCP server that indexes a repository into a persistent knowledge graph, so structural questions cost one query instead of a file-reading spree.

Features

  • Persistent code knowledge graph queried with Cypher-like syntax
  • Tree-sitter parsing across 158 languages, hybrid LSP typing for 12
  • Sub-millisecond structural queries; ~99% fewer tokens than file crawling
  • Single static binary — no Docker, no API keys, no telemetry
  • Installer auto-configures Claude Code and Cursor

Installation

Set up this MCP server in your favorite AI agent — copy a ready-made configuration below.

Any MCP-compatible agent

Most agents (Claude, Cursor, Windsurf, VS Code, and more) read a standard mcpServers configuration.

  1. Open your agent's MCP configuration file.
  2. Merge the snippet below into it.
  3. Restart the agent — the "Codebase Memory MCP" tools will be available.
{
  "mcpServers": {
    "codebase-memory-mcp": {
      "command": "codebase-memory-mcp",
      "args": []
    }
  }
}

Description

Ask an agent "who calls this function" and it will grep, open twenty files and burn six figures of tokens arriving at an answer a compiler would know instantly. Codebase Memory MCP replaces that with a graph: it indexes the repository once into nodes (functions, classes, routes) and edges (CALLS, IMPORTS, HTTP_CALLS) and answers structural queries in under a millisecond.

The indexing is two-layer. Tree-sitter provides fast syntactic parsing across 158 vendored grammars, pulling out definitions, imports and call sites. On top of that a hybrid LSP layer does type-aware refinement for a dozen languages — Python, TypeScript/JavaScript, PHP, C#, Go, C, C++, Java, Kotlin, Rust and Perl — resolving types across files without actually running a language server. Results are held in SQLite with LZ4 compression and written out in a single dump. A daemon coordinates sessions across multiple agents, runs background watchers and serves an optional graph visualisation on localhost.

The project's own measurement of the payoff: five graph queries consumed roughly 3,400 tokens where file-by-file exploration of the same question took about 412,000. It reports full-indexing an average repository in milliseconds and the Linux kernel — 28M lines across 75,000 files — in about three minutes.

It is a single static binary with no runtime dependencies, no Docker, no API keys and no telemetry; everything is local and code never leaves the machine. macOS, Linux and Windows builds are published, and the installer auto-detects Claude Code and Cursor and wires them up. MIT licensed.

Related MCP Servers

MCP: HackerOne

by HackerOne

New

Official read-only MCP server for HackerOne bug bounty reports, programs, and remediation data.

Developer Tools
1 views

MCP: mcp-remote

by Glen Maddern

New

A proxy that lets local-only MCP clients connect to remote servers, handling OAuth and transport differences.

Developer Tools
1 views

MCP: Blender

by Siddharth Ahuja

New

Control Blender from an AI client — build scenes, apply materials, and run Python against the live session.

Developer Tools
2 views

MCP: E2B

by E2B

New

Run AI-generated code safely in an isolated cloud sandbox, with results returned as data rather than text.

Developer Tools
Browse all MCP servers →