
dedeveloper23/codebase-mcp 是从 https://github.com/dedeveloper23/codebase-mcp. 导入的 MCP 服务器候选
概览
dedeveloper23/codebase-mcp 是从 https://github.com/dedeveloper23/codebase-mcp. 导入的 MCP 服务器候选
概述(AI 翻译)
一个模型上下文协议(MCP)服务器实现,提供利用 RepoMix 检索和分析整个代码库的工具。
该MCP允许像Cursor的Composer Agent这样的AI代理一次性自动读取和理解整个代码库,使开发者更容易处理大型代码库,也让AI助手能够全面了解项目的上下文。
特色
- 📚 代码库检索:以不同格式(XML、Markdown、Plain)检索整个代码库,作为单一文本输出
- 🌐 远程仓库支持:直接处理远程 GitHub 仓库
- 💾 文件保存:将处理后的代码库保存到文件中
- 🔧 可自定义选项:通过各种选项(注释、行号、文件摘要等)控制代码库的处理方式
安装
来自NPM(推荐)
来自GitHub
与光标的集成
要通过光标的作曲代理使用该MCP:
- 打开光标IDE
- 点击侧边栏中的作曲家图标
- 点击顶部的“MCP 服务器”按钮
- 点击“添加新的MCP服务器”
- 填写详细信息:
- 姓名:
Codebase MCP(或你喜欢的任何名字) - 类型:
command - 指令:
codebase-mcp start
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Codebase MCP
A Model Context Protocol (MCP) server implementation that provides tools to retrieve and analyze entire codebases using RepoMix.
This MCP allows AI Agents like Cursor’s Composer Agent to automatically read and understand entire codebases at once, making it easier for developers to work with large codebases and for AI assistants to have comprehensive context of a project.
Features
- 📚 Codebase Retrieval: Retrieve the entire codebase as a single text output in different formats (XML, Markdown, Plain)
- 🌐 Remote Repository Support: Process remote GitHub repositories directly
- 💾 File Saving: Save the processed codebase to a file
- 🔧 Customizable Options: Control how the codebase is processed with various options (comments, line numbers, file summaries, etc.)
Installation
From NPM (Recommended)
# Install the package globally
npm install -g codebase-mcp
# Install RepoMix (required dependency)
codebase-mcp install
From 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
Integration with Cursor
To use this MCP with Cursor’s Composer Agent:
- Open Cursor IDE
- Click the Composer icon in the sidebar
- Click the “MCP Servers” button at the top
- Click “Add new MCP server”
- Fill in the details:
- Name:
Codebase MCP(or any name you prefer) - Type:
command - Command:
codebase-mcp start
- Name:
- Click “Add” to save
Once added, the MCP will provide three powerful tools to the Composer Agent:
Available Tools
-
getCodebase
- Purpose: Analyzes your current workspace/project
- Use when: You want the AI to understand your entire codebase
- Example prompt: “Please analyze my codebase to understand its structure”
-
getRemoteCodebase
- Purpose: Fetches and analyzes any public GitHub repository
- Use when: You want to explore or understand other projects
- Example prompt: “Can you analyze the repository at github.com/username/repo?”
-
saveCodebase
- Purpose: Saves the codebase analysis to a file for later use
- Use when: You want to preserve the codebase snapshot or share it
- Example prompt: “Save an analysis of this codebase to review later”
Example Usage in Cursor
Here are some example prompts you can use with the 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."
The Composer Agent will automatically use the appropriate tool based on your request.
Usage Outside Cursor
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →