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.
Pass the config inline via --mcp-config or point to a JSON file.
// 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"
}
}
}
}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.
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.