Skip to main content
Glama

代码库 MCP

模型上下文协议 (MCP)服务器实现,提供使用RepoMix检索和分析整个代码库的工具。

该 MCP 允许 AI 代理(如 Cursor 的 Composer Agent)一次性自动读取和理解整个代码库,使开发人员更容易处理大型代码库,并使 AI 助手更轻松地了解项目的全面背景。

特征

  • 📚代码库检索:以不同格式(XML、Markdown、Plain)检索整个代码库作为单个文本输出

  • 🌐远程存储库支持:直接处理远程 GitHub 存储库

  • 💾文件保存:将处理后的代码库保存到文件中

  • 🔧可定制选项:使用各种选项(注释、行号、文件摘要等)控制代码库的处理方式。

Related MCP server: CodeAlive MCP

安装

来自 NPM(推荐)

# Install the package globally
npm install -g codebase-mcp

# Install RepoMix (required dependency)
codebase-mcp install

来自 GitHub

# Clone the repository
git clone https://github.com/DeDeveloper23/codebase-mcp.git

# Navigate to the project directory
cd codebase-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Install globally
npm install -g .

# Install RepoMix (required dependency)
codebase-mcp install

与 Cursor 集成

要将此 MCP 与 Cursor 的 Composer Agent 一起使用:

  1. 打开游标IDE

  2. 点击侧边栏中的 Composer 图标

  3. 点击顶部的“MCP 服务器”按钮

  4. 点击“添加新的 MCP 服务器”

  5. 填写详细信息:

    • 名称: Codebase MCP (或您喜欢的任何名称)

    • 类型: command

    • 命令: codebase-mcp start

  6. 点击“添加”保存

添加后,MCP 将为 Composer Agent 提供三个强大的工具:

可用工具

  1. 获取代码库

    • 目的:分析您当前的工作空间/项目

    • 使用情况:你希望人工智能理解你的整个代码库

    • 提示示例:“请分析我的代码库以了解其结构”

  2. 获取远程代码库

    • 目的:获取并分析任何公共 GitHub 存储库

    • 使用情况:您想要探索或了解其他项目

    • 示例提示:“您能分析 github.com/username/repo 上的存储库吗?”

  3. 保存代码库

    • 目的:将代码库分析保存到文件中以供日后使用

    • 使用情况:您想要保留代码库快照或共享它

    • 提示示例:“保存此代码库的分析以供稍后查看”

游标中的使用示例

以下是一些可以与 Composer Agent 一起使用的示例提示:

"Analyze my current project and explain its main components."

"Can you look at the tensorflow/tensorflow repository and explain how their testing framework works?"

"Save an analysis of my project to 'codebase-analysis.md' in markdown format."

Composer Agent 将根据您的请求自动使用适当的工具。

游标外使用

启动 MCP 服务器

codebase-mcp start

这将以 stdio 模式启动 MCP 服务器,任何与 MCP 兼容的客户端都可以使用它。

执照

麻省理工学院

Available Tools

3 tools
getCodebaseC

Retrieve the entire codebase as a single text output using RepoMix

Inputs: cwd, format, ignorePatterns, includeDirectoryStructure, +5 more.

getRemoteCodebaseC

Retrieve a remote repository's codebase as a single text output using RepoMix

Inputs: repo (required), format, ignorePatterns, includeDirectoryStructure, +5 more.

saveCodebaseC

Save the codebase to a file using RepoMix

Inputs: cwd, format, ignorePatterns, includeDirectoryStructure, +6 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 3 tools

    Disambiguation4/5

    The three tools have distinct purposes: retrieving local codebase, retrieving remote codebase, and saving codebase. While 'getCodebase' and 'getRemoteCodebase' both retrieve code, the local/remote distinction is clear. There's minor potential confusion about whether 'saveCodebase' saves the local or remote version, but overall boundaries are well-defined.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with camelCase styling: getCodebase, getRemoteCodebase, saveCodebase. The naming is predictable and follows the same grammatical structure throughout, making it easy for agents to understand the action-object relationship.

    Tool Count3/5

    With only 3 tools, this feels quite minimal for a 'Codebase MCP' server. While the tools cover basic retrieval and saving operations, the scope seems limited - there are no tools for searching, analyzing, modifying, or managing codebase components. The count is borderline thin for what could be expected from a codebase management system.

    Completeness2/5

    For a codebase management server, there are significant gaps in functionality. The tools only provide retrieval and saving operations using RepoMix, but lack any tools for code analysis, search, modification, version control operations, or component management. This creates a dead-end surface where agents can only get and save entire codebases without any ability to work with code meaningfully.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      A Model Context Protocol server that enhances AI agents by providing deep semantic understanding of codebases, enabling more intelligent interactions through advanced code search and contextual awareness.
      91
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An enterprise-grade Model Context Protocol server that provides comprehensive GitHub repository analysis and AI-powered development assistance through 11 streamlined tools.
      11
      2
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server that enables AI applications to access and analyze local code repositories without manual uploads, providing file listing, content reading, code searching, and project structure analysis capabilities.
      7
      MIT