OctoCounts MCP Server
v0.2.0Analyze and compare public GitHub repo line counts (SLOC) via OctoCounts, from any MCP client.
Expose OctoCounts SLOC reports to AI coding tools (Claude, Cursor, and any MCP client). OCTOCOUNTS_API_BASE defaults to https://api.octocounts.com. The server speaks MCP over stdio with newline-delimited JSON-RPC messages (one JSON object per line).
Summary extracted from the README.
OctoCounts MCP Server
Expose OctoCounts SLOC reports to AI coding tools (Claude, Cursor, and any MCP client).
Tools:
analyze_repo: count files, lines, code, comments, blanks, and languages for a public GitHub repo.compare_repos: compare two public GitHub repos or refs.
Usage
Run via npx (no install needed):
{
"mcpServers": {
"octocounts": {
"command": "npx",
"args": ["-y", "octocounts-mcp"]
}
}
}
Or from a local checkout:
{
"mcpServers": {
"octocounts": {
"command": "node",
"args": ["/absolute/path/to/OctoCounts/mcp/src/index.js"],
"env": {
"OCTOCOUNTS_API_BASE": "https://api.octocounts.com"
}
}
}
}
OCTOCOUNTS_API_BASE defaults to https://api.octocounts.com.
Local protocol smoke test:
node mcp/src/index.js
The server speaks MCP over stdio with newline-delimited JSON-RPC messages (one JSON object per line).
License
MIT
Reliable analyses and repository declarations
Both tools accept optional boolean respect_gitattributes (default false). Enabling it excludes repository-declared generated and vendored files under the canonical profile. Compare output includes counting_policy_compatibility: same, different or unknown, and explains that deltas are net size changes. Report links pin saved IDs and commit SHAs.
Analysis requests use bounded safe retries, long-polling and a five-minute total deadline. Errors retain job IDs and recovery URLs. Stdio clients may send notifications/cancelled with the original requestId; HTTP requests cancel their waits when disconnected. Cancellation stops client waiting; accepted backend jobs can still finish and be recovered. Saved records can expire from the cache.