MCP Catalogs
首页codebase-memory-mcp screenshot

codebase-memory-mcp

by DeusData·2,363·综合分 58

高性能代码智能 MCP 服务器,将代码库索引为持久化知识图谱,支持亚毫秒查询和 155 种语言。

developer-toolsknowledge-graphai-llm
261
Forks
101
活跃 Issue
本月
最近提交
2 天前
收录于

概述

codebase-memory-mcp 是一款前沿的代码智能工具,通过先进的 tree-sitter AST 分析将代码库转换为结构化知识图谱。其卓越的索引速度尤为突出——能够在 3 分钟内处理 Linux 内核(2800 万行代码,7.5 万文件),并提供 14 个 MCP 工具进行全面的代码探索。该服务器通过单个静态二进制文件实现零依赖操作,支持多平台,并在本地 9749 端口提供内置 3D 图形可视化界面。其研究方法证明了显著的效率提升,相比传统的逐文件探索方式,减少 10 倍的令牌使用和 2.1 倍的工具调用。

试试问 AI

装完之后,这里有 8 个你可以让 AI 做的事:

:大型代码库架构分析和文档生成
:重构前的代码影响评估
:微服务中跨服务依赖映射
:死代码检测和优化
:在整个代码库中进行语义代码搜索
:支持哪些编程语言?
:如何处理大型代码库?
:安全性如何保障?

什么时候选它

选择此方案适用于需要跨多种语言进行快速结构化分析的大型代码库,要求本地处理和最小令牌使用。

什么时候不要选它

如果您需要向代码库写入数据,或偏好基于云的解决方案,请不要选择此工具,因为它只提供只读索引功能。

此 server 暴露的工具

从 README 抽取出 12 个工具
  • get_architecture

    Returns languages, packages, entry points, routes, hotspots, boundaries, layers, and clusters

  • manage_adr

    Persists architectural decisions across sessions

  • detect_changes

    Maps uncommitted changes to affected symbols with risk classification

  • semantic_query

    Vector search across the entire graph using embedded code embeddings

  • search_graph

    Searches the graph with regex patterns, filters, and degree constraints

  • search_code

    Graph-augmented grep over indexed files only

  • trace_call_path

    Resolves function calls across files and packages

  • detect_dead_code

    Finds functions with zero callers, excluding entry points

  • index_repository

    Indexes the current repository into the knowledge graph

  • get_cross_repo_links

    Shows links between nodes across multiple indexed repositories

  • find_http_routes

    Finds HTTP routes and their implementations in the codebase

  • find_channels

    Detects pub-sub patterns across services and modules

可对比工具

semantic-code-search-mcpcode-search-mcptree-sitter-lspsemantic-code-search

安装

快速开始

**一键安装**(macOS / Linux):

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

**Windows** (PowerShell):

# 1. 下载安装程序
Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1

# 2.(可选但推荐)检查脚本
notepad install.ps1

# 3. 运行它
.\install.ps1
Claude Desktop 配置
  1. 添加到 Claude Desktop 配置文件:
{
  "mcpServers": {
    "codebase-memory": {
      "command": "codebase-memory-mcp",
      "args": []
    }
  }
}
  1. 重启 Claude Desktop
  2. 说"索引这个项目"开始

FAQ

支持哪些编程语言?
codebase-memory-mcp 通过编译到二进制文件中的 155 种语言的 tree-sitter 语法分析器支持这些语言。它为 Go、C、C++ 和 TypeScript/JavaScript 提供增强的 LSP 风格类型解析。
如何处理大型代码库?
它使用基于 RAM 的流水线,采用 LZ4 压缩和内存中 SQLite,在 3 分钟内处理 Linux 内核(2800 万行代码)。索引后内存会释放,并包含用于变更检测的自动同步功能。
安全性如何保障?
非常安全 - 所有处理都在本地 100% 完成,无需外部 API 调用。每个发布版本都经过签名、校验和,并由 70 多种防病毒引擎扫描。完整源代码可供审核。

Hacker News 讨论

开发者社区最近的相关讨论。

codebase-memory-mcp 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。