mcpField
O
OctoCounts MCP Server

OctoCounts MCP Server

Local
octocounts.comDeveloper Tools20Updated today

About OctoCounts MCP Server

OctoCounts MCP Server exposes SLOC analysis for public GitHub repositories to AI coding tools and other MCP clients. It can analyze a repository or compare repositories and refs, with optional handling for generated and vendored files.

Key features

  1. 01Count files, lines, code, and comments
  2. 02Report language breakdowns
  3. 03Compare repositories or refs
  4. 04Optionally respect .gitattributes
  5. 05Provide report links tied to commits

Use cases

  1. 01Inspect the size and language mix of a public repository
  2. 02Compare SLOC between two repositories
  3. 03Compare repository refs while excluding declared generated files

MCP support

The MCP server exposes OctoCounts repository analysis and comparison through the `analyze_repo` and `compare_repos` tools. It communicates over stdio using framed JSON-RPC messages.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"huanglizhuo-octocounts": {
"command": "npx",
"args": [
"-y",
"octocounts-mcp"
]
}
}
}
Run commandnpx -y octocounts-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmoctocounts-mcp0.2.0

Tools

2

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
refstringNoOptional branch, tag, or commit SHA.
repo_urlstringYesGitHub URL or owner/repo.

Details

From the project README

OctoCounts MCP Server

Expose OctoCounts SLOC reports to AI coding tools (Claude, Cursor, and any MCP client).

Tools:

  • analyze_repo: count files, lines, code, comments, blanks, and languages for a public GitHub repo.
  • compare_repos: compare two public GitHub repos or refs.

Usage

Run via npx (no install needed):

{
  "mcpServers": {
    "octocounts": {
      "command": "npx",
      "args": ["-y", "octocounts-mcp"]
    }
  }
}

Or from a local checkout:

{
  "mcpServers": {
    "octocounts": {
      "command": "node",
      "args": ["/absolute/path/to/OctoCounts/mcp/src/index.js"],
      "env": {
        "OCTOCOUNTS_API_BASE": "https://api.octocounts.com"
      }
    }
  }
}

OCTOCOUNTS_API_BASE defaults to https://api.octocounts.com.

Local protocol smoke test:

node mcp/src/index.js

The server speaks MCP over stdio with Content-Length framed JSON-RPC messages.

License

MIT

Reliable analyses and repository declarations

Both tools accept optional boolean respect_gitattributes (default false). Enabling it excludes repository-declared generated and vendored files under the canonical profile. Compare output includes counting_policy_compatibility: same, different or unknown, and explains that deltas are net size changes. Report links pin saved IDs and commit SHAs.

Analysis requests use bounded safe retries, long-polling and a five-minute total deadline. Errors retain job IDs and recovery URLs. Stdio clients may send notifications/cancelled with the original requestId; HTTP requests cancel their waits when disconnected. Cancellation stops client waiting; accepted backend jobs can still finish and be recovered. Saved records can expire from the cache.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.