OctoCounts MCP Server

Registre officiel Outils de développement

Analyze and compare public GitHub repo line counts (SLOC) via OctoCounts, from any MCP client.

Que pouvez-vous faire avec OctoCounts MCP Server ?

  • Adds a browser extension card to GitHub repo pages with files, total lines, code, comments, blanks, and language count
  • Provides a web app where you can paste any public GitHub repo URL
  • Resolves any branch, tag, or commit SHA — pins results to an exact commit so the cache is actually meaningful
  • Downloads the GitHub archive tarball instead of cloning (much faster, no git history overhead)
  • Counts files, lines, code, comments, and blanks per language via tokei
  • Caches reports by owner + repo + commit + tokei version — repeat runs are instant
  • Queues analysis jobs so concurrent requests don't bring the server to its knees
  • Exports reports as plain text, JSON, or a shareable PNG card

Installation

Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).

NPM package octocounts-mcp
Claude Code
claude mcp add octocounts-mcp-server -- npx -y octocounts-mcp@0.2.0
Configuration JSON (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "octocounts-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "octocounts-mcp@0.2.0"
            ]
        }
    }
}

Documentation

Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.

Sommaire
  1. OctoCounts – GitHub SLOC Counter
  2. Use OctoCounts
  3. Preview
  4. Why?
  5. What it does
  6. Stack
  7. Badges
  8. API
  9. Running it
  10. Growth report inventory
  11. License

OctoCounts – GitHub SLOC Counter

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.

Use OctoCounts

SurfaceUse it for
Web appAnalyze any public GitHub repository and share a permanent report.
Browser extensionShow SLOC directly inside GitHub's repository sidebar in Chrome, Edge, or Firefox.
Public statsSee aggregate report totals, largest repos, language coverage, and source breakdown.
GitHub ActionComment SLOC changes on pull requests.
CLIRun npx octocounts https://github.com/owner/repo --json.
MCP serverGive agents and developer assistants access to SLOC reports.
README badgesAdd a live SLOC badge that links to a permanent report page.
Launch kitCopy product descriptions, launch posts, links, screenshots, and badges.
ResearchOriginal research: a pilot study on how test/doc/generated file filtering affects SLOC counts.

Preview

Why?

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.

What it does

  • Adds a browser extension card to GitHub repo pages with files, total lines, code, comments, blanks, and language count
  • Provides a web app where you can paste any public GitHub repo URL
  • Resolves any branch, tag, or commit SHA — pins results to an exact commit so the cache is actually meaningful
  • Downloads the GitHub archive tarball instead of cloning (much faster, no git history overhead)
  • Counts files, lines, code, comments, and blanks per language via tokei
  • Caches reports by owner + repo + commit + tokei version — repeat runs are instant
  • Queues analysis jobs so concurrent requests don't bring the server to its knees
  • Exports reports as plain text, JSON, or a shareable PNG card

Stack

LayerTech
BackendRust · Axum · Tokio · SQLx · Postgres · tokei
FrontendReact · TypeScript · Vite · TanStack Query
InfraCloudflare 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)

Badges

Drop a live SLOC badge into any README:


[![SLOC](https://api.octocounts.com/badge/:owner/:repo)](https://octocounts.com/github/:owner/:repo)


[![SLOC](https://api.octocounts.com/badge/:owner/:repo/branch/:branch)](https://octocounts.com/github/:owner/:repo/tree/:branch)


[![SLOC](https://api.octocounts.com/badge/:owner/:repo/tag/:tag)](https://octocounts.com/github/:owner/:repo/tree/:tag)


[![SLOC](https://api.octocounts.com/badge/:owner/:repo/commit/:sha)](https://octocounts.com/github/:owner/:repo/commit/:sha)

Add ?lang=<language> to any of the above to get a per-language badge instead:


[![Rust](https://api.octocounts.com/badge/:owner/:repo?lang=rust)](https://octocounts.com/github/:owner/:repo)
[![Rust](https://api.octocounts.com/badge/:owner/:repo/branch/:branch?lang=rust)](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 behaviourHeader
Default branch / branchs-maxage=3600, stale-while-revalidate=86400
Tag / commitmax-age=31536000, immutable

API

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.

Running it

See how-to-run-and-deploy.md for local development setup, host-native instructions, GitHub token configuration, and production deployment.

Growth report inventory

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.

License

MIT

Questions fréquentes

Qu'est-ce que OctoCounts MCP Server ?

Analyze and compare public GitHub repo line counts (SLOC) via OctoCounts, from any MCP client.

Comment installer OctoCounts MCP Server ?

Il s'exécute sur votre machine. Dans Claude Code : claude mcp add octocounts-mcp-server -- npx -y octocounts-mcp@0.2.0. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.

Faut-il une clé API pour OctoCounts MCP Server ?

Son entrée au registre n'indique aucune clé ni secret obligatoire. Certaines fonctions peuvent tout de même demander un compte auprès du service auquel il se connecte.

OctoCounts MCP Server est-il open source ?

Oui. Son code est sur GitHub sous licence MIT.

Qui maintient OctoCounts MCP Server ?

Il est publié par huanglizhuo. AI.tn le référence sans le maintenir ni le recommander.

Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.