Skip to content

Codex

Configure OpenAI Codex to publish artifacts via the Display.dev MCP server.

On this page

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.

  1. Generate an API key at app.display.dev/keys. Keys start with sk_live_….

  2. Set DISPLAYDEV_API_KEY=sk_live_... in your shell profile. Codex reads it on session start; static Authorization headers can't be inlined in config.toml.

  3. Add to ~/.codex/config.toml:

    toml
    [mcp_servers.display]
    url = "/v1/mcp"
    bearer_token_env_var = "DISPLAYDEV_API_KEY"
  4. 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):

toml
[mcp_servers.display]
command = "dsp"
args = ["mcp"]

To point at a non-production environment, add an env sub-table:

toml
[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].

Was this page helpful?