Scripts2026年7月14日·1 分钟阅读

Codebase Memory MCP — High-Performance Code Intelligence Server

An MCP server that indexes codebases into a persistent knowledge graph with sub-millisecond queries across 158 languages, delivered as a single static binary with zero dependencies.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 27/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Mcp Config
安装
Single
信任
信任等级:Established
入口
Codebase Memory MCP
安全暂存命令
npx -y tokrepo@latest install 5e7cf1e4-7fc2-11f1-9bc6-00163e2b0d79 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

Introduction

Codebase Memory MCP is an open-source MCP (Model Context Protocol) server that builds a persistent knowledge graph from your source code. It supports 158 programming languages, delivers sub-millisecond query responses, and ships as a single static binary with no external dependencies. Designed for AI coding agents, it reduces token usage by providing precise, structured code context.

What Codebase Memory MCP Does

  • Indexes entire codebases into a persistent knowledge graph stored locally
  • Supports 158 programming languages via tree-sitter parsing
  • Delivers sub-millisecond query performance for symbol lookups and code navigation
  • Integrates with AI coding agents through the MCP protocol
  • Ships as a single static binary with zero runtime dependencies

Architecture Overview

Codebase Memory MCP uses tree-sitter grammars to parse source files across 158 languages, extracting symbols, relationships, and structural information into a Cypher-queryable knowledge graph backed by SQLite. The graph captures functions, classes, imports, call sites, and type hierarchies. Queries resolve in sub-millisecond time because the graph is pre-computed and stored locally, avoiding repeated file scanning. The MCP protocol layer exposes this graph to any compatible AI agent or IDE.

Self-Hosting & Configuration

  • Download a single binary from the GitHub releases page for Linux, macOS, or Windows
  • No Docker, Python, or Node.js runtime required
  • Configure indexed directories and exclusion patterns via CLI flags or a config file
  • Knowledge graph data persists in a local SQLite database between sessions
  • Integrates with Claude Code, Cursor, Codex, and other MCP-compatible clients via stdio or SSE

Key Features

  • 158-language support through comprehensive tree-sitter grammar coverage
  • Sub-millisecond queries over the full knowledge graph
  • Single static binary under 20 MB with no dependencies
  • Persistent indexing that survives restarts without re-scanning unchanged files
  • MCP-native interface for direct integration with AI coding workflows

Comparison with Similar Tools

  • Sourcegraph — full-featured code search platform requiring server infrastructure; Codebase Memory MCP is a single binary
  • ctags/etags — symbol indexing only without relationship graphs or MCP integration
  • Language servers (LSP) — per-language setup and no MCP protocol support
  • GitHub code search — cloud-hosted and limited to GitHub repositories
  • Repomix — packs repos into a single file for LLMs but does not provide a queryable graph

FAQ

Q: Does Codebase Memory MCP require a database server? A: No. It uses an embedded SQLite database. Everything runs from the single binary.

Q: How large can the indexed codebase be? A: It handles repositories with millions of lines of code. Indexing time scales linearly with codebase size, and incremental updates only re-index changed files.

Q: Which AI agents support the MCP protocol? A: Claude Code, Cursor, OpenAI Codex CLI, Gemini CLI, and other tools that implement the Model Context Protocol.

Q: Is the knowledge graph queryable outside of AI agents? A: Yes. The graph supports Cypher-style queries, so you can query it from scripts or custom tooling.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产