OctoCounts MCP Server — Claude Code MCP server: guide
Fetches line counts, comments, and language breakdowns for public GitHub repositories directly inside your coding agent.
claude mcp add octocounts-mcp -- npx -y octocounts-mcpWhat OctoCounts MCP Server does
The server provides two tools: analyze_repo and compare_repos. It breaks down codebases into physical lines, pure source, comment blocks, blank rows, and languages. You can also evaluate net volume differences between two repositories or git references.
Communication uses standard input and output with framed JSON-RPC messages. The optional respect_gitattributes flag discards generated files and vendored dependencies. A five-minute deadline bounds analysis jobs, which rely on safe retries and long-polling.
Cancelling a client request halts the local wait, though remote processing still finishes under its assigned job identifier. The server targets https://api.octocounts.com unless overridden by OCTOCOUNTS_API_BASE.
What it helps with
- count lines of source code and comments across a public repository
- measure net codebase differences between two branches or projects
- filter out vendored libraries and generated files using
.gitattributes - inspect language distributions before adopting an open source dependency
Example prompts for the agent
- Run
analyze_repoonpallets/flaskto inspect total code lines and languages. - Compare code volume differences between
vuejs/coreandfacebook/reactusingcompare_repos. - Analyze
tailwindlabs/tailwindcsswhile enablingrespect_gitattributesto drop generated assets.
How to install OctoCounts MCP Server
Platform CLI
claude mcp add octocounts-mcp -- npx -y octocounts-mcpPlatform CLI
codex mcp add mcp -- npx -y octocounts-mcpConfig file
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"octocounts-mcp"
]
}
}
}Config file
{
"servers": {
"mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"octocounts-mcp"
]
}
}
}Platform CLI
gemini mcp add mcp npx -y octocounts-mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about OctoCounts MCP Server
How do I install OctoCounts MCP Server in Claude Code?
Run claude mcp add octocounts-mcp -- npx -y octocounts-mcp.
What does OctoCounts MCP Server do?
It lets MCP clients inspect public GitHub repositories to retrieve SLOC metrics, comment totals, blank line counts, and cross-repo comparisons.
Can OctoCounts ignore generated or vendored code?
Yes, passing respect_gitattributes set to true tells the analyzer to omit files designated as generated or vendored in the target repository.