Connect
OpenAI Codex CLI
The Codex CLI accepts remote MCP servers over HTTP. Add Dock once and every Codex session can read, write, and seal rows.
Client
OpenAI Codex CLI
Terminal agent from OpenAI. MCP via ~/.codex/config.toml.
HTTP JSON-RPC (streamable-http)
Dock MCP
trydock.ai/api/mcp
37 tools · OAuth 2.1 + DCR · Bearer
Auth path
1
Mint a
dk_ key in Dock Settings → API keys.2
Paste it as
Authorization: Bearer dk_… in the client config.3
Client calls Dock MCP directly on every request.
Prerequisites
- Codex CLI installed (
npm i -g @openai/codex). - A Dock
dk_key.
Config file
~/.codex/config.tomlReload
Codex reads the file on each launch. No daemon.
~/.codex/config.tomltoml
[mcp_servers.dock]
url = "https://trydock.ai/api/mcp"
[mcp_servers.dock.headers]
Authorization = "Bearer dk_c914f1c6..."Verify
$ codex
> /mcp
dock 63 tools (remote)
> using dock, list my workspacesTroubleshooting
Symptom
Fix
Codex errors with "mcp_servers: table expected"
TOML syntax. Check there's no stray
[ or ] mismatch. Use toml --check or an editor with TOML linting.Tools appear but list_workspaces errors 500
Confirm the key isn't revoked (Settings · API keys). If it's live and still 500s, file a bug via
create_support_ticket with the x-request-id from the Codex log.Frequently asked questions
- How do I connect Dock to Codex?
- Add Dock as a remote MCP server in Codex. Either let Codex's OAuth 2.1 + DCR flow handle auth (recommended; no credential ceremony), or paste a scoped Dock `dk_` API key in Codex's MCP config under the `Authorization: Bearer dk_…` header.
- Does Codex work with Dock's MCP server?
- Yes. Dock exposes 43 MCP tools at `https://trydock.ai/api/mcp` over HTTP transport with OAuth 2.1 + DCR and Bearer-token auth. Any MCP-spec-compliant client, including Codex, discovers them via the standard `tools/list` handshake. Learn more →
- How do I limit which Dock workspaces Codex can write to?
- When you mint the `dk_` key for Codex in Settings → API keys, pick the workspace from the dropdown. The key returns 403 on every other workspace regardless of what the prompt asks. To scope across multiple, mint multiple keys or add the agent as an explicit member of each. Learn more →
- How do I see what Codex did in my Dock workspace?
- Open the workspace in your browser. Every row Codex created or updated is stamped with the agent's identity (orb + name) in the createdBy / updatedBy field. The workspace activity feed shows every action chronologically. Learn more →
- How do I undo a row Codex wrote to Dock?
- Open the row, click the kebab menu, choose Delete (soft-delete preserves history). For bulk reverts use the activity feed to find the agent's session and delete its rows in batch. To prevent future writes, revoke Codex's `dk_` key in Settings → API keys.
- Can multiple Codex sessions share state through Dock?
- Yes. Every Codex session reads and writes the same workspace, so handoffs across machines or across long-running multi-session workflows just work. The Dock workspace IS the shared state; no separate message bus required.
- Does Codex need OAuth or a dk_ API key for Dock?
- Either works. OAuth 2.1 + DCR is the recommended path: Codex hits Dock's discovery endpoint at `/.well-known/oauth-authorization-server` and auto-registers as a client. The `dk_` Bearer token path is fine for owned-code agents and CI scripts; pick whichever fits your stack. Learn more →
- How do I add Dock as an MCP server in OpenAI Codex CLI?
- Codex CLI's `~/.codex/config.toml` supports `mcp_servers` blocks. Add Dock with `url = "https://trydock.ai/api/mcp"` and the Bearer header. Codex picks up the server on next session.
- Can Codex CLI write to a Dock workspace as it works?
- Yes. Once Dock is added as an MCP server, Codex can call any Dock tool inline; ask it to update the launch-plan workspace as it completes tasks. Each write attributes to Codex as a signed agent in Dock.
- How is Dock different from Codex's local task list?
- Codex's local task list is per-project, per-session. Dock is your team's shared, hosted workspace; tasks Codex writes there are visible to humans, other agents, and persistent across sessions.