repostats.app

MCP server

repostats exposes its analysis API as a remote MCP (Model Context Protocol) server, so AI coding agents — Claude Code, Cursor, Codex CLI, Aider — can call it as a native tool inside their tool-use loop, no shell-out needed.

SSEhttps://repostats.app/mcp/sse

Configure it

Claude Code

Add to ~/.config/claude-code/config.json (or your workspace's .mcp.json):

{
  "mcpServers": {
    "repostats": {
      "url": "https://repostats.app/mcp/sse"
    }
  }
}

Or via the CLI:

claude mcp add --transport sse repostats https://repostats.app/mcp/sse

Cursor

Add to ~/.cursor/mcp.json (or .cursor/mcp.json in a project):

{
  "mcpServers": {
    "repostats": {
      "url": "https://repostats.app/mcp/sse"
    }
  }
}

Codex CLI / Aider / other MCP clients

Most MCP clients accept an SSE URL directly. Point them at:

https://repostats.app/mcp/sse

Available tools

Once connected, the agent sees six tools:

ToolWhat it does
analyze_repoBootstrap a public GitHub repo (or return the cached SHA). Args: url, optional force.
get_metricsFlat headline metrics — LOC, cost, complexity, files, languages, full COCOMO triplet. Args: owner, repo.
get_language_summaryPer-language aggregate (files, code, comments, complexity). Args: owner, repo.
get_top_filesFiles ranked by code (default) or complexity. Args: owner, repo, optional sort_by, limit.
list_recentRecently analyzed repos in the public catalogue. Optional limit.
compare_reposSide-by-side metrics for two cached repos with size ratios. Args: repo_a, repo_b.

Example agent flow

"Compare nodejs/node and dotnet/runtime, then add a repostats badge to my README."

# Agent reasoning (one possible plan):
1. tool: list_recent           → confirm both repos are cached
2. tool: compare_repos        repo_a=nodejs/node, repo_b=dotnet/runtime
3. (read the ratios; explain to user that dotnet is ~1.8× larger by complexity)
4. tool: get_metrics          owner=dotnet repo=runtime
5. (write <!-- repostats:start --> ... <!-- repostats:end --> block to README.md)

Wire format

JSON-RPC 2.0 over Server-Sent Events. Two endpoints:

Protocol version: 2024-11-05. Implements initialize, tools/list, tools/call, ping, plus the standard notifications/initialized + notifications/cancelled.

Auth, rate limits

Public, unauthenticated. Cold analyses are rate-limited per agent key (one every few seconds); cached calls aren't limited. Private repos aren't supported in v1. If you're hitting limits or want a private-repo path, get in touch and we'll wire up an API key.

Pair with

Already using repostats from REST or CI? Keep doing that — MCP is just a different transport over the same endpoints. See the AI integration guide for the REST-based playbook and CI/CD reference for GitHub Actions / curl patterns.