
Repo Explorer

2025.04.11
0
TypeScriptGit 仓库管理代码搜索开发工具开发效率
Repo Explorer 是一个基于 MCP(Model Context Protocol)协议的强大服务器,专门用于无缝探索、搜索和分析 Git 仓库。它提供了仓库管理、高级代码搜索、缓存系统和跨仓库分析等功能,适用于开发者在多个项目中进行代码比较和模式查找的场景。
View on GitHub
Overview
基本能力
产品定位
Repo Explorer 是一个专为开发者设计的工具,旨在提供高效的 Git 仓库管理和代码搜索功能,帮助开发者快速定位和分析代码。
核心功能
- 仓库管理:克隆、更新和管理参考仓库
- 高级代码搜索:快速查找跨多个文件的代码模式
- 缓存系统:高效存储搜索结果以提高性能
- 跨仓库分析:比较多个项目中的代码模式
- 可配置的仓库结构:轻松自定义参考仓库
- 平台无关性:支持 macOS、Linux 和 Windows
适用场景
- 开发者在多个 Git 仓库中查找特定代码模式
- 团队需要管理和分析多个参考仓库
- 需要快速比较不同项目中的代码实现
工具列表
repo_status
:获取所有仓库或特定仓库的状态clone_repo
:克隆特定仓库update_repo
:更新(拉取)特定仓库create_reference_repos
:创建参考仓库结构search_code
:跨仓库搜索代码
常见问题解答
- 如何自定义仓库结构?:编辑
~/.repo-explorer.json
文件,添加或修改仓库类别和仓库信息。 - 如何提高搜索性能?:利用内置的缓存系统,它会自动存储搜索结果和仓库结构信息。
使用教程
使用依赖
- Node.js 18.x 或更高版本
- Git
安装教程
- 克隆仓库:
git clone https://github.com/DocNr/repo-explorer.git
cd repo-explorer
- 安装依赖:
npm install
- 构建项目:
npm run build
- 添加到 MCP 配置(参考文档中的“Setup and Configuration”部分)
调试方式
- 使用
repo_status
工具检查仓库状态:
<use_mcp_tool>
<server_name>repo-explorer</server_name>
<tool_name>repo_status</tool_name>
<arguments>{}</arguments>
</use_mcp_tool>
- 使用
search_code
工具搜索代码:
<use_mcp_tool>
<server_name>repo-explorer</server_name>
<tool_name>search_code</tool_name>
<arguments>
{
"pattern": "function\\s+\\w+\\s*\\(",
"filePattern": "*.js",
"category": "databases",
"repo": "watermelondb",
"maxResults": 30,
"contextLines": 2
}
</arguments>
</use_mcp_tool>