# Codex

> Connect OpenAI Codex to Korala with `codex mcp add` and a browser sign-in.

Source: https://docs.korala.ai/ai-agents/codex

---

  Screenshots of Codex will be added after the public launch. The steps below follow Codex's current documentation (checked 2026-09-18); menu names can change.

## Sign in

1. Add the server:

   ```bash
   codex mcp add korala --url https://api.korala.ai/mcp
   ```

2. Sign in:

   ```bash
   codex mcp login korala
   ```

3. Approve the connection on Korala's consent page. See [Permissions and safety](https://docs.korala.ai/ai-agents/permissions).

The first command writes this block to `~/.codex/config.toml`. You can add it by hand:

```toml
[mcp_servers.korala]
url = "https://api.korala.ai/mcp"
```

## API key alternative

For machines where nobody can open a browser, run the local `@korala/mcp` package with an API key:

```bash
codex mcp add korala-local \
  --env KORALA_API_KEY_ID=your-key-id \
  --env KORALA_API_SECRET=your-secret \
  -- npx -y @korala/mcp
```

[API key (CI and headless)](https://docs.korala.ai/ai-agents/api-key) lists the environment variables and explains what a test-mode key can reach.
