Codex CLI

OpenAI's terminal agent. Servers are added with a command and stored in a TOML config.

Command line verified 2026-07-15

How to add a server to Codex CLI

  1. Open a terminal
  2. Run the codex mcp add command below
  3. Run codex mcp list to confirm

Where the configuration lives

Global~/.codex/config.toml

Local server configuration

codex mcp add {{name}} -- {{command}} {{argsPlain}}

Hosted server configuration

codex mcp add {{name}} --transport http {{url}}

Placeholders such as {{name}}, {{command}}, {{args}} and {{url}} are filled from each server's package or endpoint data.

Protocol support

Support is uneven across clients. A server that only exposes prompts is of no use in a client that does not implement them.

Transports
TransportSupported
stdioYes
Streamable HTTPYes
SSENo
Features
FeatureSupported
ToolsYes
ResourcesNo
PromptsNo
SamplingNo
RootsYes
ElicitationNo
OAuthYes

Official Codex CLI MCP documentation

Frequently asked questions

How do I add an MCP server to Codex CLI?
1. Open a terminal 2. Run the codex mcp add command below 3. Run codex mcp list to confirm
Where is the Codex CLI MCP configuration file?
global: ~/.codex/config.toml.
Can Codex CLI run a local MCP server?
Yes. It can start a local process and talk to it over stdio, so packaged servers work without any hosting.
Which parts of the protocol does Codex CLI not support?
It does not implement resources, prompts, sampling or elicitation. A server whose value is mostly in those features will feel incomplete here.
Does Codex CLI need restarting after adding a server?
No, it picks up the change without a restart.
When was this setup information last checked?
These details were verified on 2026-07-15. Clients change their configuration format from time to time, so check the official documentation if something does not work.

Other clients

Claude Desktop Claude Code Cursor Visual Studio Code Cline Windsurf