Home/Docs/Agents/Codex

Connect Codex to Planwright

OpenAI Codex supports MCP configuration via a JSON config file or inline flag. The recommended path is OAuth — Codex opens a browser flow on first connect so audit records reflect the real human. Service tokens are for CI and headless agents that can't run a browser.

Setup

Pass the config inline via --mcp-config or point to a JSON file.

  1. 1Create a planwright-mcp.json file (or pass the config inline).
  2. 2Run Codex with --mcp-config planwright-mcp.json.
  3. 3On first tool call, your browser opens for GitHub login.
  4. 4Codex connects and the Planwright tools become available.

Configuration

// OAuth — recommended (zero config)
{
  "mcpServers": {
    "planwright": {
      "type": "sse",
      "url": "https://mcp.planwright.tools/sse"
    }
  }
}

# Then run:
codex --mcp-config planwright-mcp.json

// Service token — for CI or headless runs
// Generate a token at planwright.tools → Settings → MCP Token
{
  "mcpServers": {
    "planwright": {
      "type": "sse",
      "url": "https://mcp.planwright.tools/sse",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN"
      }
    }
  }
}

Verify the connection

Once Codex starts, ask it to:
"List my scheduled Planwright objectives"

Codex should call planwright_set_repo and
planwright_list_objectives and return the results.

Troubleshooting

Codex ignores the MCP config

Make sure you're using a version of Codex that supports --mcp-config. The flag was added in recent versions.

OAuth flow doesn't open a browser

If your Codex build doesn't yet support OAuth discovery, switch to the service-token config. Generate a token at Settings → MCP Token.