能力标签
代码库内存MCP服务
🔌
MCP工具

代码库内存MCP服务

基于 C · 让 AI 助手直接操作你的系统与工具
英文名:codebase-memory-mcp
⭐ 2.3k Stars 🍴 257 Forks 💻 C 📄 MIT 🏷 AI 8.2分
8.2AI 综合评分
代码分析MCP服务AST解析代码智能高性能索引
✦ AI Skill Hub 推荐

经 AI Skill Hub 精选评估,代码库内存MCP服务 获评「强烈推荐」。已获得 2.3k 颗 GitHub Star,这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.2 分,适合有一定技术背景的用户使用。

📚 深度解析
代码库内存MCP服务 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。

通过安装 代码库内存MCP服务,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。

在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。代码库内存MCP服务 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。

与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 代码库内存MCP服务 评为 AI 评分 8.2 分,属于同类工具中的优质选择。
📋 工具概览

高性能代码智能MCP服务器,可将代码库索引到持久化存储中。支持AST分析和代码智能功能,为Claude Code和Aider等工具提供代码上下文理解能力,适合开发者和AI编程工具集成使用。

代码库内存MCP服务 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

GitHub Stars
⭐ 2.3k
开发语言
C
支持平台
Windows / macOS / Linux
维护状态
持续维护,定期更新
开源协议
MIT
AI 综合评分
8.2 分
工具类型
MCP工具
Forks
257
📖 中文文档
以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

高性能代码智能MCP服务器,可将代码库索引到持久化存储中。支持AST分析和代码智能功能,为Claude Code和Aider等工具提供代码上下文理解能力,适合开发者和AI编程工具集成使用。

代码库内存MCP服务 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

📌 核心特色
  • 通过标准 MCP 协议与 Claude、Cursor 等主流 AI 客户端深度集成
  • 提供结构化工具调用接口,显著降低 AI 集成复杂度
  • 支持 Claude Desktop 和 Claude Code 无缝接入,开箱即用
  • 可与其他 MCP 工具组合叠加,构建完整 AI 工作站
  • 轻量无侵入设计,不影响现有系统架构
🎯 主要使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:通过 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
📋 安装步骤说明
  1. 确认已安装 Node.js(v18 或以上版本)
  2. 打开 Claude Desktop 或 Claude Code 的 MCP 配置文件
  3. 按「交给 Agent 安装 → Claude Desktop」标签中的 JSON 配置填入 mcpServers 字段
  4. 保存配置文件并重启 Claude 客户端
  5. 重启后,在对话中即可使用本工具
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 安装后在 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 生效
📑 README 深度解析 真实文档 完整度 84/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

codebase-memory-mcp

GitHub Release License CI Tests Languages Agents Pure C Platform OpenSSF Scorecard SLSA 3 VirusTotal arXiv

The fastest and most efficient code intelligence engine for AI coding agents. Full-indexes an average repository in milliseconds, the Linux kernel (28M LOC, 75K files) in 3 minutes. Answers structural queries in under 1ms. Ships as a single static binary for macOS, Linux, and Windows — download, run install, done.

High-quality parsing through tree-sitter AST analysis across all 155 languages, enhanced with LSP-style hybrid type resolution for Go, C, C++, and TypeScript / JavaScript / JSX / TSX (more languages coming soon) — producing a persistent knowledge graph of functions, classes, call chains, HTTP routes, and cross-service links. 14 MCP tools. Zero dependencies. Plug and play across 11 coding agents.

Research — The design and benchmarks behind this project are described in the preprint Codebase-Memory: Tree-Sitter-Based Knowledge Graphs for LLM Code Exploration via MCP (arXiv:2603.27277). Evaluated across 31 real-world repositories: 83% answer quality, 10× fewer tokens, 2.1× fewer tool calls vs. file-by-file exploration.
Security & Trust — This tool reads your codebase and writes to your agent configuration files. That is what it is designed to do. If you prefer to audit before running, the full source is here — every release binary is signed, checksummed, and scanned by 70+ antivirus engines. All processing happens 100% locally; your code never leaves your machine. Found a security issue? We want to know — see SECURITY.md. Security is Priority #1 for us.

<p align="center"> <img src="docs/graph-ui-screenshot.png" alt="Graph visualization UI showing the codebase-memory-mcp knowledge graph" width="800"> <br> <em>Built-in 3D graph visualization (UI variant) — explore your knowledge graph at localhost:9749</em> </p>

Features

1. Download the installer

Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1

Uninstall

codebase-memory-mcp uninstall

Removes all agent configs, skills, hooks, and instructions. Does not remove the binary or SQLite databases.

Installation

Setup Scripts

<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 via Claude Code

You: "Install this MCP server: https://github.com/DeusData/codebase-memory-mcp"

Build from Source

<details> <summary>Prerequisites: C compiler + zlib</summary>

RequirementCheckInstall
**C compiler** (gcc or clang)gcc --version or clang --versionmacOS: xcode-select --install, Linux: apt install build-essential
**C++ compiler**g++ --version or clang++ --versionSame as above
**zlib**macOS: included, Linux: apt install zlib1g-dev
**Git**git --versionPre-installed on most systems

</details>

```bash git clone https://github.com/DeusData/codebase-memory-mcp.git cd codebase-memory-mcp scripts/build.sh # standard binary scripts/build.sh --with-ui # with graph visualization

Binary at: build/c/codebase-memory-mcp

```

Quick Start

One-line install (macOS / Linux):

curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash

With graph visualization UI:

curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash -s -- --ui

Windows (PowerShell): ```powershell

Manual MCP Configuration

<details> <summary>If you prefer not to use the install command</summary>

Add to ~/.claude/.mcp.json (global) or project .mcp.json:

{
  "mcpServers": {
    "codebase-memory-mcp": {
      "command": "/path/to/codebase-memory-mcp",
      "args": []
    }
  }
}

Restart your agent. Verify with /mcp — you should see codebase-memory-mcp with 14 tools.

</details>

Configuration

codebase-memory-mcp config list                          # show all settings
codebase-memory-mcp config set auto_index true           # auto-index on session start
codebase-memory-mcp config set auto_index_limit 50000    # max files for auto-index
codebase-memory-mcp config reset auto_index              # reset to default

Environment Variables

VariableDefaultDescription
CBM_CACHE_DIR~/.cache/codebase-memory-mcpOverride the database storage directory. All project indexes and config are stored here.
CBM_DIAGNOSTICSfalseSet to 1 or true to enable periodic diagnostics output to /tmp/cbm-diagnostics-<pid>.json.
CBM_DOWNLOAD_URL*(GitHub releases)*Override the download URL for updates. Used for testing or self-hosted deployments.

```bash

CLI Mode

Every MCP tool can be invoked from the command line:

codebase-memory-mcp cli index_repository '{"repo_path": "/path/to/repo"}'
codebase-memory-mcp cli search_graph '{"name_pattern": ".*Handler.*", "label": "Function"}'
codebase-memory-mcp cli trace_call_path '{"function_name": "Search", "direction": "both"}'
codebase-memory-mcp cli query_graph '{"query": "MATCH (f:Function) RETURN f.name LIMIT 5"}'
codebase-memory-mcp cli list_projects
codebase-memory-mcp cli --raw search_graph '{"label": "Function"}' | jq '.results[].name'

Indexing pipeline

  • 155 vendored tree-sitter grammars compiled into the binary
  • Generic package / module resolution — bare specifiers like @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)
  • Infrastructure-as-code indexing — Dockerfiles, Kubernetes manifests, Kustomize overlays as graph nodes
  • LSP-style hybrid type resolution for Go, C, C++, and TypeScript / JavaScript / JSX / TSX (more languages coming) — clean-room reimplementation of tsserver / typescript-go's type resolution algorithms (parameter binding, return-type inference, generic substitution, JSX component dispatch, JSDoc inference for plain JS files)
  • RAM-first pipeline: LZ4 compression, in-memory SQLite, single dump at end. Memory released after.

Custom File Extensions

Map additional file extensions to supported languages via JSON config files. Useful for framework-specific extensions like .blade.php (Laravel) or .mjs (ES modules).

Per-project (in your repo root):

// .codebase-memory.json
{"extra_extensions": {".blade.php": "php", ".mjs": "javascript"}}

Global (applies to all projects):

// ~/.config/codebase-memory-mcp/config.json  (or $XDG_CONFIG_HOME/...)
{"extra_extensions": {".twig": "html", ".phtml": "php"}}

Project config overrides global for conflicting extensions. Unknown language values are silently skipped. Missing config files are ignored.

Troubleshooting

ProblemFix
/mcp doesn't show the serverCheck .mcp.json path is absolute. Restart agent. Test: echo '{}' \| /path/to/binary should output JSON.
index_repository failsPass absolute path: index_repository(repo_path="/absolute/path")
trace_call_path returns 0 resultsUse search_graph(name_pattern=".*PartialName.*") first to find the exact name.
Queries return wrong project resultsAdd project="name" parameter. Use list_projects to see names.
Binary not found after installAdd to PATH: export PATH="$HOME/.local/bin:$PATH"
UI not loadingEnsure you downloaded the ui variant and ran --ui=true. Check http://localhost:9749.
🇨🇳 中文文档镜像 AI 翻译 2026-05-25
英文原文章节由系统翻译为中文摘要,便于快速理解。完整原文见上方 "📑 README 深度解析"。
📌 简介

codebase-memory-mcp 是一个专为 AI Agent 设计的增强型记忆工具,通过 MCP 协议为 Claude 等智能体提供深度代码库理解能力。它能够构建代码结构的知识图谱,让 AI 能够精准地检索、追踪和理解复杂的项目逻辑,从而显著提升 AI 在大型代码库中的开发协作效率。

⚡ 功能介绍

该项目具备强大的代码语义分析能力,内置了 155 种 tree-sitter 语法解析器,支持多种编程语言的自动索引。它不仅能实现通用的包与模块解析(如 package.json, go.mod, Cargo.toml 等),还提供可视化图谱 UI,帮助开发者直观地查看代码调用链路与结构关系。

🛠 安装步骤(Docker/pip/源码)

本项目支持多种平台的快速安装。macOS 与 Linux 用户可以通过 curl 命令执行一键安装脚本,并支持通过参数开启 graph visualization UI。Windows 用户可以使用 PowerShell 运行提供的 install.ps1 脚本。此外,您也可以通过手动编辑 `.mcp.json` 配置文件来完成 MCP 服务器的部署。

🚀 使用教程

安装完成后,您可以直接在支持 MCP 的 Agent(如 Claude)中使用。对于高级用户,本项目提供了 CLI 模式,允许您直接在命令行中调用 index_repository、search_graph 或 trace_call_path 等工具,实现对代码库的自动化索引与路径追踪。

⚙️ 配置说明(含 MCP / env)

用户可以通过命令行工具进行灵活配置。使用 `codebase-memory-mcp config` 命令可以查看、设置或重置各项参数,例如控制自动索引功能的开关(auto_index)以及设置最大索引文件限制(auto_index_limit)。对于手动配置 MCP 的用户,请确保在 `.mcp.json` 中使用绝对路径指向二进制文件。

🔌 API 说明

本项目提供强大的 CLI 接口,使每一个 MCP tool 都能在终端中独立运行。开发者可以通过命令行传递 JSON 参数来执行复杂的任务,例如使用 `cli index_repository` 进行仓库索引,或使用 `cli trace_call_path` 进行函数调用链路的深度追踪,非常适合集成到自动化工作流中。

🔄 工作流/模块

项目采用先进的 Indexing pipeline,通过内置的 tree-sitter 语法解析器实现对代码的深度扫描。它具备智能的模块解析能力,能够通过扫描 package.json、go.mod、Cargo.toml 等清单文件,自动识别并解析不同语言的依赖关系。此外,支持通过自定义 JSON 配置文件扩展文件后缀映射,以适配框架特定的扩展名。

❓ FAQ 摘要

针对常见问题,若 `/mcp` 命令无法显示服务器,请检查 `.mcp.json` 中的路径是否为绝对路径并重启 Agent。在执行 `index_repository` 时,务必传入绝对路径以避免识别失败。如果 `trace_call_path` 出现异常,建议检查相关函数的解析完整性。

🎯 aiskill88 AI 点评 A 级 2026-05-18

专业的MCP代码智能��务器实现,架构成熟,星标认可度高,持续维护,适合集成到AI编程工具链中。

📚 实用指南(长尾问题)
适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
  • 构建企业知识库 / RAG 检索应用的团队
  • 跨境业务、多语言内容运营团队
最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • 本地部署优先选 GGUF 量化模型,节省显存并保持响应速度
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
  • 显存不足直接 OOM — 优先降低 context 或换更小的量化模型
部署方案
  • Docker:codebase-memory-mcp 提供官方镜像,docker compose up 一键启动
  • CLI:直接 npm install -g / pip install,命令行调用
  • 本地部署:CPU 8GB 起,GPU 推荐 16GB+ 显存
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
codebase-memory-mcp 中文教程codebase-memory-mcp 安装报错怎么办codebase-memory-mcp MCP 配置codebase-memory-mcp Docker 部署codebase-memory-mcp Agent 工作流codebase-memory-mcp 与同类工具对比codebase-memory-mcp 最佳实践codebase-memory-mcp 适合谁用
⚡ 核心功能
👥 适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
  • 构建企业知识库 / RAG 检索应用的团队
  • 跨境业务、多语言内容运营团队
⭐ 最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • 本地部署优先选 GGUF 量化模型,节省显存并保持响应速度
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
  • 显存不足直接 OOM — 优先降低 context 或换更小的量化模型
👥 适合人群
Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师
🎯 使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
⚖️ 优点与不足
✅ 优点
  • +MIT 协议,可免费商用
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • 依赖 Claude 客户端,非 Claude 用户无法使用
  • MCP 协议仍在持续演进,接口可能变更
  • 需要一定的配置步骤
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐
📚 相关教程推荐
📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合
❓ 常见问题 FAQ
主要支持C语言及其他主流语言,具体支持列表见文档。
💡 AI Skill Hub 点评

AI Skill Hub 点评:代码库内存MCP服务 的核心功能完整,质量优秀。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。

⬇️ 获取与下载
⬇ 下载源码 ZIP

✅ MIT 协议 · 可免费商用 · 直接从 aiskill88 服务器下载,无需跳转 GitHub

📚 深入学习 代码库内存MCP服务
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 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
🔗 原始来源
🐙 GitHub 仓库  https://github.com/DeusData/codebase-memory-mcp 🌐 官方网站  https://deusdata.github.io/codebase-memory-mcp/

收录时间:2026-05-14 · 更新时间:2026-05-16 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。