OP

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.

Quick Install
npx -y @X-lab2017/open-digger-mcp-server

Overview

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:

git clone https://github.com/X-lab2017/open-digger-mcp-server.git
cd open-digger-mcp-server/mcp-server
npm install
npm run build
npm start

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):

{
  "mcpServers": {
    "open-digger": {
      "command": "node",
      "args": ["/full/path/to/dist/index.js"],
      "cwd": "/full/path/to/open-digger-mcp-server/mcp-server",
      "env": {
        "CACHE_TTL_SECONDS": "300"
      }
    }
  }
}

Tip: Replace the paths with absolute paths from your system. Use pwd to determine the working directory.

Verify server RPC listing (quick health check):

echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | node dist/index.js

The response should enumerate the available tools.

Available Tools and Prompts

Tools (6)

#Tool namePurpose
1get_open_digger_metricFetch a single metric for a repository
2get_open_digger_metrics_batchRetrieve multiple metrics or batch queries
3compare_repositoriesCompare two or more repositories across metrics
4analyze_trendsCompute growth/decline trends over time
5get_ecosystem_insightsAggregate ecosystem-level analytics and relationships
6server_healthBasic 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

  1. 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.
  2. 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.
  3. 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.
  4. 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:

npm run watch    # development mode with auto-reload
npm run build    # compile TypeScript to dist/
npm run clean    # remove build artifacts
npm run sse:test # run SSE test server

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