# OctoCounts MCP Server

Fetches line counts, comments, and language breakdowns for public GitHub repositories directly inside your coding agent.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 19
- Author: huanglizhuo
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/huanglizhuo/OctoCounts/tree/HEAD/mcp
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/octocounts-mcp-server

## What it 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`.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add octocounts-mcp -- npx -y octocounts-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add mcp -- npx -y octocounts-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp": {
            "command": "npx",
            "args": [
                "-y",
                "octocounts-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "octocounts-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add mcp npx -y octocounts-mcp
```

## When to use it
- 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
- Run `analyze_repo` on `pallets/flask` to inspect total code lines and languages.
- Compare code volume differences between `vuejs/core` and `facebook/react` using `compare_repos`.
- Analyze `tailwindlabs/tailwindcss` while enabling `respect_gitattributes` to drop generated assets.

## Similar
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [GitDiagram](https://affpapa.org/en/nevibecode/mcp/gitdiagram.md) — MCP server · ★ 18446
- [Repowise](https://affpapa.org/en/nevibecode/mcp/repowise.md) — MCP server · ★ 7891
- [sem](https://affpapa.org/en/nevibecode/mcp/sem.md) — MCP server · ★ 3422
- [GitLab MCP Server](https://affpapa.org/en/nevibecode/mcp/gitlab-mcp-server.md) — MCP server · ★ 2065
- [Octocode MCP - AI Context Platform](https://affpapa.org/en/nevibecode/mcp/octocode-mcp-ai-context-platform.md) — MCP server · ★ 955

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
