Codex MCP servers: how to add one and connect your apps

Add an MCP server to Codex with codex mcp add or config.toml, sign in with OAuth, set approvals per tool, and see what replaced codex mcp-server.

Updated

Short answer

Run codex mcp add <name> --url <address>. If the server uses OAuth, Codex opens the sign-in in your browser; otherwise run codex mcp login <name>. Codex saves the server in ~/.codex/config.toml, which the CLI, the IDE extension and Codex in the ChatGPT desktop app all read. ChatGPT's plugins, such as Gmail and Slack, also work in the desktop app and the CLI. codex mcp-server, which ran Codex itself as an MCP server, was removed in September 2026. For your email, calendar and Slack in one server, with the access you choose, use Upsy.

How to add an MCP server to Codex

The commands (Codex docs):

Command What it does
codex mcp add <name> --url <url> Adds a remote (Streamable HTTP) server and starts its sign-in if it uses OAuth
codex mcp add <name> -- <command> Adds a local server that Codex starts, such as -- npx -y some-mcp-server
codex mcp login <name> Signs in to an OAuth server. /mcp login <name> does the same inside a session
codex mcp list Lists your servers. codex mcp get <name> shows one
codex mcp logout <name>, codex mcp remove <name> Deletes the stored sign-in, or the server

codex mcp add always writes to ~/.codex/config.toml. You can also edit the file yourself:

[mcp_servers.upsy]
url = "https://upsy.ai/connect"
startup_timeout_sec = 30

[mcp_servers.my-api]
url = "https://api.example.com/mcp"
bearer_token_env_var = "MY_API_TOKEN"

A few things worth knowing:

  • OAuth needs no flag. Old guides tell you to set experimental_use_rmcp_client. That setting no longer exists: remote sign-in has been on by default since December 2025.
  • Project servers. A .codex/config.toml in a repo adds servers for that project, but only once you trust the project.
  • Bringing servers over. /import copies MCP servers from Cursor and Claude Code into Codex.
  • Back up a hand-edited file. codex mcp add and remove rewrite every [mcp_servers] block and drop your comments (issue #45432).

Every Codex surface shares that config, except the cloud:

Where How it gets servers What to know
Codex CLI config.toml and installed plugins /mcp lists servers and tools; /plugins browses plugins
IDE extension (VS Code, Cursor, Windsurf) The same config.toml, or the gear menu › MCP servers No plugins in the extension (plugins docs)
Codex in the ChatGPT desktop app The same config.toml, or Settings › MCP servers Codex moved into the ChatGPT desktop app in July 2026
Codex cloud Not documented Cloud tasks don't see your MCP servers or plugins, per open issues (#57061)

Codex comes with every ChatGPT plan, and MCP servers work on Plus, Pro, Business and Enterprise, or with an API key (Codex pricing).

What Codex connects to natively

Codex and ChatGPT share one plugin catalog. A plugin bundles an app's MCP server with skills, and the docs name Gmail, Google Drive and Slack as examples. Install one from the Plugins tab in the desktop app or /plugins in the CLI, then sign in when asked. A Gmail or Slack you already connected in ChatGPT is the same connection.

Limits of the built-in way:

  • ChatGPT sign-in only. With an API key, ChatGPT's connectors aren't available and plugins are limited.
  • Not in the IDE extension, which uses only config.toml servers.
  • Sign-in bugs. In the desktop app, the sign-in link for some plugins never shows and their tools fail (issue #57093).
  • Not in the cloud. Cloud tasks can't use them.

Separately, @ChatGPT in Slack (it was @Codex until September) hands a thread's request to a Codex cloud task and replies in the thread. That works from Slack to Codex, not the other way. See connect Slack to Codex for Slack as a tool inside Codex.

Control what Codex runs

Each server, and each tool, gets an approval mode in config.toml (config reference):

Mode When Codex asks
auto (default) For any tool not marked read-only, and always for tools marked destructive
writes For any tool not marked read-only
prompt Every time
approve Never
[mcp_servers.upsy]
url = "https://upsy.ai/connect"
default_tools_approval_mode = "auto"

[mcp_servers.upsy.tools.send_message]
approval_mode = "prompt"

Upsy marks its reading tools read-only, so in auto Codex reads your email and calendar without asking and asks before it sends, deletes or changes anything. "Allow and don't ask me again" in a prompt writes approval_mode = "approve" for that tool. enabled_tools and disabled_tools hide tools from Codex locally; Upsy's access levels hide them at the server, for every surface at once.

What happened to codex mcp-server

codex mcp-server ran Codex itself as an MCP server, with codex and codex-reply tools, so another agent could hand it tasks. OpenAI deprecated it in August 2026 and removed it in CLI 0.154.0 on September 9 (migration notes). What to use now:

  • From Claude Code: OpenAI's Codex plugin for Claude Code. Run /plugin marketplace add openai/codex-plugin-cc, then /plugin install codex@openai-codex, and use commands like /codex:review and /codex:rescue.
  • From your own code: the Codex SDK (@openai/codex-sdk for TypeScript, and a Python library), or codex exec in scripts.
  • For a custom client: codex app-server, a JSON-RPC interface. It isn't MCP, and OpenAI calls it experimental.

How Upsy fills the gap

Upsy is one remote MCP server at https://upsy.ai/connect:

  • Your apps in one server: Gmail, Google Calendar, Google Drive with Docs and Sheets, Slack and Zoho Mail. Linear, Notion, Atlassian, Sentry and other services connect through their own MCP servers, with their own sign-in, and Codex reaches them with app_tools, app_read and app_call.
  • Works everywhere Codex reads config: the CLI, the IDE extension and the desktop app, signed in with ChatGPT or an API key.
  • Up to five accounts per app, such as work and personal Gmail. The tools take an account argument.
  • Access per assistant: Full access, Read-only, Pick actions (the tools you choose) or No access, enforced by Upsy.
  • History and alerts: every action is logged under Codex, and Upsy emails you when one assistant deletes, sends or reads a lot at once.
  • One setup for every assistant: the same connections work in Claude Code, Cursor, ChatGPT and Claude, each with its own access.
  • Memory, files and a cloud browser that's signed in to your sites. Upsy's Outlook connector is pending until Microsoft approves Upsy; until then, Codex can use outlook.com in that browser.

If you only need GitHub or Linear, the vendor's own server is simpler. The Gmail MCP server guide compares the ways to give Codex your email.

Add Upsy to Codex

  1. Sign up free at upsy.ai and connect your apps under Apps.

  2. In your terminal, run:

    codex mcp add upsy --url https://upsy.ai/connect
    
  3. Codex sees that Upsy uses OAuth and opens an Upsy page in your browser. If it doesn't, run codex mcp login upsy. Sign in, choose what Codex can use and click Allow.

  4. Run codex mcp list to confirm upsy is there, then ask Codex: "Use upsy to list my next three calendar events."

There's no API key: Codex registers itself with Upsy's OAuth server, keeps its tokens on your machine and refreshes them. The IDE extension and the desktop app pick Upsy up from the same config.toml.

Troubleshooting

"MCP client for upsy timed out after 30 seconds"

Codex gave up waiting for the server to start. Set startup_timeout_sec = 60 under [mcp_servers.upsy] and start a new session.

The browser doesn't open for sign-in

Run codex mcp login upsy and copy the address Codex prints into your browser. Inside a session, /mcp login upsy does the same.

Upsy's tools are missing in the first message

Codex doesn't wait long for servers that aren't required. Add required = true under [mcp_servers.upsy], or ask again once /mcp shows it connected.

Servers work in the CLI but not in VS Code

The extension reads config.toml on the machine where it runs Codex. If that's WSL or a remote container, add Upsy to the file there too, then restart the extension.

FAQ

Where is the Codex MCP config?

In ~/.codex/config.toml, under [mcp_servers.<name>]. A trusted project can add its own in .codex/config.toml.

Does Codex support remote MCP servers with OAuth?

Yes, by default. Add the server with --url, and Codex starts the sign-in. No experimental flag is needed.

Is codex mcp-server still available?

No. It was removed in September 2026. Use OpenAI's Codex plugin for Claude Code, the Codex SDK or codex exec instead.

Do MCP servers work in Codex cloud?

OpenAI doesn't document it, and open issues report that cloud tasks can't see your MCP servers or plugins. Use the CLI, the IDE extension or the desktop app.

Can I use MCP in Codex with an API key?

Yes. MCP servers in config.toml work with an API key. ChatGPT's plugins and connectors need a ChatGPT sign-in.

Guides