Codebase-memory-mcp - Persistent Code Memory for AI Agents
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.

Introduction
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.
Highlights
- Zero-dependency deployment: Ships as a single static C binary — no Node.js, Python, or any runtime environment required. Download and run.
- Extremely low token consumption: With the pre-indexed knowledge graph, AI agents no longer reload the entire codebase; answering structural questions consumes 120x fewer tokens, significantly cutting API costs.
- Broad compatibility: Natively supports 11 major AI coding agents and editors including Claude Code, Codex CLI, Gemini CLI, Cursor, and Zed — plug and play.
- Persistent storage: Index results are saved locally to disk, so there is no need to re-index after restarts, making long-term usage more efficient.
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.






