Skip to content

OpenAI Codex CLI

Checked on 2026-11-06 against Codex docs: MCP, build skills and the codex mcp source. An API key header is supported.

Create a key (how), then add this to ~/.codex/config.toml (or .codex/config.toml in a trusted project):

[mcp_servers.crossmart]
url = "https://mcp.crossmart.io/mcp"
env_http_headers = { "x-api-key" = "CROSSMART_API_KEY" }

env_http_headers maps a header to the name of an environment variable, so the key stays out of the file. Export it before starting Codex:

Terminal window
export CROSSMART_API_KEY="cm_…"

Alternatives: http_headers = { "x-api-key" = "cm_…" } holds the key itself, and bearer_token_env_var = "CROSSMART_API_KEY" sends it as Authorization: Bearer. The CLI form uses the bearer variant:

Terminal window
codex mcp add crossmart --url https://mcp.crossmart.io/mcp --bearer-token-env-var CROSSMART_API_KEY
Terminal window
codex mcp list

In a session, /mcp lists crossmart and its tools.

Terminal window
git clone --depth 1 https://github.com/crossmart-io/crossmart.git /tmp/crossmart
cp -R /tmp/crossmart/skills/crossmart ~/.agents/skills/ # or .agents/skills/ in a repository

The repository is private for now; see the Crossmart skill.