
This comparison is part of our MCP comparisons, within The MCP Guide. Facts are checked against each vendor's own documentation and pricing pages on the date shown.
Both Claude Code and OpenAI's Codex are strong MCP clients for developers, and both support local and remote servers with OAuth. Pick Claude Code if you want team-shared server files, a choice of admin patterns and the option to run the agent itself as an MCP server. Pick Codex if you want per-server approval modes and tool allowlists in one TOML file shared with the ChatGPT desktop app. Most teams should pick the agent they already prefer for coding and treat MCP as a tie.
MCP (Model Context Protocol) is the open standard that lets an AI agent call outside tools and data through "servers." Claude Code is Anthropic's agentic coding tool. Codex is OpenAI's, available as a CLI, IDE extension, web app and inside the ChatGPT desktop app.
Checked against: Claude Code's MCP docs and OpenAI's ChatGPT and Codex MCP docs on 28 October 2026. eSEOspace did not test either product.
Key Takeaways
- Claude Code stores servers at local, user or project scope; project scope is a
.mcp.jsonfile that a team commits to version control. - Codex stores servers in
~/.codex/config.tomlor a project.codex/config.toml(trusted projects only), shared by the CLI, IDE extension and ChatGPT desktop app. - Codex lets you set an approval mode per server or per tool, including a
writesmode that prompts only for tools not marked read-only. - Both let admins restrict servers: Claude Code with
managed-mcp.jsonand allowlists or denylists, Codex with an approvedmcp_serverslist inrequirements.toml. - Claude Code can run as an MCP server with
claude mcp serve; OpenAI has removed thecodex mcp-servercommand.
At a glance
| Item | Claude Code | Codex |
|---|---|---|
| Config file | .mcp.json (project), ~/.claude.json (local, user) | ~/.codex/config.toml, .codex/config.toml (project) |
| Add a server | claude mcp add | codex mcp add, or Settings > MCP servers in the desktop app |
| Local servers | stdio | stdio |
| Remote servers | HTTP (recommended), SSE (deprecated), WebSocket | Streamable HTTP |
| Remote auth | OAuth, headers, dynamic header helper | Bearer token, OAuth (CIMD and DCR), headers, header helper |
| Tool filtering | Admin allowlists and denylists by server | enabled_tools and disabled_tools per server |
| Approval per tool | Permission prompts; project servers need approval | auto, prompt, writes or approve, per server or tool |
| Many tools | Tool search defers definitions | Per-tool output token limits |
| Acts as an MCP server | Yes, claude mcp serve | No, removed |
| Admin restriction | managed-mcp.json, allowedMcpServers, deniedMcpServers | mcp_servers approved list in requirements.toml |
Where Claude Code is stronger
Team sharing through the repository
Claude Code's project scope puts servers in .mcp.json at the repository root, "shared with team" through version control. Codex also reads a project .codex/config.toml, for trusted projects only, but its MCP page does not describe sharing servers through version control. Claude Code also blocks a cloned repo from approving its own servers; approvals must come from user or managed settings.
More admin patterns
Anthropic's managed MCP docs list ready-made patterns: "Disable MCP," "Fixed deployment," "Provided servers," "Approved catalog," "Soft allowlist" and "Denylist only." Admins can push remote servers to everyone with managedMcpServers while users keep their own. Codex offers one approved list plus the option to disable all servers.
More transports and newer protocol features
Claude Code accepts HTTP, SSE and WebSocket for remote servers. It also supports the MCP Tasks extension for long-running server jobs, in public beta in the CLI. Tool search loads only tool names at the start, and the docs say there is no fixed per-server tool cap.
Connectors and a server mode
If you sign in with a claude.ai account, connectors your organization adds in claude.ai appear in Claude Code automatically. Claude Code can also act as a server: claude mcp serve exposes it over stdio to another MCP client. OpenAI's removal notice says "the codex mcp-server command and the standalone codex-mcp-server binary have been removed," pointing integrators to an experimental app server that "isn't an MCP server."
Where Codex is stronger
Approval rules per server and per tool
Codex has default_tools_approval_mode with four values: auto, prompt, writes and approve. OpenAI says "the writes mode prompts for tools that aren't marked read-only." You can override it per tool with tools.<tool>.approval_mode. This lets you auto-approve safe reads and still confirm every write. Our tool annotations explainer covers the read-only hint it relies on.
Tool allowlists in config
Each Codex server can take enabled_tools (an allow list) and disabled_tools (a deny list applied after it). Trimming a busy server to the five tools you need keeps the agent focused and reduces risk.
Explicit timeouts and output budgets
Codex documents defaults: startup_timeout_sec of 10 seconds and tool_timeout_sec of 60 seconds. You can mark a server required so startup fails if it cannot connect, and set an output_token_limit per tool.
Modern OAuth client registration
Codex supports OAuth Client ID Metadata Documents (CIMD) and Dynamic Client Registration (DCR), choosing CIMD when the server advertises it. You can set OAuth scopes per server. Our explainer on client ID metadata documents covers how CIMD works.
One config across OpenAI's local clients
OpenAI says the ChatGPT desktop app, Codex CLI and IDE extension "share MCP configuration," so you configure a server once and switch clients.
Pricing
Neither vendor charges extra for MCP. You pay for the plan that includes the agent.
| Tier | Claude Code (claude.com/pricing) | Codex (chatgpt.com/pricing) |
|---|---|---|
| Free | Not included | $0, "Limited Codex access" |
| Low tier | None | Go $8/month, limited Codex |
| Individual paid | Pro $17/month annual, $20 monthly | Plus $20/month |
| Heavy use | Max from $100/month | Pro from $100/month, "Longer Codex and ChatGPT Work sessions" |
| Teams | Team $20/seat/month annual ($25 monthly); Premium $100 ($125 monthly) | Business: price not shown on pages we opened |
| Enterprise | $20/seat/month annual, 20-seat minimum, plus API-rate usage | Contact sales |
| API key | Not covered on the pages we checked | Codex CLI, SDK or IDE at API prices, no cloud features, per Codex pricing |
Usage limits apply on both. OpenAI publishes estimated messages per five-hour window by model; Anthropic describes Max as 5x or 20x Pro usage.
Security and admin controls
| Control | Claude Code | Codex |
|---|---|---|
| Default | "Anyone running Claude Code can connect any MCP server they choose" | Users configure servers unless an admin requirement applies |
| Block everything | managed-mcp.json with an empty server map | Empty mcp_servers list in requirements.toml |
| Approved list | allowedMcpServers + allowManagedMcpServersOnly | mcp_servers identities matched on command or URL |
| Shared project config | Repo can't self-approve servers | Project config for trusted projects only |
| Secrets | Env var expansion in .mcp.json; OAuth tokens | bearer_token_env_var, env_http_headers; secrets in config.toml must stay private |
OpenAI's managed configuration docs say Codex rules match stdio servers on command and HTTP servers on url, with exact, prefix or regex matching. Anthropic's managed docs add that Claude Code "doesn't have a built-in MCP server registry," so publish your approved list where developers will find it. For the threats these controls address, see our MCP security risks guide.
Which to choose
- Pick Claude Code if you want approved servers committed to each repository and reviewed like code.
- Pick Claude Code if your admins want a menu of policies, from denylist only to a fixed deployment.
- Pick Claude Code if another tool needs to call your coding agent over MCP.
- Pick Codex if you want reads to run freely and writes to need approval, set per server or per tool.
- Pick Codex if your team already uses ChatGPT and wants one MCP config across the desktop app, CLI and IDE.
- Use either if your main need is GitHub, Sentry or a database server. Both support the same remote and local servers.
More developer matchups are in our MCP comparisons, and our best MCP servers for developers list covers what to connect first.
Next step
Choose three servers your developers need, connect them read-only in your preferred agent, and write down the approval rules you want. If you want help rolling out Claude Code with managed MCP settings, see our Claude Code consulting service.
Frequently asked questions
Can Claude Code and Codex use the same MCP servers?
Yes, in most cases. Both connect to local stdio servers and remote HTTP servers with OAuth. The config formats differ: JSON in .mcp.json for Claude Code, TOML in config.toml for Codex.
Can Codex run as an MCP server?
Not anymore. OpenAI says the codex mcp-server command was removed. Codex still connects to external MCP servers through codex mcp.
Is Codex free?
OpenAI's pricing page lists "Limited Codex access" on the Free plan and limited Codex on Go at $8 per month. Plus at $20 per month includes Codex in the CLI, IDE extension and web.
How do admins stop developers adding unapproved MCP servers?
In Claude Code, deploy managed-mcp.json or set allowedMcpServers with allowManagedMcpServersOnly: true. In Codex, add an approved mcp_servers list to requirements.toml; an empty list disables all MCP servers.











