npm octocounts-mcpstdioMITupdated 8d ago
GitHub shows language bars. OctoCounts shows the actual line counts.
OctoCounts MCP Server 能做什么?
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
| 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. |
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
| Layer | Tech |
|---|---|
| Backend | Rust · Axum · Tokio · SQLx · Postgres · tokei |
| Frontend | React · TypeScript · Vite · TanStack Query |
| Infra | Docker Compose (dev + prod configs) |
Badges
Drop a live SLOC badge into any README:
<!-- Default branch — full SLOC summary -->
[](https://octocounts.com/github/:owner/:repo)
<!-- Specific branch -->
[](https://octocounts.com/github/:owner/:repo/tree/:branch)
<!-- Specific tag (immutable, cached forever) -->
[](https://octocounts.com/github/:owner/:repo/tree/:tag)
<!-- Specific commit SHA (immutable, cached forever) -->
[](https://octocounts.com/github/:owner/:repo/commit/:sha)
Add ?lang=<language> to any of the above to get a per-language badge instead:
<!-- Lines of code for a single language -->
[](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 |
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
安装
把 OctoCounts MCP Server 添加到你的客户端。选择你正在使用的那个。
claude mcp add octocounts-mcp -- npx -y octocounts-mcpcodex mcp add octocounts-mcp -- npx -y octocounts-mcpamp mcp add octocounts-mcp -- npx -y octocounts-mcp{
"mcpServers": {
"octocounts-mcp": {
"command": "npx",
"args": [
"-y",
"octocounts-mcp"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"octocounts-mcp": {
"command": "npx",
"args": [
"-y",
"octocounts-mcp"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"octocounts-mcp","command":"npx","args":["-y","octocounts-mcp"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"octocounts-mcp": {
"command": "npx",
"args": [
"-y",
"octocounts-mcp"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"octocounts-mcp": {
"command": "npx",
"args": [
"-y",
"octocounts-mcp"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"octocounts-mcp": {
"command": "npx",
"args": [
"-y",
"octocounts-mcp"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"octocounts-mcp": {
"type": "local",
"command": "npx",
"args": [
"-y",
"octocounts-mcp"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"octocounts-mcp": {
"command": {
"path": "npx",
"args": [
"-y",
"octocounts-mcp"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y octocounts-mcpRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
评分
39 / 100
不完整
- 文档25/25
- 维护19/25
- 可信度13/20
- 能力0/15
- 安装体验12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 1 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
版本历史
| 版本 | 发布于 |
|---|---|
| 0.1.1最新 | 2026年8月29日 |