OpenDigger MCP Server for Repository Analytics and Insights
Unlock repository insights with the OpenDigger MCP server using tools and prompts for advanced analytics and smarter decision-making.
npx -y @X-lab2017/open-digger-mcp-serverOverview
OpenDigger MCP Server implements the Model Context Protocol (MCP) to expose OpenDigger repository analytics as a set of callable tools and prompts. It turns OpenDigger’s metrics and analyses into an MCP-compatible service you can run locally and connect to MCP-aware IDEs or clients (for example Cursor AI, VS Code MCP clients, or the MCP Inspector). The server is useful when you want programmable access to repository health, trend analysis, ecosystem insights, and multi-repository comparisons without repeatedly writing ingestion or aggregation code.
By running the MCP server, developers and analytic workflows can request metrics (single or batch), run predefined prompts that synthesize reports, and use lightweight diagnostic endpoints. The server supports caching, optional SSE for event streaming, and an extendable tool set so teams can embed repository intelligence into development environments, CI scripts, or research notebooks.
Features
- MCP-compatible server exposing repository analytics as tools and prompts
- Six built-in tools for metric retrieval, comparisons, trends and system health
- Three high-level prompts that generate synthesized reports (repo health, comparisons, developer activity)
- Core, extended, and additional metrics (opensource activity, maintainer and contributor indicators)
- Simple local deployment with Node.js, optional SSE support, and cache TTL configuration
- Integration guidance for Cursor AI and other MCP clients
Installation / Configuration
Prerequisites: Node.js (14+ recommended)
Clone and build:
Expected terminal output:
OpenDigger MCP Server running (on stdio)...
Environment configuration (.env):
# Recommended cache TTL (seconds)
CACHE_TTL_SECONDS=300
# Optional SSE (Server-Sent Events) config
SSE_PORT=3001
SSE_HOST=127.0.0.1
Cursor MCP configuration (.cursor/mcp.json):
Tip: Replace the paths with absolute paths from your system. Use pwd to determine the working directory.
Verify server RPC listing (quick health check):
|
The response should enumerate the available tools.
Available Tools and Prompts
Tools (6)
| # | Tool name | Purpose |
|---|---|---|
| 1 | get_open_digger_metric | Fetch a single metric for a repository |
| 2 | get_open_digger_metrics_batch | Retrieve multiple metrics or batch queries |
| 3 | compare_repositories | Compare two or more repositories across metrics |
| 4 | analyze_trends | Compute growth/decline trends over time |
| 5 | get_ecosystem_insights | Aggregate ecosystem-level analytics and relationships |
| 6 | server_health | Basic diagnostics and health status (Beta) |
Prompts (3)
- repo_health_analysis — generate a synthesized repository health report (activity, bus factor, maintainability indicators)
- repo_comparison — narrative comparison of repositories with highlights and recommendations
- developer_insights — summarize contributor activity, churn, and collaboration patterns
Metrics exposed (examples)
- Core: openrank, stars, forks, contributors, participants, commits, activity
- Extended: bus_factor, releases, inactive_contributors, maintainer_count
- Additional: pull_requests_merged, issue_response_time, code_change_lines, developer_network
Use Cases
Repository comparison for prioritization
- Scenario: Decide which open-source dependency to adopt.
- Action: Call compare_repositories for candidate repositories (e.g., microsoft/vscode vs. atom/atom) and inspect differences in activity, bus factor, and maintenance indicators.
Periodic health reporting
- Scenario: Weekly triage report for a large project.
- Action: Run repo_health_analysis via the prompt to produce a concise report covering open issues, PR throughput, contributor activity, and maintenance warnings.
Trend analysis for capacity planning
- Scenario: Forecast contributor growth or decline.
- Action: Use analyze_trends on a metric (contributors, commits) over a 12–24 month window to identify growth trajectories and potential staffing or community engagement needs.
Integrating insights into your IDE
- Scenario: Show repository health inside Cursor AI during code review.
- Action: Configure .cursor/mcp.json to register the MCP server; enable the server in Cursor to access the tools and prompts directly from the IDE.
Development & Troubleshooting
Common development commands:
If the server does not appear in an MCP client:
- Confirm absolute paths in .cursor/mcp.json
- Restart the client (Cursor/VS Code) to reload MCP servers
- Ensure dist/index.js is executable: chmod +x dist/index.js
- Rebuild if dependencies or TypeScript emits fail: npm run clean && npm install && npm run build
Contributing & License
Contributions are welcome via the usual fork-branch-PR workflow. The project is licensed under Apache-2.0 — see the LICENSE file in the repository for details.
Repository: https://github.com/X-lab2017/open-digger-mcp-server