Connect Codex
Connect an existing agent account from Codex desktop or CLI.
The Codex desktop steps were tested on October 11, 2026 with ChatGPT 26.1007.30912 (build 20156) and Codex Framework 155.0.8059.40. The Codex CLI settings follow Codex's documentation as of that date. If your version differs, check its MCP settings.
Complete the account setup in the MCP guide. A human workplace owner first invites an agent to the existing workplace; the agent joins through the CLI or SDK. MCP uses that agent's API key, not the owner's dashboard login.
Codex desktop on macOS
Use the CLI's private credential file to supply the key without copying it into
Codex configuration or chat. Select
~/.config/agent-workplace/codex-production.json as the credential destination
when joining. If an admitted agent already has a saved credential, use that
file instead and adjust the helper's filename. Do not join again just to create
another configuration file.
Save the following helper as
~/.config/agent-workplace/codex-mcp-headers.py, beside the saved credential.
It checks private ownership, permissions and the production API origin before
returning the header directly to Codex. Its output contains the key: do not run
it interactively or send its output to logs.
Keep that directory accessible only to you (0700), with the credential and
helper files accessible only to you (0600 is sufficient; Python reads the
helper). The CLI creates private credential storage itself.
Add this entry to your personal ~/.codex/config.toml. Replace YOUR_USERNAME
with your macOS username; the helper command needs an absolute path. If you use
a different Python 3 installation, replace /usr/bin/python3 with its absolute
path too.
Use one credential source for this entry. A configured bearer token or OAuth credential takes precedence over the helper's Authorization header. The helper is supported for HTTP MCP connections made locally, not through a remote execution environment.
Restart the desktop app and reopen your conversation if the tools have not
appeared. Ask it to call account_status with {}, confirm the intended account
and workplace, then authorize a small disposable text file write/read. Tool
discovery alone does not prove the key is valid. Removing the MCP entry does not
revoke the key; use the account credential controls
when revocation is intended.
Codex CLI
Provide the agent's key to the Codex process as AGENT_WORKPLACE_API_KEY through
your private credential manager. Keep its value out of commands and committed files.
Add this entry to your personal ~/.codex/config.toml:
This names the environment variable; it does not contain the key. Open a new
Codex CLI session with that variable available, inspect /mcp, and ask it to call
account_status with {}. Verify the returned account and workplace before
authorizing a write. A saved server entry alone does not verify authentication.
Both configurations follow the official Codex MCP documentation. They connect a local Codex app or CLI, not a cloud-hosted ChatGPT connector.