Analyze and compare public GitHub repo line counts (SLOC) via OctoCounts, from any MCP client.
GitHub shows language bars. OctoCounts shows the actual line counts.
GitHub's sidebar shows language percentages, but misses actual file and line counts. OctoCounts adds this missing SLOC (Source Lines of Code) view to public repos without cloning.
Install the extension for instant stats directly on GitHub, or use the web app for public GitHub repositories. It downloads the repo archive, runs tokei, and caches the results—delivering a breakdown faster than git clone.
| Surface | Use it for |
|---|---|
| Web app | Analyze any public GitHub repository and share a permanent report. |
| Browser extension | Show SLOC directly inside GitHub's repository sidebar in Chrome, Edge, or Firefox. |
| Public stats | See aggregate report totals, largest repos, language coverage, and source breakdown. |
| GitHub Action | Comment SLOC changes on pull requests. |
| CLI | Run npx octocounts https://github.com/owner/repo --json. |
| MCP server | Give agents and developer assistants access to SLOC reports. |
| README badges | Add a live SLOC badge that links to a permanent report page. |
| Launch kit | Copy product descriptions, launch posts, links, screenshots, and badges. |
| Research | Original research: a pilot study on how test/doc/generated file filtering affects SLOC counts. |
Sometimes you just want to know whether a repo is 2k lines, 200k lines, or a weekend-devouring monolith. GitHub already has the repo, the language stats, and the sidebar. OctoCounts fills in the missing numbers.
owner + repo + commit + tokei version — repeat runs are instant| Layer | Tech |
|---|---|
| Backend | Rust · Axum · Tokio · SQLx · Postgres · tokei |
| Frontend | React · TypeScript · Vite · TanStack Query |
| Infra | Cloudflare Pages (Pages Functions SSR) · GHCR image + sloc-infra dual VPS (VPS-A/VPS-B) + Cloudflare Tunnel · Postgres on VPS-B (Neon frozen snapshot as fallback) · Docker Compose (local dev only) |
Drop a live SLOC badge into any README:
[](https://octocounts.com/github/:owner/:repo)
[](https://octocounts.com/github/:owner/:repo/tree/:branch)
[](https://octocounts.com/github/:owner/:repo/tree/:tag)
[](https://octocounts.com/github/:owner/:repo/commit/:sha)
Add ?lang=<language> to any of the above to get a per-language badge instead:
[](https://octocounts.com/github/:owner/:repo)
[](https://octocounts.com/github/:owner/:repo/tree/:branch)
Language names are case-insensitive (rust, Rust, and RUST all work). If a language is not found in the report the badge shows —. While a fresh analysis is running the badge shows ··· — most badge CDNs will retry automatically.
| Cache behaviour | Header |
|---|---|
| Default branch / branch | s-maxage=3600, stale-while-revalidate=86400 |
| Tag / commit | max-age=31536000, immutable |
POST /api/analyze { "repoUrl": "...", "refName": "main" }
GET /api/jobs/:id
GET /api/reports/:id
GET /api/stats
GET /badge/:owner/:repo
GET /badge/:owner/:repo/branch/:branch
GET /badge/:owner/:repo/tag/:tag
GET /badge/:owner/:repo/commit/:sha
All badge routes accept an optional ?lang=<language> query parameter that switches the response from the full SLOC summary badge to a per-language shields.io-style badge.
See how-to-run-and-deploy.md for local development setup, host-native instructions, GitHub token configuration, and production deployment.
Popular public repositories are listed in data/popular-repos.txt. The scheduled workflow seed-popular-repos.yml refreshes that curated inventory weekly.
refresh-github-trending.yml discovers GitHub's daily Trending repositories, validates and publishes the current snapshot to /trending, and pre-generates their stable /github/:owner/:repo SLOC reports. Trending provenance stays separate from real /popular access counts; no date-stamped archive pages are generated.
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y octocounts-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-huanglizhuo-octocounts-mcp": {
"command": "npx",
"args": [
"-y",
"octocounts-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceoctocounts-mcpnpmOctoCounts MCP Server works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.