Integrations/Codex CLI

Set up Codex CLI

OpenAI’s terminal-based coding agent. Add Agentcy so Codex can access your marketing data while generating code, scripts, and reports from the command line.

SETUP
5 STEPS
  1. 01

    Sign up at app.goagentcy.com and create an API key

  2. 02

    Set your API key as an environment variable: export AGENTCY_API_KEY=agcy_your_key_here

  3. 03

    Create or edit ~/.codex/config.toml (global) or .codex/config.toml (project)

  4. 04

    Paste the config snippet below

  5. 05

    Restart Codex to load the new server

CONFIG

path: ~/.codex/config.toml

config.toml
[mcp_servers.agentcy]
url = "https://data.goagentcy.com/mcp"
bearer_token_env_var = "AGENTCY_API_KEY"
Last verified: March 5, 2026Official docs
TIPS

Requires a ChatGPT Plus, Pro, Business, Edu, or Enterprise plan. Codex CLI uses TOML for config (not JSON like most other clients). Uses bearer_token_env_var to read the API key from your environment — set AGENTCY_API_KEY before running. Project-scoped configs require the project to be in Codex’s trusted list.

EXPLORE DATA SOURCES

After connecting Codex CLI and configuring your data sources in the portal, ask questions about any of them in natural language:

View all data sources →

v1.0Need help?