How It Works
Codex CLI uses a plan-execute-verify loop: it explains its plan, you approve, it executes, then verifies results. When your task involves advertising, Codex loads the ADSMCP agent config and skills to follow proven workflows.What Makes Codex Different
Codex has some unique characteristics compared to Claude Code and Cursor:- AGENTS.md — Codex uses
AGENTS.md(notCLAUDE.mdorBRAND.md) for persistent context - No memory file — Codex doesn’t support cross-session memory like Claude Code and Cursor
- No web research —
WebSearchandWebFetchare not available, so competitive research is done through ad platform data only - Safety rules —
.rulesfiles that block direct API calls to ad platforms, ensuring everything goes through ADSMCP’s authenticated pipeline - Dollar-sign commands — Skills are invoked with
$adsmcp-*syntax
What Gets Installed
The one-command installer sets up everything:
Plugin Marketplace (Recommended)
/plugins → navigate to the ADSMCP tab → select ADSMCP Ads Agent → press Enter to install. OAuth runs automatically on first use.
Shell Installer
codex mcp login adsmcp to authenticate.
Manual Install
The 5 Skills
Codex uses the same Agent Skills standard as Claude Code. Each skill is aSKILL.md file with YAML frontmatter and workflow instructions.
How Skills Work in Codex
- Codex discovers skills from
~/.agents/skills/automatically - Progressive disclosure: metadata loads first, full
SKILL.mdloads when the skill is needed - Invoke explicitly with
$adsmcp-*or let Codex match automatically from your description - Skills use generic verbs (“Search”, “Crawl”) instead of tool-specific names since Codex doesn’t have
WebSearch/WebFetch
Sign up for ADSMCP — free to start 15 free tool calls/month. No credit card required. Connect your ad accounts in 2 minutes.
Codex-Specific Adaptations
The Codex versions of ADSMCP skills are adapted from the same source templates as Claude Code and Cursor, with these differences:Safety Rules
Codex uses.rules files to enforce safety at a deeper level than skills. The campaign-safety.rules file blocks direct API calls to ad platforms:
curl commands.
Full Safety Stack
Context Files
Codex uses two persistent files (no memory file).AGENTS.md — Brand Context
Created by$adsmcp-setup. This is Codex’s equivalent of CLAUDE.md (Claude Code) and BRAND.md (Cursor).
Codex uses a hierarchical AGENTS.md loading system:
- Global:
~/.codex/AGENTS.md(applies to all projects) - Project: Walks from git root to current directory, merging each level
- Maximum combined size: 32 KiB
STRATEGY.md — Strategic Decisions
Same as Claude Code and Cursor. Persists directives across sessions:[!NOTE] Since Codex doesn’t have a memory file,STRATEGY.mdandAGENTS.mdare the primary ways to persist context across sessions. Put anything you want the agent to remember in these files.
The Agent Loop
When you invoke$adsmcp-performance-review in Codex:
1. Skill loads
Codex discovers and loads the performance review skill via progressive disclosure.
2. Context loads
Reads AGENTS.md for brand context and KPI targets. Reads STRATEGY.md for active directives.
3. Connections check
Calls get_connections_status to identify connected ad platforms.
4. Data pull
For each connected platform, calls performance tools via ADSMCP MCP.
5. Strategy check
Compares campaign data against STRATEGY.md. Flags “Strategy Drift” items.
6. Results
Presents a unified scorecard with recommendations and top 3 actions.
Approval Modes
Codex has 3 approval modes that affect how the agent interacts:
For advertising tasks, Auto mode works well — you get automatic approvals for read operations and prompted for spend-affecting actions.
Comparison with Other Clients
FAQ
Why doesn’t Codex have memory? Codex CLI doesn’t support a persistent memory file like Claude Code’sMEMORY.md. UseAGENTS.mdandSTRATEGY.mdto persist important context. The agent will record decisions and findings inSTRATEGY.mdwhen you confirm them.
Can the agent do competitive research without WebSearch? The Codex agent can’t crawl websites or search the web. It relies on ADSMCP’s ad platform data (search terms, keyword volumes, campaign performance, benchmarks) for insights. For competitive research, use Claude Code or Cursor instead.
What are safety rules? Codex.rulesfiles block specific command patterns. ADSMCP’scampaign-safety.rulesprevents directcurlor API calls to Google Ads, Meta, LinkedIn, and TikTok APIs. This ensures all operations go through ADSMCP’s authenticated pipeline with proper OAuth, audit logging, and safety checks.
Can I use Codex as an MCP server for other agents? Yes. Codex CLI can expose itself as an MCP server for the OpenAI Agents SDK. This means you can build higher-level agents that delegate advertising tasks to Codex + ADSMCP. See the Codex Agents SDK guide.
Related Documentation
- Claude Code Agent — How ADSMCP works in Claude Code
- Cursor Agent — How ADSMCP works in Cursor
- Performance Marketing Agent — Architecture overview
- Skill Reference — All 5 skills with invocation details
- Codex Setup — Installation guide
- Prompt Engineering Playbook — A custom skill, account dossier, and prompt book generated from your own ad account ($39 one-time, one free on annual)