DocOrbit Documentation
DocOrbit is the local-first documentation intelligence layer designed specifically for AI coding agents (Cursor, Claude Desktop, Claude Code, Windsurf, Zed, Continue, and custom agent SDKs).
Core Philosophy: LLMs do not fail because they cannot reason; they fail because raw web documentation is unversioned, polluted with HTML boilerplate, or formatted as escaped JSON bloat. DocOrbit provides local, version-locked AST contracts in clean Markdown.
System Architecture
DocOrbit operates across 5 deterministic layers:
- Layer 1: Recursive Tree Discovery — Probes
llms.txt, sitemaps, and HTML navigation trees to discover authoritative doc roots and crawl documentation hierarchies. - Layer 2: Multi-Source Normalization — Ingests OpenAPI 3.x, Swagger 2.0, and Markdown, resolving circular
$refschemas into typed endpoints. - Layer 3: AST Slicing & Storage — Slices documentation along header boundaries while preserving atomic code fences inside embedded SQLite FTS5 (WAL mode).
- Layer 4: Version Reconciliation & Lockfiles — Scans 8 ecosystems (npm, cargo, go, pypi, composer, rubygems, pub, maven) and writes bit-for-bit stable
docs.lockfiles. - Layer 5: Closed-Loop AST Verification — Parses agent-generated code with AST extractors to verify methods, parameters, and modern API contracts before saving.
Quickstart (30 Seconds)
DocOrbit requires zero pre-installation. You can launch the MCP server directly using npx:
npx -y docorbit mcp
To initialize documentation for an existing codebase and generate a docs.lock file:
# Inside your project directory
npx -y docorbit init
# Inspect and index external library docs
npx -y docorbit add https://nextjs.org/docs
npx -y docorbit add https://docs.stripe.com
Harness Configuration
DocOrbit integrates with all major coding agents via the standard Model Context Protocol:
1. Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"docorbit": {
"command": "npx",
"args": ["-y", "docorbit", "mcp"]
}
}
}
2. Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"docorbit": {
"command": "npx",
"args": ["-y", "docorbit", "mcp"]
}
}
}
3. Claude Code CLI
Run directly in your terminal:
claude mcp add docorbit -- npx -y docorbit mcp
CLI Command Reference
DocOrbit provides 18 subcommands for managing project documentation, indexing APIs, verifying code, and launching the dashboard:
| Command | Arguments | Description |
|---|---|---|
init [dir] |
Optional target directory | Scans workspace, detects project dependencies across 8 ecosystems, and writes docs.lock. |
update [pkg] |
Optional package name | Updates dependencies in docs.lock with selective or global refresh. |
inspect <url> |
Target documentation URL | Probes target domain for canonical machine-readable sources (llms.txt, openapi, sitemaps). |
discover <url> |
Target domain or URL | Auto-detects documentation root and recursively crawls the entire documentation hierarchy. |
add <url> |
URL or raw source | Discovers, ranks, fetches, normalizes, slices, and stores documentation into local SQLite. |
search "<query>" |
Search query string | Performs deterministic hybrid FTS5 search across documentation chunks (~1.3ms). |
context "<task>" |
Agent task description | Packs relevant documentation context optimized for coding agent token limits. |
api "<query>" |
Endpoint / method query | Searches and inspects structured OpenAPI / Swagger endpoints with schema types. |
examples "<task>" |
Task query | Filters first-class code examples by language, framework, or task. |
pitfalls "<task>" |
Task or library name | Searches explicit warnings, deprecations, breaking changes, and runtime restrictions. |
recipes "<goal>" |
Implementation goal | Deterministically compiles evidence-grounded implementation recipes. |
verify <code/file> |
Source code or file path | Verifies API calls against indexed contracts and detects parameter mismatches/deprecations. |
diff [source] |
Optional source ID | Compares documentation versions and snapshots to detect added, removed, or changed APIs. |
impact [source] |
Optional source ID | Analyzes impact of documentation changes on project workspace source files. |
dashboard |
(alias: ui) |
Launches local zero-dependency web inspection UI and verification playground at http://127.0.0.1:3737. |
export [format] |
Format name | Deterministically exports AGENTS.md, CLAUDE.md, skill.md, llms.txt, or docs-map.md. |
eval |
--simulation flag |
Runs empirical comparative benchmark (DocOrbit vs Context7 vs Firecrawl). |
mcp |
--http [port] flag |
Starts agent-native Model Context Protocol server over stdio or streamable HTTP. |
15 Agent-Native MCP Tools Reference
All 15 DocOrbit MCP tools deliver direct, clean GitHub-flavored Markdown by default in content[0].text, saving 50–60% token overhead compared to escaped JSON wrappers. Programmatic callers can pass format: "json" to receive structured JSON.
1. search_docs
Performs deterministic hybrid search over sliced documentation chunks with SemVer boosting.
| Parameter | Type | Description |
|---|---|---|
query | string (required) | The natural language search query. |
docVersion | string (optional) | Target version filter (e.g. v15, ^16.0.0). |
library | string (optional) | Filter to specific library or package name. |
limit | number (optional) | Maximum chunks to return (default: 5). |
format | string (optional) | "markdown" (default) or "json". |
2. get_doc
Retrieves a complete normalized document page or specific chunk by URL or chunk ID.
| Parameter | Type | Description |
|---|---|---|
url | string (optional) | The URL of the documentation page. |
chunkId | string (optional) | The exact chunk ID to retrieve. |
docVersion | string (optional) | Target documentation version. |
format | string (optional) | "markdown" (default) or "json". |
3. find_api
Inspects structured OpenAPI 3.x and Swagger 2.0 endpoints with exact parameter schemas, HTTP methods, and response models.
| Parameter | Type | Description |
|---|---|---|
endpoint | string (optional) | Path or partial endpoint string (e.g. /v1/checkout/sessions). |
method | string (optional) | HTTP method filter (GET, POST, PUT, DELETE). |
query | string (optional) | Fuzzy search over endpoint summary or operation ID. |
4. find_example
Searches and retrieves verified code snippets filtered by programming language, framework, or task.
| Parameter | Type | Description |
|---|---|---|
task | string (optional) | The coding task (e.g. "webhook verification"). |
language | string (optional) | Language filter (javascript, typescript, python, rust, go). |
framework | string (optional) | Framework filter (nextjs, express, fastapi, django). |
5. find_pitfall
Searches explicit breaking changes, deprecation warnings, server-only restrictions, and runtime rate limit traps.
| Parameter | Type | Description |
|---|---|---|
task | string (optional) | Task or library context. |
kind | string (optional) | "breaking_change", "deprecation", "runtime_trap", "security". |
6. check_api
Verifies generated code against indexed API contracts using an AST parser. Flags invalid paths, wrong methods, deprecated calls, and missing required parameters.
| Parameter | Type | Description |
|---|---|---|
endpoint | string (required) | API endpoint path being called. |
method | string (optional) | HTTP method (default: GET). |
code | string (optional) | Full code snippet to parse via AST. |
docVersion | string (optional) | Target version to verify against. |
7. get_implementation_context
Packs multi-dimensional context (relevant APIs, code examples, pitfalls, and navigation breadcrumbs) within a strict token budget.
| Parameter | Type | Description |
|---|---|---|
task | string (required) | Description of the agent implementation task. |
tokenBudget | number (optional) | Token budget ceiling (default: 2000). |
Additional MCP Tools:
diff_docs— Compares two documentation versions to detect API changes.analyze_impact— Scans local project source files against deprecated APIs.list_sources— Lists all indexed documentation sources and snapshots.ingest_doc— Dynamically indexes external documentation from a URL or raw markdown.get_docs_map— Returns hierarchical document tree with section token counts.get_version— Inspects project workspace dependencies and returns authoritative doc versions.find_recipe— Assembles evidence-grounded implementation recipes.export_agent_context— Exports standardized AGENTS.md, CLAUDE.md, skill.md, or llms.txt.
Supported Ecosystems & SemVer Laddering
DocOrbit scans and reconciles lockfiles across 8 major package managers:
| Ecosystem | Manifest Files | Lockfiles |
|---|---|---|
| npm | package.json | package-lock.json, yarn.lock, pnpm-lock.yaml |
| cargo | Cargo.toml | Cargo.lock |
| go | go.mod | go.sum |
| pypi | pyproject.toml, setup.py | poetry.lock, Pipfile.lock, requirements.txt |
| composer | composer.json | composer.lock |
| pub | pubspec.yaml | pubspec.lock |
| rubygems | Gemfile | Gemfile.lock |
| maven | pom.xml | pom.xml |
Security & Threat Model
DocOrbit enforces strict security boundaries when crawling documentation domains:
- SSRF Protection: Blocks RFC 1918 private IP ranges, loopback addresses (
127.0.0.1), and cloud provider metadata IPs (169.254.169.254). - Untrusted Provenance: All documentation retrieved from third-party websites is tagged with
untrusted: truemetadata to prevent prompt injection attacks. - Local Isolation: All SQLite storage lives inside the local
.docorbit/project directory. No code or telemetry leaves your machine.