Codex is OpenAI's AI coding agent that runs in the terminal, designed for autonomous software engineering tasks. It is the only major AI app in the getmcp ecosystem that uses TOML for its config format. MCP servers are configured under the mcp_servers root key (note the underscore, unlike mcpServers). Stdio servers use the standard command, args, and env fields. Remote servers use http_headers instead of headers, and timeout becomes startup_timeout_sec measured in seconds rather than milliseconds. Codex auto-detects the transport type from the URL, so no explicit transport field is needed. Both a global config at ~/.codex/config.toml and a project-level config at .codex/config.toml are supported. The getmcp CLI serializes the correct TOML structure automatically.
Quick Install with getmcp
The fastest way to install MCP servers in Codex is with the getmcp CLI:
▸TOML syntax errors: TOML is whitespace-tolerant but has strict rules around section headers and value types. Use a TOML validator if you edit the config manually. The getmcp CLI uses the smol-toml library to produce valid TOML.
▸mcp_servers vs mcpServers: Codex uses mcp_servers (with an underscore) as the root key, not mcpServers. Copying configs from other apps directly will not work — the key must be renamed.
▸http_headers vs headers: Remote server configs use http_headers for custom HTTP headers, not headers. If a server requires authentication headers and they are not being sent, check that you are using the correct field name.
▸startup_timeout_sec units: Codex measures timeout in seconds, not milliseconds. If you set a timeout manually, use seconds (e.g., 30 not 30000). The getmcp CLI converts automatically from the canonical millisecond value.