OpenAI Codex reads MCP server configuration from ~/.codex/config.toml. There are two ways to wire up Display.dev.
If you're using Claude Desktop or Claude.ai web instead, the OAuth-based Custom connector flow is the recommended setup. Codex uses the static API-key path described below.
Option 1 — Remote MCP (recommended)
-
Generate an API key at app.display.dev/keys. Keys start with
sk_live_…. -
Set
DISPLAYDEV_API_KEY=sk_live_...in your shell profile. Codex reads it on session start; staticAuthorizationheaders can't be inlined inconfig.toml. -
Add to
~/.codex/config.toml:[mcp_servers.display] url = "/v1/mcp" bearer_token_env_var = "DISPLAYDEV_API_KEY" -
Exit the Codex session (Ctrl+D or
/exit) and start a new one. Codex caches MCP server registrations at session start; hot-reload is not supported.
Option 2 — Local stdio
If you already have the CLI (npm install -g @displaydev/cli + dsp login):
[mcp_servers.display]
command = "dsp"
args = ["mcp"]To point at a non-production environment, add an env sub-table:
[mcp_servers.display]
command = "dsp"
args = ["mcp"]
[mcp_servers.display.env]
DISPLAYDEV_API_URL = "https://api.staging.display.dev"Approval prompt
Codex prompts before invoking a new MCP tool the first time, depending on your approval_policy (default: on-request). Approve once and Codex remembers the decision for the session. To skip the prompt for display specifically, set default_tools_approval_mode = "never" under [mcp_servers.display].