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.
- 01
Sign up at app.goagentcy.com and create an API key
- 02
Set your API key as an environment variable: export AGENTCY_API_KEY=agcy_your_key_here
- 03
Create or edit ~/.codex/config.toml (global) or .codex/config.toml (project)
- 04
Paste the config snippet below
- 05
Restart Codex to load the new server
path: ~/.codex/config.toml
[mcp_servers.agentcy]
url = "https://data.goagentcy.com/mcp"
bearer_token_env_var = "AGENTCY_API_KEY"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.
After connecting Codex CLI and configuring your data sources in the portal, ask questions about any of them in natural language: