---
title: "Codex CLI MCP config: file location, transports and auth"
type: dataset-entry
url: https://agentsfordevs.com/mcp-clients/codex-cli
markdown: https://agentsfordevs.com/mcp-clients/codex-cli.md
publisher: Agents for Devs
author: Agents for Devs desk
published: 2026-12-06
updated: 2026-12-06
license: https://agentsfordevs.com/reuse
citation: 'Agents for Devs. "Codex CLI MCP config: file location, transports and auth." Published Dec 6, 2026. https://agentsfordevs.com/mcp-clients/codex-cli'
attribution: Credit Agents for Devs and link to https://agentsfordevs.com/mcp-clients/codex-cli
---

# Codex CLI MCP config: file location, transports and auth

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

| Field | Value |
|---|---|
| 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 (/mcp-clients), checked 2026-12-06. 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](https://learn.chatgpt.com/docs/extend/mcp?surface=cli). A project-level `.codex/config.toml` loads only in trusted projects.

The [config reference](https://learn.chatgpt.com/docs/config-file/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](https://learn.chatgpt.com/docs/enterprise/managed-configuration). More in [Codex CLI MCP config](/guides/codex-cli-mcp).

## Sources

1. [Model Context Protocol (Codex), OpenAI](https://learn.chatgpt.com/docs/extend/mcp?surface=cli)
2. [Configuration reference, OpenAI](https://learn.chatgpt.com/docs/config-file/config-reference)
3. [Managed configuration, OpenAI](https://learn.chatgpt.com/docs/enterprise/managed-configuration)

## 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

- Page: https://agentsfordevs.com/mcp-clients/codex-cli
- Markdown: https://agentsfordevs.com/mcp-clients/codex-cli.md
- Reuse: quote or summarize with a link to the page. Terms: https://agentsfordevs.com/reuse
