Skip to main content
Add the server:
Then sign in:
This writes the following to ~/.codex/config.toml:
~/.codex/config.toml
To use an API key instead of OAuth, read it from an environment variable:
~/.codex/config.toml
Codex’s MCP documentation covers the file format. For what each credential means, and what to do when connecting fails, see Setup.