# Codex Setup

Source checked: 2026-07-24
Official source: https://developers.openai.com/codex/mcp

Codex Desktop, the CLI, and the IDE extension share MCP configuration on the same host. Use the complete Secure server address shown by Core during onboarding, including `?setup_attempt=...`. Outside onboarding, use `https://core.gradien.ai/mcp/continuity`.

## Add Core

Open `~/.codex/config.toml`, or a trusted project's `.codex/config.toml`, and add:

```toml
[mcp_servers.core]
url = "<secure-server-address>"
auth = "oauth"
```

Then run:

```bash
codex mcp login core
codex mcp list
```

Approve Core in the browser, then restart Codex or open a fresh task so the tools load. A localhost callback after approval is normal because Codex receives the one-time OAuth code on the local machine.

Do not add a custom OAuth resource or narrow Core's scopes. Codex reads the protected-resource metadata and prefers the server-advertised scopes.

If a fresh Codex task still reports authentication required, run `codex mcp logout core`, then `codex mcp login core` once. Do not extract or edit Codex's stored OAuth tokens.
