SuperAPI AI Directory

codebase-memory-mcp

🌊 🏠 🍎 🪟 🐧 - Indexes a repo into a persistent local knowledge graph of functions, classes, call chains, HTTP routes and cross-service links, using tree-sitter and LSP.

Open website

About this tool

Purpose

codebase-memory-mcp is a local Model Context Protocol (MCP) server that provides a persistent code knowledge graph for coding agents such as Claude Code and Codex. It indexes codebases as functions, classes, imports, HTTP routes, and the cross-service relationships between them, for code search, call graph tracing, and software architecture exploration.

Main Capabilities

  • Persistent Knowledge Graph: Indexes repositories as a local knowledge graph, recording functions, classes, imports, HTTP routes, and relationships.
  • Multi-Language Support: Indexing supports 162 languages, with tree-sitter grammars already compiled into the binary, so no separate parser installation is required. Hybrid LSP adds semantic type resolution for Python, TypeScript, JavaScript, JSX/TSX, PHP, C#, Go, C, C++, Java, Kotlin, Rust, and Perl.
  • Performance: Officially stated to index average repositories in milliseconds; the published backend benchmark reports that the Linux kernel (28 million lines, 75K files) finishes indexing in about 3 minutes, and Cypher relationship queries take under 1 millisecond on an Apple M3 Pro. The project reports about a 120x token reduction across five query comparisons (about 3,400 vs about 412,000).
  • 17 MCP Tools: Search, tracing, architecture, impact analysis, targeted index coverage checks, Cypher queries, dead code detection, cross-service HTTP linking, ADR management, and more.
  • Infrastructure-as-Code Indexing: Dockerfiles, container images, docker compose, Kubernetes manifests, and Kustomize overlays as graph nodes with cross-references.
  • CBM Lens Beta: A browser interface that provides an IDE-style source code reader, local code chat, 3D architecture diagrams, Galaxy graph, coverage checks, and architecture decision record editing.
  • Multi-Client Integration: Supports 45 automatic or conditional client surfaces; during installation it configures detected clients and safely activates conditional clients when they match the documented platform, markers, or existing configuration paths.

Usage

Install the latest release via the installation script (macOS / Linux): useafter extracting with tar, run ./install.sh; on Windows, use PowerShell's Expand-Archive and ./install.ps1. Installation options include --skip-config (install only the binary, do not configure agents) and --dir=<path> (custom location). The installation command automatically removes the macOS quarantine attribute and ad-hoc signs the binary. After installation, restart the coding agent and say "Index this project" to begin. You can also manually install by downloading the platform-specific archive from the latest release (macOS/Linux as .tar.gz, Windows as .zip). The installation command automatically detects installed coding agents, configures their documented MCP entries, and, when supported, writes persistent instructions, skills, and lifecycle hooks.

CBM Lens Beta can be used by starting a local server, then opening in a browser http://127.0.0.1:9749;永久守护进程让 The UI remains available after the command exits; use daemon status to check and daemon stop to stop it; in an MCP session, use --ui=true --port=9749 to enable the same shared UI. Open the project menu and select Add project index (or Alt+P), choose the local repository folder and name the index; files stay in place, and after indexing starts you can close the dialog and reopen the activity from the project menu.

The architecture view includes Overview (browse source folders and files on a 3D map), Entry points, Routes (service graph and endpoint connections), Hotspots (based on measured signals such as fan-in and complexity, not a code quality score), System structure (component dependencies, grouping, cycle isolation), and Behavior (static call paths and source statements, not the actual execution order; runtime observation requires importing a trace separately). Views can be bookmarked with ?project=<name>&workspace=architecture; other workspace values are explore, galaxy, adr, coverage, and system.

Applicable scenarios

  • Quickly get familiar with an unfamiliar codebase.
  • Perform "rescue engineering" on an inherited project.
  • Understand a large amount of AI-generated code in a short time (for example, 50,000 lines generated in one day).
  • Review changes, investigate fragile areas, and maintain code quality.
  • Read source code in the browser, trace dependencies and call paths, and converse with a local model around selected code.

Limitations and notes

  • Indexing and graph queries do not require a hosted service or API key; source analysis and graph storage happen locally. CBM Lens can optionally download a browser AI model, and once enabled, inference still runs on-device.
  • CBM Lens Beta entered main with PR #2068 and is not part of the current v0.11.0 release; the installer for that release still provides the old graph UI. To use the interface shown immediately, build from source.
  • All active CBM processes must use exactly the same version, executable build, coordination ABI, and canonical cache root; genuinely different cache roots will be rejected while any CBM process is active.
  • Microsoft Defender may flag the release binary as Trojan:Script/Wacatac.B!ml; the officialexplanation is that this is a known false positive (usually about 61 out of 62 engines return clean), and it provides ways to verify and report it yourself.
  • If you encounter a script execution policy error during installation, you can first run Set-ExecutionPolicy -Scope Process Bypass, or invoke it with PowerShell -ExecutionPolicy Bypass -File .\install.ps1.
  • Specific information such as fees and pricing is not currently provided in the materials.