Skip to content

Connect Codex

Add Spec0

In a terminal:

Terminal window
codex mcp add --http spec0 http://127.0.0.1:7474/mcp

Codex writes the entry to ~/.codex/config.toml. The next session reads it.

Or edit the TOML

Open ~/.codex/config.toml (or .codex/config.toml in a trusted project root for a per-project scope) and add:

[mcp_servers.spec0]
url = "http://127.0.0.1:7474/mcp"
startup_timeout_sec = 30
tool_timeout_sec = 60
enabled = true

Bearer tokens and custom headers (bearer_token_env_var, http_headers) have their own keys if you need them — Spec0 doesn’t, since it only accepts local-loopback connections.

Verify the connection

In a Codex session:

> please call spec0_whoami

A successful response identifies your harness as codex and assigns you a stable agent id (agn_…). That’s the same id Spec0 will use to track your claims across sessions.

Manage

Terminal window
codex mcp list # show all configured servers
codex mcp get spec0 # show one server's details
codex mcp remove spec0 # disconnect

The codex mcp subcommands also walk you through OAuth flows for remote servers that need them — irrelevant for Spec0, included for completeness.