# Connect Codex

> Add a Genesis project to the OpenAI Codex CLI on your computer and build it on your own subscription, with the same tools and checks as Claude.

Source: https://support.estage.com/claude-code-codex
Part of the ESTAGE Support help center (https://support.estage.com). Full knowledge base: https://support.estage.com/llms-full.txt

---

You can connect a Genesis project to **OpenAI Codex** on your computer and let it build that
project: edit pages, generate images, add a backend, publish. The connection covers one project,
you approve it in your browser, and you can revoke it at any time. Codex runs on **your own
subscription**, so heavy building doesn't spend your Genesis credits.

Codex uses the **same** Genesis server, the **same** tools and the **same** safety checks as
[Claude](https://support.estage.com/claude-code). Only the setup differs. To work from ChatGPT in the browser instead, with
nothing installed, see [Connect ChatGPT](https://support.estage.com/claude-code-chatgpt).

> **Caution: Beta**
>
> This is an early, evolving feature. A couple of steps (order-form products and payment methods)
> still happen in the builder — see [Limits & good to know](https://support.estage.com/claude-code#limits--good-to-know).

## Connecting a project

Everything starts in **Account → [Integrations](https://knowledge.estage.com/account/integrations/) → Coding agents**:

1. Pick the project from the **Project** dropdown.
2. Open the **Codex** tab. It gives you two commands, already filled in with your project ID:

```bash
codex mcp add genesis-73891 --url https://genesis.estage.com/api/agent/73891/mcp
codex mcp login genesis-73891
```

3. Run the first command. It registers the project as an MCP server called `genesis-73891`. Keep
   the project ID in the name, so several projects stay apart.
4. Run the second command. It opens your browser: **sign in** to Genesis and select **Allow
   access** on the consent screen. Codex stores the result itself; nothing is pasted into a config
   file.

Check it landed with `codex mcp list`. To sign out again: `codex mcp logout genesis-73891`.

Inside the builder, the header's **⋯** menu has **Connect an agent** for the project you have open,
with the same commands ready to copy.

> **Note**
>
> This needs **Codex CLI 0.100 or newer** (one that has `codex mcp login`). On an older version, or on
> a machine with no browser, use [a scoped token](#no-browser-a-scoped-token-instead) instead.

Repeat both commands per project, each with its own name and URL.

A project with several apps (a website and a Web app, for example) needs one connection per app.
Pick the app under **App** before you copy the commands; the server name and the URL then carry
the app, for example `genesis-79035-jenesis-os` and `…/api/agent/79035/mcp?surface=jenesis-os`.
See [A project with several apps](https://support.estage.com/claude-code#a-project-with-several-apps).

## No browser? A scoped token instead

1. On the **Codex** tab, under **Or: a scoped token**, optionally give it a **Label** and select
   **Generate token**. The token is shown **once** — copy it right away.
2. Append this block to `~/.codex/config.toml` (create the file if it isn't there):

```toml
[mcp_servers.genesis-73891]
url = "https://genesis.estage.com/api/agent/73891/mcp"
bearer_token_env_var = "GENESIS_AGENT_TOKEN"
startup_timeout_sec = 30
tool_timeout_sec = 300
```

3. The token stays **out of the file** — Codex reads it from an environment variable. Export it in
   the shell you start `codex` from (add the line to your `~/.zshrc` / `~/.bashrc` to make it
   stick):

```bash
export GENESIS_AGENT_TOKEN=YOUR_ONE_TIME_TOKEN
codex mcp list
```

`codex mcp list` should show `genesis-73891`. One block per project — repeat it with the next
project's ID and its own token. Manage or **Revoke** tokens in the **Active tokens** list on the
same screen.

## First message of every new session

Codex can be tempted to work on local files on its own, so start a new chat by pointing it at the
connection. The builder's **⋯ → Connect an agent** gives you a first-message line, prefilled with
your project ID (the **Codex** tab shows it too, once you generate a token). Send it as the first
message of each new session.

## Codex in the cloud

Codex tasks that run in the cloud at chatgpt.com/codex don't use this setup. Whether those tasks
can use a custom connector is up to OpenAI. ChatGPT chats in the browser can — see
[Connect ChatGPT](https://support.estage.com/claude-code-chatgpt).

## Things worth knowing

- **What Codex can do** in the project is the same list as for Claude — see
  [What your agent can do in your project](https://support.estage.com/claude-code#what-your-agent-can-do-in-your-project).
- **Say which project you mean** when several are connected — see
  [Working across several connected projects](https://support.estage.com/claude-code#working-across-several-connected-projects).
- **Share selection** in the builder works for Codex too — see
  [Point the agent at what you're looking at](https://support.estage.com/claude-code#point-the-agent-at-what-youre-looking-at).
- **Disconnecting** and the safety rules are on
  [Connect Claude](https://support.estage.com/claude-code#managing--revoking-connections).

Related: [Connect Claude](https://support.estage.com/claude-code) · [Connect ChatGPT](https://support.estage.com/claude-code-chatgpt)
