关于 OpenDigger MCP Server
OpenDigger MCP Server 通过 MCP 工具和提示词提供代码仓库分析功能,可用于查看指标、比较项目,以及分析趋势和开发者活动。
主要功能
- 01获取单项及批量指标
- 02比较代码仓库
- 03分析指标趋势
- 04获取生态洞察
- 05生成健康度与开发者分析
适用场景
- 01比较不同项目的仓库指标
- 02通过提示词检查仓库健康状况
- 03跟踪贡献者随时间的增长
- 04分析开发者活动与贡献
MCP 相关
该 MCP 服务提供六种代码仓库分析工具和三个提示词,涵盖指标查询、仓库比较、趋势分析和健康状况分析。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
OpenDigger MCP 服务
一个用于 OpenDigger 的模型上下文协议(MCP)服务,可通过工具和提示词提供高级仓库分析与洞察。
快速开始
# Setup
git clone https://github.com/X-lab2017/open-digger-mcp-server.git
# (Optional) Ensure you're on the master branch
git checkout master
cd open-digger-mcp-server && cd mcp-server
npm install
npm run build
# Start server
npm start
重要
别忘了配置 Cursor(更新 .cursor/mcp.json 中的路径)
预期输出:
OpenDigger MCP Server running (on stdio)...
重要
如果你使用的是 Cursor AI IDE,应该会在左下角看到 MCP 服务(open-digger-mcp)提示。你需要将其_启用_,然后即可开始使用 MCP 服务提供的工具和提示词。若要验证,请打开 Cursor Settings 并查看 MCP Servers 部分 → 你应该能看到其中列出了open-digger-mcp。

若要进一步确认服务是否正常运行,可以查看 Cursor 中的以下状态指示:
- ✅ “open-digger-mcp”标题旁的绿色圆点
- ✅ 服务状态中显示**“6 tools”**
- ✅ 服务状态中显示**“3 prompts”**
- ✅ 没有错误消息或红色指示标记
提示
有关不同 IDE 的详细安装说明和配置选项,请参阅
Installation.md。
功能
工具(共 6 个)
| No. | Tool | Description |
|---|---|---|
| 1 | get_open_digger_metric | 获取单个仓库的指标 |
| 2 | get_open_digger_metrics_batch | 批量处理多个指标 |
| 3 | compare_repositories | 多仓库对比分析 |
| 4 | analyze_trends | 分析不同时间段内的增长趋势 |
| 5 | get_ecosystem_insights | 生态系统分析与洞察 |
| 6 | server_health | 系统诊断和运行状况监控(Beta) |
提示词(共 3 个)
repo_health_analysis- 全面的仓库健康状况报告repo_comparison- 仓库竞争分析developer_insights- 开发者活动与贡献分析
指标
-
核心指标:
openrank、stars、forks、contributors、participants、issues_new、issues_closed、pull_requests、commits、activity -
扩展指标:
technical_fork、bus_factor、releases、inactive_contributors、maintainer_count、community_activity -
其他指标:
change_requests、pull_requests_accepted、pull_requests_merged、issue_comments、issue_response_time、code_change_lines、developer_network
💡 使用示例
💠 仓库对比
Compare microsoft/vscode and facebook/react using the compare_repositories tool
💠 健康状况分析
Generate a health report for microsoft/vscode using the repo_health_analysis prompt
💠 趋势分析
Analyze the growth trends for contributors in microsoft/vscode over 2 years
服务状态检查
启动服务后,请验证其是否正常运行:
# In a new terminal
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | node dist/index.js
预期响应应列出全部 6 个工具。
配置
环境变量(.env)
# Cache configuration (recommended)
CACHE_TTL_SECONDS=300
# Optional SSE server
SSE_PORT=3001
SSE_HOST=127.0.0.1
Cursor MCP(.cursor/mcp.json)
{
"mcpServers": {
"open-digger": {
"command": "node",
"args": ["/full/path/to/dist/index.js"],
"cwd": "/full/path/to/project",
"env": {
"CACHE_TTL_SECONDS": "300"
}
}
}
}
提示
将
/full/path/to/open-digger-mcp-server替换为你的实际项目目录路径。使用pwd获取当前目录路径。
开发
npm run watch # Development mode
npm run build # Compile TypeScript
npm run clean # Clean build files
npm run sse:test # Test SSE server
提示
除了 Cursor,你还可以使用其他 MCP 客户端,例如 VS Code、Claude Chat 或官方的 MCP Inspector。
故障排除
常见问题
服务器未在 Cursor 中显示:
- 验证
.cursor/mcp.json中的绝对路径 - 完全重启 Cursor(Cmd+Q / Alt+F4)
- 在 MCP 设置部分检查错误消息
权限错误:
chmod +x dist/index.js
构建错误:
npm run clean
npm install
npm run build
缓存问题:
# Clear npm cache
npm cache clean --force
# Rebuild
npm run clean && npm run build
贡献
- Fork 此仓库
- 创建功能分支(
git checkout -b feature/amazing-feature) - 提交更改(
git commit -m 'Add amazing feature') - 将更改推送到分支(
git push origin feature/amazing-feature) - 发起 Pull Request
许可证
Apache-2.0 许可证,详情请参阅 LICENSE 文件。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。