API & MCP
Everything a person can do on Codeharbor Repo Digest, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://codeharborrepodigest.usefulweb.app/api/v1/calculate– run Codeharbor Repo DigestGET https://codeharborrepodigest.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Codeharbor Repo Digest
Give a public GitHub address or upload a repository as ZIP or .tar.gz and get one text with the directory tree and every selected file under its path, with a token estimate. Filters leave out vendored code, lock files, binaries and large files; secret files such as .env are never included and obvious tokens are masked.
| Field | Type | Default | Description |
|---|---|---|---|
repoUrl | text | — | Public GitHub repository. An address like https://github.com/owner/repo, …/tree/<branch>/<folder> or owner/repo. Private repositories cannot be opened. |
archive | file | — | Or upload the repository (.zip, .tar.gz). Used instead of the address when given, e.g. GitHub’s “Download ZIP”. Works without GitHub. |
folder | text | — | Only this folder (optional). e.g. packages/core — leave empty for the whole repository. |
include | textarea | — | Include only (optional). Glob patterns, one per line or comma-separated, e.g. src/**/*.ts, *.md. |
exclude | textarea | — | Leave out (optional). Glob patterns, e.g. tests/, *.snap, docs/**. |
maxFileKb | number | 200 | Largest file to include (KB) |
skipVendor | boolean | true | Skip vendored code and build output (node_modules, vendor, dist …) |
skipLockfiles | boolean | true | Skip lock files (package-lock.json, poetry.lock …) |
maxTokens | number | 200000 | Token budget. Files are added by priority (README, manifests, source, docs, tests) until the estimate reaches this. |
format | select (markdown, plain) | "markdown" | Layout |
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://codeharborrepodigest.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
codeharbor_repo_digest - Local stdio connector:
node src/mcp-stdio.ts --tool=codeharbor-repo-digest
{
"mcpServers": {
"codeharbor-repo-digest": { "type": "http", "url": "https://codeharborrepodigest.usefulweb.app/mcp" }
}
}