Skip to main content
Watch: I Built an AI App Without Leaving Databricks

MCP client - OpenAI - verified

How to add an MCP server to OpenAI Codex CLI

Where to add MCP servers in OpenAI Codex CLI: ~/.codex/config.toml, or a project-scoped .codex/config.toml in trusted projects; add servers with codex mcp add. Its docs list support for stdio and Streamable HTTP. They do not state SSE. It handles OAuth sign-in for remote servers.

OpenAI Codex CLI homepage - Codex CLI in our tools directory - Compare all MCP clients

Kind
Coding agent
stdio
Yes
Streamable HTTP
Yes
SSE
Not stated

Add a server

Where the config lives
~/.codex/config.toml, or a project-scoped .codex/config.toml in trusted projects; add servers with codex mcp add

The example from the OpenAI Codex CLI docs, copied verbatim. Swap in your server's name, command or URL.

TOML
[mcp_servers.example]
url = "https://mcp.example.com"

[mcp_servers.example.oauth]
client_id = "my-client"
callback_url = "http://127.0.0.1/callback"

Source: learn.chatgpt.com/docs/extend/mcp

Which server?

Pick a server from the verified directory of official MCP servers. Each one lists its transport, auth and the setup snippets its vendor publishes, so you can match it to what OpenAI Codex CLI supports.

MCP support

What the OpenAI Codex CLI docs say it supports. Not stated means the docs do not say either way.

OpenAI Codex CLI MCP features, transports and OAuth, each with its source
FeatureValueSource
ToolsCalls the functions a server exposes.Yeslearn.chatgpt.com/docs/extend/mcp
ResourcesReads data and files a server exposes as resources.Not statedDocs do not say
PromptsOffers a server's prompt templates to the user.Not statedDocs do not say
SamplingLets a server ask the client's model for a completion.Not statedDocs do not say
RootsTells a server which directories it may work in.Not statedDocs do not say
ElicitationLets a server ask the user for input mid-task.Yeslearn.chatgpt.com/docs/config-file/config-reference
DiscoveryPicks up tools, prompts or resources a server adds or removes while connected.Not statedDocs do not say
InstructionsUses the instructions a server sends when it connects.Yeslearn.chatgpt.com/docs/extend/mcp
stdioStarts a local server as a subprocess.Yeslearn.chatgpt.com/docs/extend/mcp
Streamable HTTPConnects to a remote server over the current HTTP transport.Yeslearn.chatgpt.com/docs/extend/mcp
SSEConnects over the older HTTP+SSE transport.Not statedDocs do not say
OAuthSigns in to remote servers with OAuth.Yeslearn.chatgpt.com/docs/extend/mcp

Worth knowing

The Codex CLI, the IDE extension and the ChatGPT desktop app share the same MCP configuration on a Codex host.

FAQ

Where is the OpenAI Codex CLI MCP config?

~/.codex/config.toml, or a project-scoped .codex/config.toml in trusted projects; add servers with codex mcp add. The example on this page is copied from https://learn.chatgpt.com/docs/extend/mcp

Does OpenAI Codex CLI support remote MCP servers over Streamable HTTP?

Yes, per https://learn.chatgpt.com/docs/extend/mcp. Its docs list support for stdio and Streamable HTTP. They do not state SSE.

Does OpenAI Codex CLI support OAuth for MCP servers?

Yes. It handles OAuth sign-in for remote servers. Source: https://learn.chatgpt.com/docs/extend/mcp

Which MCP features does OpenAI Codex CLI support?

Its docs list Tools, Elicitation and Instructions. They do not state Resources, Prompts, Sampling, Roots and Discovery.

Sources

Last verified from the pages below.

Newsletter

New MCP servers, the week they ship

One email per week. New official MCP servers, the coding tools that support them and how developers wire them up.