Skip to content
Clone-Me
DocsConnecting Codex

Connecting Codex

Codex connects with a connection token. The Codex CLI, the Codex IDE extension and the Codex desktop app share the same config files, so one setup works in all three.

Before you start

The automatic setup command uses Codex CLI. Install it first and check codex --version in your terminal. The IDE extension and desktop app share the resulting connection settings. To set up without the CLI, follow the manual steps below.

Steps

  1. Choose Codex in the console

    In the console, go to Connections → Add connection and choose Codex.

  2. Check the connection name and get a token

    The name is already "Codex". Select Verify and issue token. If you have not signed in within the last 10 minutes, you confirm it is you once more with an email code.

  3. Copy the command and paste it into the terminal

    Select Copy command in the console. Paste it into the terminal and press Enter. The console first shows the command for your browser's operating system (macOS·Linux or Windows).

  4. Paste the token when asked

    Select Copy token in the console. Paste it into the terminal and press Enter. The pasted text stays hidden. That is normal.

    When it works, the terminal shows this.

    ✓ Saved.
      Token: ~/.codex/.env
      Server address: ~/.codex/config.toml
    Now start codex again, and restart the IDE extension or the desktop app.
    
  5. Start Codex again

    Run codex again in the terminal. Restart the IDE extension and the desktop app. Codex connects to Clone-Me as it starts, and the console's connection check changes to "Connected".

What the command does

  1. It saves the token as one line, CLONEME_TOKEN=…, in ~/.codex/.env. It keeps the other lines of the file and makes the file readable only by you (permission 600).
  2. It runs codex mcp add cloneme --url … --bearer-token-env-var CLONEME_TOKEN to add or replace the Clone-Me server settings in ~/.codex/config.toml. It asks before replacing an existing connection. Other server settings stay intact.
  3. If you use CODEX_HOME, it saves to that folder.
[mcp_servers.cloneme]
url = "https://clonememcp.102labs.com/mcp"
bearer_token_env_var = "CLONEME_TOKEN"

When Codex starts, it reads ~/.codex/.env and sends the value of the variable named by bearer_token_env_var as the Authorization: Bearer header. So the IDE extension and the desktop app use the same token without putting it in your shell config. The value in .env wins over a shell variable of the same name.

Set it up by hand

  1. Update the existing Clone-Me entry in ~/.codex/config.toml to match the settings above. Add it only if it is missing. [mcp_servers."cloneme"] refers to the same entry; do not add a duplicate.
  2. Put the line CLONEME_TOKEN=(connection token) in ~/.codex/.env.
  3. Run chmod 600 ~/.codex/.env so that only you can read it.

Check the registration

  • In Codex, type /mcp to see the status and tools of cloneme.
  • codex mcp list only shows whether it is registered. It does not test the connection.

Windows and WSL

  • The Windows command saves to %USERPROFILE%\.codex. If you use CODEX_HOME, it saves to that folder.
  • codex inside WSL does not read the Windows config files. Run the macOS·Linux command in a WSL terminal.

Help Codex use Clone-Me

Add a line like this to your project's AGENTS.md, and Codex uses Clone-Me more often.

Before deciding a choice that depends on my taste, standards or way of working, check with cloneme's ask_me first.

If it does not work

What you seeWhat to do
Environment variable CLONEME_TOKEN … is not setMake sure the command ran to ✓ Saved. Check that ~/.codex/.env has the CLONEME_TOKEN line, then restart Codex.
401 or invalid_tokenThe token was pasted wrong or has expired or been revoked. Issue a new token on the connection details page and run the same command again.
Codex doesn't show the Clone-Me toolsCheck the status with /mcp in Codex. The IDE extension and the desktop app read the settings only after a restart.

See Troubleshooting for more.

Last updated Oct 28, 2026