How do you add MCP servers to Codex, and can Codex still run as an MCP server?

Short answer

Codex reads MCP servers from config.toml: ~/.codex/config.toml for you, or .codex/config.toml in a trusted project for the team. You add one with codex mcp add or a [mcp_servers.<name>] table, and sign in with codex mcp login. The ChatGPT desktop app, Codex CLI and IDE extension share this configuration. Running Codex itself as an MCP server is no longer possible: OpenAI removed the codex mcp-server command.

Adding MCP servers to Codex

Codex keeps its MCP servers in config.toml. One file serves the Codex CLI, the IDE extension and the ChatGPT desktop app, so you set a server up once.

File Applies to Note
~/.codex/config.toml You, in every project The default
.codex/config.toml in the repo Everyone working in that project Only read in trusted projects

From the command line:

codex mcp add mytool --env API_KEY=... -- npx -y some-mcp-server
codex mcp list
codex mcp login notion

codex mcp login handles OAuth for remote servers; add --no-browser on a machine without a browser.

Or write the table yourself. A remote server looks like this:

[mcp_servers.github]
url = "https://api.githubcopilot.com/mcp/"
bearer_token_env_var = "GITHUB_TOKEN"

The keys worth knowing, as of November 2026:

Key For What it does
command, args, env, cwd Local (stdio) servers Starts the server as a process
url, bearer_token_env_var, http_headers, env_http_headers Remote (Streamable HTTP) servers Where to connect and how to authenticate, with the token read from an environment variable
enabled_tools, disabled_tools Both Limit which tools the model sees
default_tools_approval_mode, tools.<tool>.approval_mode Both Whether calls need approval
startup_timeout_sec, tool_timeout_sec Both Defaults 10 and 60 seconds
required Both Treat the server as required

Setting it up for a team

  1. Put shared servers in .codex/config.toml in the repository and commit it. Each developer marks the project as trusted; untrusted projects ignore the file.
  2. Keep tokens in environment variables with bearer_token_env_var or env_http_headers, never as literal values in the file.
  3. Prefer remote servers with OAuth, so each person signs in with codex mcp login as themselves.
  4. Trim the tools. enabled_tools keeps the model’s tool list short and stops write tools you did not intend.
  5. Enterprise admins can enforce MCP requirements for local executors through managed configuration; OpenAI’s MCP page refers to this but does not detail it.

The common misunderstanding: Codex as an MCP server

Many guides from 2025 and early 2026 show codex mcp-server, which turned Codex itself into an MCP server with tools such as codex and codex-reply, so another agent could hand it coding tasks. That command is gone. OpenAI’s documentation now states that codex mcp-server and the standalone codex-mcp-server binary have been removed, and that the old tool reference and Agents SDK examples are no longer supported.

The suggested replacement is the Codex app server, for integrations that need authentication, conversation history, approvals and streamed agent events. OpenAI is explicit that it is not an MCP server and not a drop-in replacement, and that it is experimental and not supported for production workloads. If you built a multi-agent setup around codex mcp-server, plan for a rewrite rather than a config change.

The app server does give an integration its own MCP handling: mcpServerStatus/list lists MCP servers, tools, resources and auth status, mcpServer/tool/call calls a tool on a thread’s configured MCP server, and mcpServer/oauth/login starts an OAuth login and returns an authorization URL. The docs also warn that the WebSocket transport is experimental and that non-loopback WebSocket listeners currently allow unauthenticated connections by default during rollout, so configure WebSocket authentication before exposing one remotely.

What this means for a team

A team where some people use Codex and others use Claude Code or Cursor needs the same servers in three formats: config.toml, .mcp.json and .cursor/mcp.json. The servers are shared; the files and the setup are not. See MCP servers in Claude Code for a team and Cursor MCP servers.

What MCP does not give Codex is memory of earlier work. Instructions live in AGENTS.md; what one developer’s Codex session learned does not reach a colleague’s. Read what AGENTS.md is and how Codex reads it and does Codex remember previous work.

Where Bombos fits

Bombos is one MCP server you add to Codex, and to Claude Code, Cursor, Copilot and your other AI tools in the same way, so they share one memory: team knowledge, rules the AI learned from corrections, and what already sits in repos, documents and mail, with a trail of what each answer rests on. It runs in our cloud or on your own server, and one developer can try it first with their own agents.

Related questions

Where is the Codex MCP configuration?

In config.toml. The default is ~/.codex/config.toml; a project can have its own .codex/config.toml, which Codex only reads in trusted projects.

Can I still run codex mcp-server?

No. OpenAI's documentation says the codex mcp-server command and the standalone codex-mcp-server binary have been removed, along with the old Agents SDK examples.

What replaces Codex as an MCP server?

OpenAI points to the Codex app server for integrations that need authentication, conversation history, approvals and streamed events. It uses a different protocol, is not an MCP server, and is marked experimental.

How do I limit which tools of an MCP server Codex can use?

Use enabled_tools and disabled_tools in the server's table; disabled_tools is applied after enabled_tools. You can also set an approval mode per tool.

Do I need to configure MCP separately for the Codex CLI and the IDE extension?

No. According to OpenAI, the ChatGPT desktop app, Codex CLI and IDE extension share the same MCP configuration.

Sources

  1. MCP in Codex (OpenAI docs)
  2. Codex MCP server, removal notice (OpenAI docs)
  3. Codex App Server (OpenAI docs)
The first half hour · free

What does your AI forget?

  1. 01You tell us which AI you use and where it keeps starting over.
  2. 02We show what a shared memory changes there, on your own examples.
  3. 03You keep the plan, with or without Bombos.
Piet Baudoin
Piet BaudoinYou talk to Piet, from the Bombos teamDutch team from Utrecht and Nijmegen · data in Europe
We reply the same working day.