Connect Codex

Add the onefold MCP server to the Codex CLI and sign in.

Codex signs in. There is nothing to register and no secret to paste.

Supports sign-inYes. It identifies itself with a Client ID Metadata Document
Server addresshttps://onefold.eitozx.com/api/mcp
Configurationcodex mcp add, stored in ~/.codex/config.toml

Add the server and sign in

codex mcp add onefold --url https://onefold.eitozx.com/api/mcp

codex mcp add starts the sign-in itself and opens your browser.

The first browser tab reports invalid_scope

Codex first asks for scopes this server does not grant to an MCP client, and that tab ends with OAuth provider returned invalid_scope. Leave the command running. It prints Retrying without scopes… and opens a second tab, which is the one to sign in on.

On the second tab, sign in, then choose Authorize on the consent screen, which names Codex and lists what it is asking for. The terminal prints Successfully logged in.

To skip the first attempt, or to sign in again later, name the scopes yourself:

codex mcp login onefold --scopes developer:read,developer:write

For a read-only connection, pass developer:read alone.

Verify

codex mcp list

The Auth column reads OAuth after a sign-in and Not logged in before one.

Then start codex, type /mcp to see the server and its tools, and ask it to list your onefold applications.

Use an agent credential instead

Create an agent credential. Codex reads it from an environment variable, so it is never written to the configuration file:

codex mcp add onefold --url https://onefold.eitozx.com/api/mcp \
  --bearer-token-env-var ONEFOLD_MCP_CREDENTIAL
~/.codex/config.toml
[mcp_servers.onefold]
url = "https://onefold.eitozx.com/api/mcp"
bearer_token_env_var = "ONEFOLD_MCP_CREDENTIAL"

To put the header in the file instead, write the entry yourself. codex mcp add has no flag for it, and the credential is then stored in the file:

~/.codex/config.toml
[mcp_servers.onefold]
url = "https://onefold.eitozx.com/api/mcp"
http_headers = { Authorization = "Bearer eitozx_dev_YOUR_CREDENTIAL" }

Disconnect and reconnect

Choose Disconnect on the Codex card on the Agents tab of an application it reaches. The next tool call in Codex fails with Authentication required. Run codex mcp login onefold with --scopes to connect again; you are asked to approve it again.

To clear the client's side:

codex mcp logout onefold
codex mcp remove onefold

Limitations

  • The first sign-in attempt from codex mcp add fails with invalid_scope before Codex retries.
  • A tool call needs a Codex session, which needs you signed in to Codex.

Status: verified with Codex CLI 0.160.0

Sign-in from codex mcp add and from codex mcp login --scopes, a tool call, the client listed in the portal, and Authentication required after Disconnect. An agent credential in http_headers: connection and a tool call. The environment-variable form, a read-only sign-in and the documentation server are not checked. Commands and configuration keys checked against OpenAI's Codex MCP documentation on 2026-11-25.

On this page