
# Connect Codex

## OAuth browser sign-in

Sign in with your Reconstruct account in the browser. You do not need to create a personal token on the Platform. See [MCP OAuth setup](../connect-ai-agents.md#oauth-browser-sign-in) for the shared connection settings.

Use a current Codex version that supports `--oauth-client-id`. The global callback port also applies to other OAuth MCP servers. Set a fixed callback port in your user `~/.codex/config.toml` before adding the server:

```toml
mcp_oauth_callback_port = 4321
```

```sh
codex mcp add reconstruct --url https://reconstruct.dev/mcp --oauth-client-id reconstruct-mcp
codex mcp login reconstruct --scopes openid,aud-mcp
```

The registered callback is `http://127.0.0.1:4321/callback`. Follow the browser sign-in and consent screen. Remove any `bearer_token_env_var` from this server's configuration when choosing OAuth. See the [official Codex MCP configuration](https://learn.chatgpt.com/docs/extend/mcp).

## Personal access token

Copy your MCP access token from your [Reconstruct Platform account settings](https://reconstruct.dev/platform/). See [Personal access token](../connect-ai-agents.md#personal-access-token) for the connection requirements. Set `CR_RECONSTRUCT_MCP_TOKEN` in the environment that launches Codex.

Add this to your user `~/.codex/config.toml`:

```toml
[mcp_servers.reconstruct]
url = "https://reconstruct.dev/mcp"
bearer_token_env_var = "CR_RECONSTRUCT_MCP_TOKEN"
```

Start a new Codex session, run `codex mcp list` to verify the server is registered, and ask Codex to call `list_products` to confirm access. See the [official Codex MCP configuration](https://learn.chatgpt.com/docs/extend/mcp).

Next, try the [prompt examples](../prompt-examples.md).
