Answer: Configure each MCP server with a `[mcp_servers.]` table in `~/.codex/config.toml` or a project-scoped `.codex/config.toml`. For a STDIO server, set `command` (required) plus optional `args`, `env`, `env_vars`, and `cwd`; for a Streamable HTTP server, set `url` (required) plus optional `auth`, `bearer_token_env_var`, `http_headers`, `env_http_headers`, and `http_headers_helper`. Status: Confirmed Entry: tool/codex/integrations/connect-codex-mcp-config-toml Revision: 1 Digest: sha256:41f8ae543d93d5cf (changes whenever the content changes) Timeline: Created: 2026-11-13T03:51:12Z Last changed: 2026-11-13T03:51:12Z Last verified: 2026-11-20T13:39:31Z Next check: 2026-11-21T13:39:31Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of config file location | ~/.codex/config.toml | [1] | 2026-11-20 table format | [mcp_servers.] | [1] | 2026-11-20 STDIO required option | command | [1] | 2026-11-20 HTTP required option | url | [1] | 2026-11-20 example server name | context7 | [1] | 2026-11-20 example command | npx | [1] | 2026-11-20 example args | ["-y", "@upstash/context7-mcp"] | [1] | 2026-11-20 Sources: [1] OpenAI. "Model Context Protocol". https://learn.chatgpt.com/docs/extend/mcp.md Role: primary. Accessed: 2026-11-20T13:39:31Z Quote: "edit `~/.codex/config.toml` or a project-scoped" (Supports: config file location) Quote: "Configure each MCP server with a `[mcp_servers.]` table in the configuration file." (Supports: table format) Quote: "`command` (required): The command that starts the server." (Supports: STDIO required option) Quote: "`url` (required): The server address." (Supports: HTTP required option) Quote: "[mcp_servers.context7]" (Supports: example server name) Quote: "command = "npx"" (Supports: example command) Quote: "args = ["-y", "@upstash/context7-mcp"]" (Supports: example args) Snapshot SHA-256: faf9407740483f7ee27ac4d0db08a9d15510b3d241251edc9d00cf7b35c29e3b (captured 2026-11-13T03:51:12Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:51:12Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:39:31Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:39:31Z Last attempt: 2026-11-20T13:39:31Z Notes and limitations: Extracted automatically from a single official source (section "Configure with config.toml"). Related: https://latestn.com/tool/codex/integrations/connect-codex-to-mcp-tools How do I connect Codex to external MCP tools? https://latestn.com/tool/codex/integrations/customize-codex-review-rules How do I customize what Codex reviews using AGENTS.md rules? https://latestn.com/tool/codex/integrations/delegate-issue-to-codex How do I delegate a Linear issue to Codex? https://latestn.com/tool/codex/integrations/configure-codex-exec How do I configure `codex exec` options in the Codex GitHub Action? https://latestn.com/tool/codex/integrations/configure-mcp-tool-hook How do I configure an MCP tool hook in Codex? https://latestn.com/tool/codex/integrations/connect-cli-to-remote-app-server How do I connect the Codex CLI terminal UI to a remote Codex app-server? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:51:12Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/codex/integrations/connect-codex-mcp-config-toml/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/codex/integrations/connect-codex-mcp-config-toml POST: https://latestn.com/dispute/tool/codex/integrations/connect-codex-mcp-config-toml with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/codex/integrations/connect-codex-mcp-config-toml?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I connect Codex to an MCP server using config.toml? Revision 1, last verified 2026-11-20T13:39:31Z. https://latestn.com/tool/codex/integrations/connect-codex-mcp-config-toml (accessed 2026-11-21T09:57:24Z). @misc{LatestN_tool_codex_integrations_connect_codex_mcp_config_toml_r1, title = {How do I connect Codex to an MCP server using config.toml?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/codex/integrations/connect-codex-mcp-config-toml}}, note = {Revision 1; digest sha256:41f8ae543d93d5cf; last verified 2026-11-20T13:39:31Z; accessed 2026-11-21T09:57:24Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/codex/integrations/connect-codex-mcp-config-toml