OpenAI Codex
Connect from OpenAI Codex
Codex CLI supports remote MCP servers with custom headers natively via a TOML config file.
Configuration File
Edit or create the Codex config:
- User-global:
~/.codex/config.toml - Project-scoped:
.codex/config.toml(in project root)
Using an Environment Variable (Recommended)
Then set the environment variable:
Using a Static Key
Verify Connection
Notes
- Project-scoped config requires the project to be trusted by Codex.
- You can set
default_tools_approval_mode = "auto"to skip per-tool confirmation prompts.

