经 AI Skill Hub 精选评估,代码库内存MCP服务 获评「强烈推荐」。已获得 2.3k 颗 GitHub Star,这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.2 分,适合有一定技术背景的用户使用。
高性能代码智能MCP服务器,可将代码库索引到持久化存储中。支持AST分析和代码智能功能,为Claude Code和Aider等工具提供代码上下文理解能力,适合开发者和AI编程工具集成使用。
代码库内存MCP服务 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
高性能代码智能MCP服务器,可将代码库索引到持久化存储中。支持AST分析和代码智能功能,为Claude Code和Aider等工具提供代码上下文理解能力,适合开发者和AI编程工具集成使用。
代码库内存MCP服务 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/DeusData/codebase-memory-mcp
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"-----mcp--": {
"command": "npx",
"args": ["-y", "codebase-memory-mcp"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 代码库内存MCP服务 执行以下任务... Claude: [自动调用 代码库内存MCP服务 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"_____mcp__": {
"command": "npx",
"args": ["-y", "codebase-memory-mcp"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
Understand your repository, from source code to the systems around it. codebase-memory-mcp is an MCP server that connects code, documentation, configuration, and infrastructure in a persistent local knowledge graph. Use it to find an unfamiliar feature, follow a call across services, trace a deployment back to its source, or assess which parts of a project a change could affect.
Give your coding agent structural context through Model Context Protocol (MCP), or query the graph directly from the CLI. The MCP server is the core of the project. Its optional visual companion, CBM Lens, is in open beta (v0.0.1), with a source reader, architecture maps, the Galaxy graph, coverage diagnostics, architecture decisions, and local code chat.
The native C backend exposes 17 MCP tools, parses languages and file formats with vendored grammars, and adds Hybrid LSP type resolution for supported languages. The installer supports 45 automatic or conditional client integrations, including client configuration, skills, agent profiles, and applicable hooks. Indexing and graph queries need no hosted service or API key. Focused graph queries can reduce repeated file reads and token use; see the measured results.
Quick start · Capabilities · Documentation · Infrastructure · Smart CI · Explore CBM Lens · Agent setup · MCP tools
Local processing: Source analysis and graph storage run on your machine. CBM Lens can optionally download a model for browser AI after you enable it; inference stays on the device. The installer writes agent configuration for the clients you select. See Security for release verification and SECURITY.md for reporting issues.
See the graph with CBM Lens (open beta v0.0.1). Folders become nested platforms, files and symbols become selectable blocks, and arrows show indexed relationships. The recording opens src/foundation in the map of this repository, selects arena.c and opens its source. Height can show source size; hotspot gravity reflects static fan-in. Still image.
<p align="center"> <img src="docs/images/lens-overview.gif" alt="CBM Lens Beta architecture walkthrough: open src/foundation, select arena.c and read its source beside the map" width="1000"> </p>
Galaxy. Explore the code knowledge graph in 3D. The recording follows the outgoing relationships of cbm_arena_alloc one layer further, switches to the hierarchy and shows the two-hop call path to cbm_alloc. Edge pulses show relationship direction; they do not represent live execution. Still: two dependency layers around cbm_max_file_bytes.
<p align="center"> <img src="docs/images/lens-galaxy.gif" alt="Code knowledge graph in CBM Lens Beta Galaxy: expand cbm_arena_alloc, switch to the hierarchy and follow its call path through arena_grow to cbm_alloc" width="1000"> </p>
Explore. Browse files in an IDE-style workspace, read syntax-highlighted source in Monaco, and keep the code graph alongside it. File impact shows what depends on the open file, and Code details shows the callers and calls of the symbol under the caret. Select code to ask the local chat about it.
<p align="center"><img src="docs/images/lens-explore.jpg" alt="CBM Lens Beta Explore: limits.c in the source reader beside its file impact summary and direct graph dependencies" width="1000"></p>
<details> <summary>More views: system structure and behavior</summary>
<p>System structure groups symbols into components and lets you inspect their dependencies.</p> <p align="center"><img src="docs/images/lens-system-structure.png" alt="CBM Lens Beta system structure: source groups of this repository with their dependencies, src selected" width="1000"></p>
<p>Behavior shows possible calls from a selected operation and the source evidence behind them.</p> <p align="center"><img src="docs/images/lens-behavior.png" alt="CBM Lens Beta Behavior view: the possible direct calls of compileCards and its declaration" width="1000"></p>
</details>
The high-resolution GIFs show CBM Lens Beta on 20 October 2026; the still images were captured on 12–13 October. All show public source from this repository. See capture details for each capture's build, indexed scope and recording setup.
Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1
Installation also equips supported coding agents to use the graph in daily work. The native install command detects clients and installs the integration pieces their documented formats support:
| Component | What it adds |
|---|---|
| **MCP configuration** | Connects the client to the local server and its tools. |
| **Instructions and skills** | Explains graph-first exploration, index freshness, coverage checks, and when to read source. |
| **Scout, Verify, and Auditor profiles** | Offers fast provisional lookup, task-directed verification, or bounded full verification, where custom agents are supported. |
| **Session and compaction hooks** | Restores graph context at supported lifecycle events. |
| **Search and read hooks** | Adds relevant graph context to supported searches and flags recorded coverage gaps after supported file reads. |
Hook augmentation is context-only and fail-open: it does not replace or block the requested tool call. Features vary by client and platform; some clients use durable instructions or a parent-agent handoff instead of hooks or direct subagent MCP access. Codex users review and trust installed hooks through /hooks. See Multi-Agent Support and Sessions, compaction, and subagents for exact support and activation requirements.
codebase-memory-mcp uninstall
Removes owned agent config entries, skills, hooks, instructions, and the installed binary. Existing graph indexes are listed and kept by default. -y/--yes, -n/--no, and noninteractive input keep them unless --delete-indexes is explicitly given. An interactive terminal without that flag is asked separately; the default answer is to keep them.
codebase-memory-mcp uninstall -y --delete-indexes # also delete every project index
codebase-memory-mcp uninstall --dry-run --delete-indexes # preview; change nothing
--delete-indexes is explicit consent and takes precedence over --no; --dry-run always preserves the files. When indexes are kept, uninstall prints their cache directory (${CBM_CACHE_DIR:-~/.cache/codebase-memory-mcp}) and how to remove them.
The install script placed beside the binary is reported, not deleted: uninstall prints its path and the rm command for it. It is left alone on purpose: it may be your own copy, a symlink into a checkout, or managed by a package manager, and an uninstaller should not delete a file it cannot prove it owns.
Ask "What deploys this service?", "Which image runs it?", or "Where does this configuration reach code?" CBM connects supported infrastructure forms to the source they build, configure, and run:
For resolvable inputs, a trace can follow Service → workload → image → Dockerfile → program, or follow deployment and configuration relationships. Use trace_path modes for topology, deployment, and run paths. These are static relationships from supported source forms; dynamic values and unresolved templates can leave gaps. See Edge types for the exact relationship rules and limitations.
<details> <summary>Automated download + install</summary>
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/scripts/setup.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/scripts/setup-windows.ps1 | iex
</details>
Install the latest release (macOS / Linux):
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash
The standard native release includes CBM Lens. Start it after installation with codebase-memory-mcp daemon start --open --port=9749. The Nix packages and source builds also offer builds without the UI.
Windows (PowerShell): ```powershell
notepad install.ps1
@myorg/pkg, github.com/foo/bar, use my_crate::foo resolved via manifest scanning (package.json, go.mod, Cargo.toml, pyproject.toml, composer.json, pubspec.yaml, pom.xml, build.gradle, mix.exs, *.gemspec)Dockerfile.*, *.Dockerfile, Containerfile: bases, what the container runs, ENV), container images (Image: the normalised repository, tag and digest on the edges; a repository built from several Dockerfiles, one per component tag, gets an Image per component), docker compose services (Resource), Kubernetes manifests (Resource, with group, version, kind, namespace, labels as k=v,k2=v2), Kustomize overlays (IMPORTS to their entries and patch files, OVERRIDE from their patches), Helm charts (Chart, DEPENDS_ON), Terraform / OpenTofu (.tf, .tofu, .tfvars) as graph nodes. A Service walks to the code it runs: Service → workload → Image → Dockerfile → maincodebase-memory-mcp indexes and queries locally and collects no telemetry. When you hit something we can't reproduce on our side (a slow memory climb over hours, a performance regression, a leak that only appears after days of real use), we have no diagnostic data unless you choose to send it. Here is how to capture it yourself.
codebase-memory-mcp 是一个专为 AI Agent 设计的增强型记忆工具,通过 MCP 协议为 Claude 等智能体提供深度代码库理解能力。它能够构建代码结构的知识图谱,让 AI 能够精准地检索、追踪和理解复杂的项目逻辑,从而显著提升 AI 在大型代码库中的开发协作效率。
该项目具备强大的代码语义分析能力,内置了 155 种 tree-sitter 语法解析器,支持多种编程语言的自动索引。它不仅能实现通用的包与模块解析(如 package.json, go.mod, Cargo.toml 等),还提供可视化图谱 UI,帮助开发者直观地查看代码调用链路与结构关系。
本项目支持多种平台的快速安装。macOS 与 Linux 用户可以通过 curl 命令执行一键安装脚本,并支持通过参数开启 graph visualization UI。Windows 用户可以使用 PowerShell 运行提供的 install.ps1 脚本。此外,您也可以通过手动编辑 `.mcp.json` 配置文件来完成 MCP 服务器的部署。
安装完成后,您可以直接在支持 MCP 的 Agent(如 Claude)中使用。对于高级用户,本项目提供了 CLI 模式,允许您直接在命令行中调用 index_repository、search_graph 或 trace_call_path 等工具,实现对代码库的自动化索引与路径追踪。
用户可以通过命令行工具进行灵活配置。使用 `codebase-memory-mcp config` 命令可以查看、设置或重置各项参数,例如控制自动索引功能的开关(auto_index)以及设置最大索引文件限制(auto_index_limit)。对于手动配置 MCP 的用户,请确保在 `.mcp.json` 中使用绝对路径指向二进制文件。
本项目提供强大的 CLI 接口,使每一个 MCP tool 都能在终端中独立运行。开发者可以通过命令行传递 JSON 参数来执行复杂的任务,例如使用 `cli index_repository` 进行仓库索引,或使用 `cli trace_call_path` 进行函数调用链路的深度追踪,非常适合集成到自动化工作流中。
项目采用先进的 Indexing pipeline,通过内置的 tree-sitter 语法解析器实现对代码的深度扫描。它具备智能的模块解析能力,能够通过扫描 package.json、go.mod、Cargo.toml 等清单文件,自动识别并解析不同语言的依赖关系。此外,支持通过自定义 JSON 配置文件扩展文件后缀映射,以适配框架特定的扩展名。
针对常见问题,若 `/mcp` 命令无法显示服务器,请检查 `.mcp.json` 中的路径是否为绝对路径并重启 Agent。在执行 `index_repository` 时,务必传入绝对路径以避免识别失败。如果 `trace_call_path` 出现异常,建议检查相关函数的解析完整性。
专业的MCP代码智能��务器实现,架构成熟,星标认可度高,持续维护,适合集成到AI编程工具链中。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:代码库内存MCP服务 的核心功能完整,质量优秀。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | codebase-memory-mcp |
| 原始描述 | 开源MCP工具:High-performance code intelligence MCP server. Indexes codebases into a persiste。⭐2.3k · C |
| Topics | 代码分析MCP服务AST解析代码智能高性能索引 |
| GitHub | https://github.com/DeusData/codebase-memory-mcp |
| License | MIT |
| 语言 | C |
收录时间:2026-05-14 · 更新时间:2026-05-16 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端