Connect Codex
Codex shares one MCP configuration across its CLI and IDE extension. Add the HTTP endpoint to `config.toml` and both pick it up.
How do I connect an MCP server to Codex?
Append an `[mcp_servers.<name>]` block with your server’s `url` to `~/.codex/config.toml` and restart. The Codex CLI and IDE extension share that single MCP configuration, so both pick up the server at once.
Setup
- Open `~/.codex/config.toml` (or `.codex/config.toml` in your project).
- Append the block below with your deployment URL.
- Restart the Codex CLI or reload the extension.
[mcp_servers.my-server]
url = "https://my-server.mcp.cloud/mcp"Verify the connection
Start Codex and confirm the server’s tools are offered in a session.
Troubleshooting
TOML syntax error.
Ensure the table header `[mcp_servers.my-server]` is on its own line above `url`.
Connect another client
Claude Code
Add your MCP server to Claude Code from the terminal.
Claude Desktop
Connect Claude Desktop to a remote MCP server over a stdio bridge.
Cursor
Point Cursor at a remote MCP server.
VS Code
Add a remote MCP server to VS Code.
Windsurf
Connect Windsurf to a remote MCP server.
Antigravity
Add a remote MCP server to Antigravity.
ChatGPT
Add your MCP server to ChatGPT as a custom connector.
Gemini CLI
Add a remote MCP server to the Gemini CLI.