Skip to content

Connect Codex CLI

Codex reads the connection key from an environment variable at connect time rather than from its config file, so setup is two steps.

Works with the Claude or Codex subscription you already have. We never bill you for AI usage — your plan covers captures.

Verified

Verified against Codex CLI 0.144.4: streamable HTTP, Authorization: Bearer …, and no Origin header, so it does not trip the browser-origin gate on /api/mcp. These are the exact commands PMM Tools' own key-management page (/private/mcp) generates for signed-in users, in production today.

  1. 1. Get a connection key

    Sign in to PMM Tools and open /private/mcp. Click “Generate key” and copy it — the raw key is shown once.

  2. 2. Add the server

    Run this in any terminal:

    codex mcp add pmm \
      --url 'https://www.pmmtools.com/api/mcp' \
      --bearer-token-env-var PMM_API_KEY

    It writes the server into ~/.codex/config.toml for you — safer than pasting, since a hand-added [table] header captures any settings below it. Drop one above an existing model = … and that key quietly becomes part of the server block.

  3. 3. Export your key

    With your own key in place of the placeholder:

    export PMM_API_KEY='pmm_live_YOUR_KEY'

    Codex reads PMM_API_KEY at connect time, so the key never lands in the config file. Put the export in your shell profile to persist it.

  4. 4. Verify the connection

    Start a Codex session and ask something that needs your data, e.g. “What competitors am I tracking in PMM Tools?” Codex should call pmm_competitor_list and answer from the result. Run codex mcp list to confirm the pmm server is configured.

Or edit the config by hand

This is exactly what codex mcp add writes. Add it at the END of ~/.codex/config.toml, below every top-level setting.

[mcp_servers.pmm]
url = "https://www.pmmtools.com/api/mcp"
bearer_token_env_var = "PMM_API_KEY"

See the full tool list and plan limits for what Codex can do once it's connected.