Codebase-memory-mcp - Persistent Code Memory for AI Agents

Codebase-memory-mcp - Persistent Code Memory for AI Agents

4.0

Codebase-memory-mcp provides persistent memory for AI agents via MCP. Supports 120+ languages, 158 file types, and LSP integration. Works with Claude Code, Codex CLI, and Gemini CLI on Linux.

Last Updated Oct 21, 2026
Codebase-memory-mcp - Persistent Code Memory for AI Agents screenshot

About

As AI-assisted programming becomes increasingly common, helping AI agents efficiently understand large codebases while dramatically reducing compute costs has become a core pain point for developers. Codebase-memory-mcp is an open-source MCP server built to solve exactly this problem. It indexes any codebase into a persistent knowledge graph, enabling AI coding agents to reduce token consumption by roughly 120x when answering structural questions. This translates to faster response times, lower API costs, and more precise contextual understanding. Both individual developers and enterprise teams can benefit from this tool.

Key Features

Multi-language support: Covers 158 programming languages, seamlessly indexing everything from Python, JavaScript, and Rust to niche languages.
Hybrid LSP type resolution: Leverages the Language Server Protocol (LSP) for deep type inference, accurately identifying complex dependencies between variables, functions, and classes.
Local semantic vector search: Performs semantic-level vectorized code search locally without relying on external APIs, quickly locating relevant code snippets.
Code clone detection: Automatically identifies duplicate or similar code blocks within the codebase to assist with refactoring and code quality maintenance.
Sub-millisecond querying: The optimized index structure ensures query responses complete in under 1 millisecond, even for large projects.
Blazing-fast indexing: On standard hardware, indexes a Linux-kernel-scale codebase in under 3 minutes, dramatically reducing wait times.

Pricing & Fees

  • Pricing: Not publicly listed on the pages we reviewed; check the official site for current plans. The project is open source under the MIT license.
  • Free availability: As MIT-licensed open-source software, the server can be downloaded and used at no software cost; only your own AI agent API usage incurs fees.
  • Cost control: Focused graph queries reduce repeated code reading and token use, helping lower API token costs when agents answer structural questions.
  • Platform availability: Runs on macOS, Linux and Windows as a native C binary, with local processing — the index stays on your machine.
  • Persistent storage: Indexes are saved locally to disk, so there is no need to re-index after restarts.

Who It's For

AI coding agent users who want to improve code understanding precision and reduce costs with tools like Claude Code or Codex CLI. Maintainers of large projects working with million-line codebases who need fast retrieval and navigation of complex dependencies. Open-source contributors looking to quickly get up to speed on unfamiliar projects by understanding code architecture through the knowledge graph. DevOps professionals and architects who need automated code analysis, clone detection, and refactoring recommendations.