Data coding-agents/

Codex CLI MCP config: file location, transports and auth

One row of the MCP client config reference, checked 2026-12-06.

Published
Read
1 min
Source
Markdown
Client
Codex CLI
Vendor
OpenAI
Config file
~/.codex/config.toml (user); .codex/config.toml in the project (trusted projects only); shared with the ChatGPT desktop app and the Codex IDE extension
Format
TOML, one [mcp_servers.<name>] table per server; codex mcp add
Scopes
User and project (trusted projects only); plugin-bundled servers under plugins.<plugin>.mcp_servers
Transports
stdio; Streamable HTTP (url); SSE not documented
Remote OAuth
Yes. codex mcp login <name> (--no-browser available); supports CIMD and DCR; a configured oauth.client_id (optional client_secret) skips registration; fixed callback with mcp_oauth_callback_port, mcp_oauth_callback_url or oauth.callback_port; credentials in keyring or file (mcp_oauth_credentials_store); bearer_token_env_var as an alternative
Admin controls
requirements.toml mcp_servers approved list: a server runs only if its name and identity (command or URL; exact, prefix or regex) match, and an empty list disables all; /etc/codex/requirements.toml (Unix), %ProgramData%\OpenAI\Codex\requirements.toml (Windows), macOS MDM com.openai.codex:requirements_toml_base64, or cloud-managed in Agent security in the ChatGPT Admin Console
Docs
https://learn.chatgpt.com/docs/extend/mcp?surface=cli
Source
https://learn.chatgpt.com/docs/enterprise/managed-configuration

From the MCP client config reference, checked Dec 6, 2026. Licence CC BY 4.0.

Codex keeps MCP servers in config.toml, one [mcp_servers.<name>] table per server. The ChatGPT desktop app, Codex CLI and the IDE extension share that configuration, per OpenAI’s Codex MCP docs. A project-level .codex/config.toml loads only in trusted projects.

The config reference names only stdio and Streamable HTTP for MCP servers, so SSE is marked “not documented.” To sign in, run codex mcp login <server-name>. Codex supports CIMD and DCR, and a configured OAuth client ID skips registration. Set mcp_oauth_callback_port when an authorization server needs a fixed redirect port.

Admins enforce an approved list with mcp_servers in requirements.toml. A server runs only when both its name and its identity (command or URL) match an entry. An empty list disables all MCP servers, per the managed configuration page. More in Codex CLI MCP config.

Sources

  1. Model Context Protocol (Codex)OpenAI learn.chatgpt.com
  2. Configuration referenceOpenAI learn.chatgpt.com
  3. Managed configurationOpenAI learn.chatgpt.com

Cite this page

Agents for Devs. "Codex CLI MCP config: file location, transports and auth." Published Dec 6, 2026. https://agentsfordevs.com/mcp-clients/codex-cli