MCP Catalogs
首页

mcp-codebase-index

by MikeRecognex·51·综合分 47

零依赖的 MCP 服务器,提供 17 个代码库导航工具,具有持久缓存和增量更新功能。

developer-toolsai-llmfile-system
7
Forks
6
活跃 Issue
3 个月前
最近提交
2 天前
收录于

概述

mcp-codebase-index 是一个结构化代码库索引器,将源文件解析为元数据并通过 MCP 提供 18 个查询工具。它支持 Python、TypeScript/JS、Go、Rust 和 C# 文件,在 git 仓库中自动进行增量重新索引。服务器使用持久磁盘缓存来消除冷启动延迟,并能高效处理大型代码库(已在拥有 110 万行代码的 CPython 上测试)。

试试问 AI

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

:在大型代码库中进行 AI 辅助代码导航,无需读取整个文件
:在修改代码前进行依赖影响分析
:查找符号定义和跨文件引用
:理解代码结构和组件间关系
:它如何高效处理大型代码库?
:支持哪些编程语言?

什么时候选它

使用中等至大型Python/TypeScript/Go/Rust/C#代码库的开发者,需要高效的代码导航和影响分析,而不希望为读取整个文件支付token成本。

什么时候不要选它

使用此索引器不支持语言的项目,或者当你需要对代码库进行写访问时(此工具只读)。

此 server 暴露的工具

从 README 抽取出 12 个工具
  • get_project_summary

    Get file count, packages, top classes/functions

  • list_files

    List indexed files with optional glob filter

  • get_structure_summary

    Get structure of a file or the whole project

  • get_functions

    List functions with name, lines, params

  • get_classes

    List classes with name, lines, methods, bases

  • get_imports

    List imports with module, names, line

  • get_function_source

    Get full source of a function/method

  • get_class_source

    Get full source of a class

  • find_symbol

    Find where a symbol is defined (file, line, type)

  • get_dependencies

    Get what a symbol calls/uses

  • get_dependents

    Get what calls/uses a symbol

  • get_change_impact

    Get direct + transitive dependents of a symbol

可对比工具

mcp-symbolsmcp-ctagsmcp-grepmcp-fs

安装

pip install "mcp-codebase-index[mcp]"

**Claude Desktop 配置:** 添加到 claude_desktop_config.json

{
  "mcpServers": {
    "codebase-index": {
      "command": "mcp-codebase-index",
      "env": {
        "PROJECT_ROOT": "/path/to/project"
      }
    }
  }
}

FAQ

它如何高效处理大型代码库?
它使用持久磁盘缓存和基于 git diff 的增量更新,只重新解析已更改的文件(约 1-2 毫秒)。在 CPython(110 万行)上,初始索引构建需要 56 秒,但后续启动时从缓存加载不到 1 秒。
支持哪些编程语言?
Python(AST 解析)、TypeScript/JS、Go、Rust、C#(基于正则表达式)以及 Markdown/Text 文件。其他文件仅提供行数统计。

Hacker News 讨论

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

mcp-codebase-index 对比

GitHub →

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