MCP: Codex
Connect Codex to your workshop so it can read your sources of truth and propose new ones. The Codex CLI,
the Codex IDE extension and the ChatGPT desktop app share one MCP configuration,
~/.codex/config.toml, so set it up once in any of them.
Prerequisites
- Codex 0.167 or later. Older versions, such as 0.159, can show the OpenX server as failed.
- A way to sign in. Codex can sign in through the browser, with no key (see "Sign in through the browser" below). For a key instead, open APIs -> OpenX MCP Server, choose just this workspace, and mint one. A key from APIs -> API Keys is a team key for the REST API, and the MCP server does not take one. See Connecting to the OpenX MCP Server.
- With a key, the workspace's own address,
https://openx.fathym.com/ox-api/mcp/w/<workspace id>, shown in that window. A key works only there, so the setups below that carry a key use it.
Sign in through the browser
Add the server by its address, with no key, then sign in:
codex mcp add openx --url https://openx.fathym.com/ox-api/mcp
codex mcp login openx
codex mcp login opens the browser. You sign in with OpenX, pick the workspace, and tick the rights
to share with the connection. There's no key to generate, store or rotate, and the connection is
re-checked at each refresh, so removing someone from the workspace cuts their access.
Or use an MCP key
Fastest - fai mcp install configures Codex (and your other detected agents) in one command:
fai mcp install https://openx.fathym.com/ox-api/mcp/w/<workspace id> --name openx --global --auth "YOUR_MCP_KEY"
That writes an [mcp_servers.openx] table to ~/.codex/config.toml with your URL and the key in an
Authorization header.
Or use Codex directly, and keep the key out of the file. Codex reads it from an environment variable each time it connects:
export OPENX_MCP_KEY="YOUR_MCP_KEY"
codex mcp add openx --url https://openx.fathym.com/ox-api/mcp/w/<workspace id> \
--bearer-token-env-var OPENX_MCP_KEY
In PowerShell, set the variable with $env: and keep the command on one line:
$env:OPENX_MCP_KEY = "YOUR_MCP_KEY"
codex mcp add openx --url https://openx.fathym.com/ox-api/mcp/w/<workspace id> --bearer-token-env-var OPENX_MCP_KEY
That writes:
[mcp_servers.openx]
url = "https://openx.fathym.com/ox-api/mcp/w/<workspace id>"
bearer_token_env_var = "OPENX_MCP_KEY"
Set OPENX_MCP_KEY wherever Codex runs (your shell profile, for instance). Codex sends it as
Authorization: Bearer on every request.
Codex only sees the variable if it was set before Codex started, and closing Codex isn't enough:
it keeps a background app server running. After setting the key, stop that server, then start Codex
again from a shell where OPENX_MCP_KEY is set:
codex app-server daemon stop
If that server started before you set the key, openx shows as failed with no tools until you stop it.
Verify
In your terminal, not inside Codex, run codex mcp list: openx is listed with its address and how it
signs in. Inside Codex, /mcp
shows the active servers. Every tool is listed in OpenX MCP Server tools.
Use it
Ask in plain language: "What were the average signups per hour today?" Codex calls call_api against
your saved source of truth. To build, it proposes via manage_proposals; you accept in the
workspace - there is no accept tool over MCP.
Notes
- MCP calls are not written to your workshop's change history today.
- Key stopped working? An MCP key stops when it is revoked in the OpenX MCP Server window or reaches
the end of the lifetime you picked. Mint a new one under APIs -> OpenX MCP Server and update
OPENX_MCP_KEY(or re-run the install). A request that carries a key and gets401back is almost always a stale key, not a server fault. A key from APIs -> API Keys is refused the same way. - A project can have its own
.codex/config.toml, which Codex reads only in projects you trust. Keep keys out of it: it may be committed.
On fathym.com: Connect your AI to OpenX →