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:

  1. Layer 1: Recursive Tree Discovery — Probes llms.txt, sitemaps, and HTML navigation trees to discover authoritative doc roots and crawl documentation hierarchies.
  2. Layer 2: Multi-Source Normalization — Ingests OpenAPI 3.x, Swagger 2.0, and Markdown, resolving circular $ref schemas into typed endpoints.
  3. Layer 3: AST Slicing & Storage — Slices documentation along header boundaries while preserving atomic code fences inside embedded SQLite FTS5 (WAL mode).
  4. Layer 4: Version Reconciliation & Lockfiles — Scans 8 ecosystems (npm, cargo, go, pypi, composer, rubygems, pub, maven) and writes bit-for-bit stable docs.lock files.
  5. 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.
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.

ParameterTypeDescription
querystring (required)The natural language search query.
docVersionstring (optional)Target version filter (e.g. v15, ^16.0.0).
librarystring (optional)Filter to specific library or package name.
limitnumber (optional)Maximum chunks to return (default: 5).
formatstring (optional)"markdown" (default) or "json".

2. get_doc

Retrieves a complete normalized document page or specific chunk by URL or chunk ID.

ParameterTypeDescription
urlstring (optional)The URL of the documentation page.
chunkIdstring (optional)The exact chunk ID to retrieve.
docVersionstring (optional)Target documentation version.
formatstring (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.

ParameterTypeDescription
endpointstring (optional)Path or partial endpoint string (e.g. /v1/checkout/sessions).
methodstring (optional)HTTP method filter (GET, POST, PUT, DELETE).
querystring (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.

ParameterTypeDescription
taskstring (optional)The coding task (e.g. "webhook verification").
languagestring (optional)Language filter (javascript, typescript, python, rust, go).
frameworkstring (optional)Framework filter (nextjs, express, fastapi, django).

5. find_pitfall

Searches explicit breaking changes, deprecation warnings, server-only restrictions, and runtime rate limit traps.

ParameterTypeDescription
taskstring (optional)Task or library context.
kindstring (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.

ParameterTypeDescription
endpointstring (required)API endpoint path being called.
methodstring (optional)HTTP method (default: GET).
codestring (optional)Full code snippet to parse via AST.
docVersionstring (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.

ParameterTypeDescription
taskstring (required)Description of the agent implementation task.
tokenBudgetnumber (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
npmpackage.jsonpackage-lock.json, yarn.lock, pnpm-lock.yaml
cargoCargo.tomlCargo.lock
gogo.modgo.sum
pypipyproject.toml, setup.pypoetry.lock, Pipfile.lock, requirements.txt
composercomposer.jsoncomposer.lock
pubpubspec.yamlpubspec.lock
rubygemsGemfileGemfile.lock
mavenpom.xmlpom.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: true metadata to prevent prompt injection attacks.
  • Local Isolation: All SQLite storage lives inside the local .docorbit/ project directory. No code or telemetry leaves your machine.