# Codex (/docs/mcp/connect/codex)

> Connect OmniDimension to Codex in one terminal command. OAuth sign-in via the browser, shared config across the Codex CLI, IDE extension, and the ChatGPT desktop app.

One command:

```bash
codex mcp add omnidim --url https://mcp.omnidim.io/mcp
```

Codex detects that the server supports OAuth and starts the sign-in flow immediately. A browser tab opens to the OmniDimension consent screen. Sign in, click Allow, and the terminal prints `Successfully logged in.`

## Verify [#verify]

```bash
codex mcp list
```

The `omnidim` row shows `enabled` with `OAuth` in the Auth column. Then, inside a Codex session, ask:

```
What OmniDimension agents do I have?
```

Codex will call `listAgents` and report your agent list. If you see your agents, you're set.

## ChatGPT desktop app and IDE extension [#chatgpt-desktop-app-and-ide-extension]

The Codex CLI, the Codex IDE extension, and the ChatGPT desktop app all read the same config at `~/.codex/config.toml`, so the one-command setup above covers all three. Configure once in the terminal and the connector shows up everywhere.

To add it from the desktop app UI instead:

1. Open **Settings**, then **MCP servers**.
2. Select **Add server**.
3. Name it `omnidim`, choose **Streamable HTTP**, and enter `https://mcp.omnidim.io/mcp`.
4. Save, then select **Restart**.
5. If the server list shows it needs sign-in, select **Authenticate** to open the OmniDimension consent screen.

## Config file [#config-file]

`codex mcp add` writes this block to `~/.codex/config.toml`. You can also add it by hand:

```toml
[mcp_servers.omnidim]
url = "https://mcp.omnidim.io/mcp"
```

To scope the server to a single project instead of your whole machine, put the same block in a `.codex/config.toml` inside the project (trusted projects only).

## Re-authenticate [#re-authenticate]

If the token expires or you signed in to the wrong account, run the OAuth flow again:

```bash
codex mcp login omnidim
```

## API key instead of OAuth [#api-key-instead-of-oauth]

For headless or CI use, run the [local stdio server](/docs/mcp/local-server) with an API key from [omnidim.io/api-management](https://omnidim.io/api-management):

```bash
codex mcp add omnidim-local --env OMNIDIM_API_KEY=sk_xxx -- npx -y @omnidim-ai/mcp-server
```

Note that the npm package's `setup` command does not auto-configure Codex; use the command above.

## Remove [#remove]

```bash
codex mcp remove omnidim
```

This deletes the local config. To also revoke the OAuth token on the server side, remove the corresponding credential at [omnidim.io/api-management](https://omnidim.io/api-management).