doc0

Using doc0 with an AI agent

Wire doc0 into Cursor, Claude Code, Windsurf, Antigravity, Zed, OpenCode, or any MCP client in under a minute.

doc0 speaks Model Context Protocol over stdio. Four tools, all the agent needs.

Tools

ToolWhat it does
list_docs()Enumerate every registered source (installed bundles + user-added + community + seed).
find_docs({ query })Registry search. Returns matches; for the top match, inlines the root tree and notes whether llms-full.txt is available and how many chunks it has.
read_docs({ id, path?, full? })Read by id. No path → root tree. Directory path → subtree. Page URL/slug → Markdown. full: true → the full llms-full.txt dump. full: "heading substring" → a single matching chunk.
grep_docs({ id, query })Full-text search within a source. Prefers the local ~/.d0/docs-store cache; falls back to the bundle index, or a bounded live fetch when a URL source has no cache yet.

Most agent flows are one find_docs call followed by one read_docs call. That's the whole point.

Wire it up

Interactive picker

Run doc0 mcp install with no flag for a prompt that lists every supported client:

doc0 mcp install
# Pick an MCP client to install doc0 into:
#   1) Cursor
#   2) Claude Code
#   3) Windsurf
#   4) Antigravity
#   5) Zed
#   6) OpenCode
#
# Select 1-6 (default: 1):

The picker only shows when stdin + stdout are a TTY. In scripts or CI, pass the client flag explicitly instead (see below).

Cursor

doc0 mcp install --cursor                  # merges into ~/.cursor/mcp.json
doc0 mcp install --cursor --project        # writes ./.cursor/mcp.json instead
doc0 mcp install --cursor --dry-run        # print the merged JSON; write nothing
doc0 mcp install --cursor --yes            # replace an existing mcpServers.d0

Claude Code

doc0 mcp install --claude-code             # merges into ~/.claude.json
doc0 mcp install --claude-code --project   # writes ./.mcp.json (project scope, team-shareable)

Windsurf

doc0 mcp install --windsurf                # merges into ~/.codeium/windsurf/mcp_config.json

Antigravity

doc0 mcp install --antigravity             # merges into ~/.gemini/antigravity/mcp_config.json

Zed

Zed uses context_servers instead of mcpServers:

doc0 mcp install --zed                     # merges into ~/.config/zed/settings.json
doc0 mcp install --zed --project           # writes ./.zed/settings.json

OpenCode

OpenCode uses a mcp key with type: "local" entries:

doc0 mcp install --opencode                # merges into ~/.config/opencode/opencode.json
doc0 mcp install --opencode --project      # writes ./opencode.json

Common flags

doc0 mcp install --list                    # print supported clients, then exit
doc0 mcp install --dry-run                 # print merged JSON; write nothing (works with any client flag)
doc0 mcp install --yes                     # replace an existing d0 entry without prompting

Manual (Claude Desktop)

// ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "d0": {
      "command": "doc0",
      "args": ["mcp"]
    }
  }
}

Manual (any mcpServers client)

// Cursor, Claude Code, Windsurf, Antigravity — all use this shape
{
  "mcpServers": {
    "d0": { "command": "doc0", "args": ["mcp"] }
  }
}

The mcpServers.d0 key is kept stable for backward compatibility — the command is doc0, the key stays d0.

Installed-only mode

For teams who only want their curated bundles (and no community URL entries) exposed to agents:

doc0 mcp --installed-only

or set D0_MCP_INSTALLED_ONLY=1. Hides every community + seed entry; installed bundles and user-added registry entries stay visible.