Client integration · coding agent
OpenAI Codex
TOML-based MCP configuration for the Codex CLI, IDE extension, and ChatGPT desktop.
Overview
Codex is OpenAI's coding agent available through a CLI, an IDE extension, and the ChatGPT desktop app. MCP servers are configured in a shared TOML file under CODEX_HOME (by default ~/.codex). The configuration supports stdio processes and Streamable HTTP endpoints, with bearer-token environment variables for remote authentication. Codex does not document legacy HTTP+SSE as an MCP transport.
Configuration locations
| Scope | Path or setting | Note |
|---|---|---|
| user | ~/.codex/config.toml | Default shared configuration; CODEX_HOME overrides the directory. |
| project | .codex/config.toml | Read for trusted projects. |
Paths are documented by the vendor and may change. Confirm the current path in your installed version.
Local and remote servers
Local servers are defined with command, args, and an optional env table. Remote servers use url, optional bearer_token_env_var, and http_headers. Legacy SSE is not part of the documented Codex MCP transport set.
- Transports
- stdio, Streamable HTTP
- Authentication
- Bearer token environment variable; OAuth (client auth flow); HTTP headers; Environment variables
- Category
- coding agent
- Vendor
- OpenAI
Generate a config for OpenAI Codex
The adapter emits this client's documented structure and validates transport, scope, names, and credential placeholders.
Open the generatorCLI and workflow notes
- `codex mcp add <name> -- <command> [args...]` registers a stdio server.
- `codex mcp add <name> --url <url> --bearer-token-env-var ENV` registers a remote server.
- `codex mcp list`, `codex mcp get`, and `codex mcp remove` inspect and manage registrations.
- The `codex mcp` command family is marked experimental in the official CLI reference.
Tool permissions
MCP servers can expose tools that act on local files, repositories, and remote services. Codex's sandbox and approval policies still apply. Review per-server tool lists and use environment-scoped credentials; an MCP entry does not grant additional trust by itself.
Compatibility notes
- Supported transports: stdio and Streamable HTTP. SSE is not documented.
- Project configuration is only honored for trusted projects.
- Configuration is shared by the CLI, IDE extension, and ChatGPT desktop app.
- `env` values for stdio servers are literal; use bearer_token_env_var for remote bearer tokens.
Limitations
- No documented legacy SSE transport.
- The MCP CLI is experimental and may change.
- OAuth setup differs between Codex surfaces and requires following the current client flow.
Servers with this client format
91 catalog entries list this client as a supported configuration target.
Sources & evidence
- developers.openai.com/codex/mcpOfficial documentation · checked Oct 23, 2026 · documented
Codex MCP configuration and the mcp_servers TOML structure, stdio and Streamable HTTP support, and CLI commands are described in the official MCP documentation.
- developers.openai.com/codex/config-referenceOfficial documentation · checked Oct 23, 2026 · documented
The configuration reference documents mcp_servers fields including command, args, env, url, bearer_token_env_var, http_headers, and timeouts.