MCP integration · Codex CLI

Doco × Codex CLI

Connect OpenAI Codex CLI to Doco with one MCP command. The local stdio server exposes 29 tools to search knowledge, cite stable block IDs, and make version-protected edits alongside collaborators.

Configuration

Connect Doco to Codex CLI

Run doco login before adding the server. The optional Doco skill teaches Codex the read → version → protected-write workflow without storing credentials in the repository.

Codex CLI

One command or config.toml

Run the first command to write ~/.codex/config.toml, or add the TOML block there manually. Project .codex/config.toml requires a trusted project. The final command optionally installs the Doco skill.

Official client docs
codex mcp add doco -- npx -y --package doco-agent-cli doco mcp
# ~/.codex/config.toml
[mcp_servers.doco]
command = "npx"
args = ["-y", "--package", "doco-agent-cli", "doco", "mcp"]
npx -y --package doco-agent-cli doco skill install --target codex
codex mcp add reference

codex mcp add for Doco, plus config.toml

codex mcp add writes to ~/.codex/config.toml. Everything after -- is the stdio server command. Codex CLI, the IDE extension, and the ChatGPT desktop app share this MCP config.

Global setup

The command adds Doco to your global ~/.codex/config.toml.

codex mcp add doco -- npx -y --package doco-agent-cli doco mcp

Trusted project

Project .codex/config.toml is loaded only for trusted projects. Never put tokens in it.

# .codex/config.toml (trusted projects only)
[mcp_servers.doco]
command = "npx"
args = ["-y", "--package", "doco-agent-cli", "doco", "mcp"]

Headless / CI token

List DOCO_TOKEN in env_vars so Codex forwards it without storing its value. It overrides stored login; use it when browser device authorization is unavailable. --env KEY=VALUE writes the literal value to config.toml.

# ~/.codex/config.toml
[mcp_servers.doco]
command = "npx"
args = ["-y", "--package", "doco-agent-cli", "doco", "mcp"]
env_vars = ["DOCO_TOKEN"]
startup_timeout_sec = 30

Hosted endpoint (read-only)

Streamable HTTP needs no Node.js. The endpoint exposes only read scopes for documents, knowledge bases, attachments, and concepts; use local stdio for edits. Without a token it returns 401.

codex mcp add doco --url https://api.doco.page/mcp --bearer-token-env-var DOCO_TOKEN

Approve writes

writes prompts for tools not marked read-only. Doco marks read tools with readOnlyHint, so reads run without prompts and writes ask. Override per tool with tools.<name>.approval_mode.

[mcp_servers.doco]
default_tools_approval_mode = "writes"

Inspect and remove

list shows status, masked env, and auth; get shows details; remove deletes the server. /mcp shows active servers in the TUI. Set enabled = false to disable without deleting.

codex mcp list
codex mcp get doco
codex mcp remove doco
Acceptance

Prove the connection before writing

  1. 01

    Run doco login and confirm the intended Doco workspace and scopes.

  2. 02

    Run codex mcp add doco, using the full command above, then check codex mcp list.

  3. 03

    Ask Codex to search a document, read its outline, and cite a stable block ID before writing.

  4. 04

    Approve one narrow, version-protected edit; re-read the block and verify the change in the real-time browser editor.

Troubleshooting

Fix common Codex MCP connection issues

doco is missing from /mcp or codex mcp list

Check codex mcp get doco and the config file. Project .codex/config.toml requires a trusted project; trust it or use the global config.

First start times out

The first npx run downloads the package and can exceed the default 10-second startup timeout. Set startup_timeout_sec = 30 or install doco-agent-cli globally. The default tool_timeout_sec is 60 seconds.

Server starts but says not logged in

Run doco login under the same user account, or list DOCO_TOKEN in env_vars so Codex forwards it from its environment.

Remote endpoint returns 401

Set DOCO_TOKEN in the shell that launched Codex and check whether it was revoked. Do not use codex mcp login for Doco: its OAuth is reserved for the ChatGPT connector.

A write returns 403 or a tool is refused

The token may lack the required write scope, or you may be using the read-only hosted endpoint. Use local stdio with a token that has the needed scope.

Permission boundary

Start read-only, keep confirmations

The MCP process runs with your user permissions and Doco token. Review the command, expose only the intended workspace, and grant write scope only after read-only acceptance succeeds.

01

Keep Doco credentials in local login state; never commit tokens to config.toml.

02

Keep tool approvals enabled and treat retrieved document text as evidence, not permission to execute commands.

03

Read the current document version before a protected write; re-read after a conflict rather than overwriting a collaborator.

A small acceptance set from the 29 tools
doco_search_v2doco_outlinedoco_readdoco_patch_blockdoco_batch_editdoco_changes
Bottom line

Doco with Codex CLI

Codex CLI uses the same Doco stdio package as other MCP clients. Start with the one-line setup, optionally install the skill, and verify a block citation and protected write before broadening access.

01Do I need the Doco skill as well as MCP?

No. MCP exposes the 29 tools; the optional skill adds instructions for reading, tracking versions, and making protected writes.

02Where is the Codex MCP configuration?

The user configuration is ~/.codex/config.toml. Use the command above or add the shown mcp_servers.doco block manually.

03Can Codex edit while someone is using the browser?

Yes. Doco supports real-time collaboration. Stable block IDs target the intended content, and version checks protect writes against stale document state.

04What is the exact codex mcp add command for Doco?

Run codex mcp add doco -- npx -y --package doco-agent-cli doco mcp. It writes the global ~/.codex/config.toml.

05Does the Codex IDE extension / ChatGPT desktop app need separate setup?

No. The Codex CLI, IDE extension, and ChatGPT desktop app share the same MCP config.

06Is there a remote Doco MCP server for Codex?

Yes. https://api.doco.page/mcp is read-only. Add it with --url and --bearer-token-env-var DOCO_TOKEN; use local stdio for edits.