Add Sprites to Codex
Available on Anywhere Codex CLI runs — a ChatGPT plan that includes Codex, or an API key. You need a Sprites account with Meta Ads already connected — the connector acts on that connection, so Codex never handles a Meta credential.
Add the server
One command writes the entry into ~/.codex/config.toml for you.
Terminalcodex mcp add sprites --url https://mcp.sprites.ai/mcpOr write the config by hand
The same entry in ~/.codex/config.toml, or in .codex/config.toml inside a trusted project when you want the connector scoped to one repo.
~/.codex/config.toml[mcp_servers.sprites] url = "https://mcp.sprites.ai/mcp" auth = "oauth"Sign in
Codex opens a browser for the Sprites consent screen and stores the token locally. Sprites supports dynamic client registration and client ID metadata documents, so there is nothing to pre-register.
Terminalcodex mcp login spritesApprove changes by name
Codex renders results as text, so a pending change comes back written out rather than as a card you can click. Nothing is applied until you approve it, and the approval waits for you in Sprites — open it there and the same run continues.
Pending changeChangeDaily budget $40 → $65Gategate_7f2c…
Official Meta Ads MCP vs Sprites MCP
Meta runs its own MCP server at https://mcp.facebook.com/ads. Here is what each one covers, so you can pick the one that fits in Codex — or connect both.
Meta hosts its own Ads MCP server as part of its ads AI connectors, alongside an Ads CLI for the terminal. You add it to ChatGPT, Claude or any MCP client as a custom connector and sign in with your Facebook Business login. It covers reporting, creating and editing campaigns, ad sets and ads, catalogs, datasets, A/B tests and conversion lift studies — on Meta, and only Meta.
| Meta officialhttps://mcp.facebook.com/ads | Sprites MCPapproval-gated | |
|---|---|---|
| Endpoint | mcp.facebook.com/ads | mcp.sprites.ai/mcp |
| Channels | Facebook and Instagram | Meta plus Google Ads, LinkedIn, TikTok, Reddit, GA4, Shopify, SEO and more — one connector |
| Setup in ChatGPT | Developer-mode app, Facebook Business sign-in | Developer-mode app, Sprites sign-in — Meta is connected once inside Sprites |
| Writes | New campaigns, ad sets and ads created paused; activation confirmed in your AI client | Proposed as an editable card with before and after; applied only on approve |
| New creative | Builds ads from creative you already have | Drafts hooks, headlines and image concepts, previewed in the placement |
| Competitor ads | Your own ad accounts only | Live ads from any advertiser in the Meta Ad Library |
| Analysis | Insights returned as data for the model to read | A Meta specialist reads fatigue, frequency and learning phase before answering |
| Catalogs, datasets, lift studies | Yes — its strongest ground | Not the focus: campaigns, creative and budget are |
If you only want to read Meta campaign data in ChatGPT, or you manage catalogs and lift studies, Meta’s official connector may be enough. Use Sprites when you run more than Meta, want new creative drafted rather than just managed, want competitor ads in the same thread, or need every write staged as an approval your team can see before it spends.
Why run Meta ads through Sprites
Codex is the interface; the connector decides what it can see and what it is allowed to do. Six things change when that connector is Sprites.
Advice that sees every channel
A Meta-only connector can only ever answer with Meta. Sprites reads Meta beside Google Ads, TikTok, LinkedIn, Reddit, GA4 and Shopify, so it can say the next $1,000 earns more on Google search than on a tired prospecting ad set — and propose the move as one approval.
Every channel on one connectorNo stake in your Meta budget
Meta earns more when you spend more on Meta. Sprites is priced per plan, not as a share of spend, so it earns the same whether it tells you to raise a budget, cut one, or move the money off Meta entirely.
See what competitors are running
Ask for any advertiser and Sprites returns their live Meta ads, longest-running first, read as hooks, offers and formats rather than screenshots — then drafts tests for your account from what is clearly working for theirs.
Browse the ads libraryIt makes the ads, not just the campaign
Hooks, headlines, primary text and on-brand images, generated from your brand kit and previewed in the real Feed, Stories and Reels placements. Campaign, ad sets, audiences and creative arrive as one proposal.
Connected the way Meta intends
Meta is connected once in Sprites through Meta’s own OAuth, with the standard ads scopes — ads_read, ads_management, business_management. No developer app, no system-user token pasted into a chat, and ChatGPT never holds a Meta credential. Calls are paced per ad account, so a busy agent cannot rate-limit you out of your own account.
Built so agents can’t do unsafe things
Safety lives in the harness, native to ads — not in a prompt the model can ignore. Sprites catches edits that would reset Meta’s learning, changes only what the live account allows, forecasts every budget move, and checks every number against your data. Nothing ships without your approval.
Safety built into the harness, native to ads
Protects the learning phase
Sprites reads every ad set’s learning stage before it touches anything, and flags the edits that would throw Meta’s delivery algorithm back into learning — so a quick tweak never costs you a week of optimization.
Safe edits, on live state
Every change is built from a fresh read of the account: which level owns the budget, which parent controls delivery, and whether Meta will accept the edit. No changes against a stale report, and a clear reason when an edit can’t be made.
Budget forecasting
Every budget change is forecast into the month before you approve it, so you see exactly where it lands. Switch on an enforced ceiling and anything that would break it is refused in code.
Anti-hallucination
Totals are computed in code and every figure is traced back to your account data. A number that doesn’t check out is withheld, not guessed.
Approval on every write
Every change arrives with its before and after, editable in place, and applies only when you approve it — with a record of who approved.
Native Meta permissions
Connected through Meta’s own OAuth with the standard ads scopes. Calls are paced per ad account so a busy agent never locks you out, and no credential ever enters the chat.
Run the first prompt
Ask Codex this. It routes to a Sprites door, which reads your Meta Ads account and answers — no account to name, no confirmation to give first.
- With Sprites, which Meta creatives are fatiguing and what should replace them?
- Ask Sprites for 5 new hooks for our best-performing Instagram ad.
- Use Sprites to compare Meta ROAS this month against last month by ad set.
- Have Sprites check which of our Meta ad sets are stuck in learning.
- With Sprites, show me what our top 3 competitors are running on Meta right now.
Run `codex mcp list` and confirm sprites shows as connected.
Running Meta Ads from Codex
The jobs people hand over first, start to finish: what you type, what Sprites does with it, and what comes back to approve.
The Monday review
You, in CodexWith Sprites, how did our Meta ads do last week, and what changed?
- Sprites does
- Reads spend, ROAS and CPA by campaign and ad set against the week before, then checks frequency and learning phase for the ones that moved.
- You get back
- A short read in the thread — what moved and why — with one or two proposed fixes as approval cards.
Replace tired creative
You, in CodexAsk Sprites which Meta ads are fatiguing and draft replacements.
- Sprites does
- Finds the ads past the break on CTR and frequency, reads what is still working, and drafts new hooks, headlines and images in that direction.
- You get back
- Replacement ads previewed in placement, and one approval that swaps them in for the tired ones.
Launch a campaign
You, in CodexUse Sprites to launch a Meta campaign for our fall sale at $80 a day.
- Sprites does
- Builds the campaign, ad sets, audiences and ads with creative attached, and checks the budget against any spend ceiling you have set.
- You get back
- One editable proposal. Change the audience, the copy or the budget in the card; nothing goes live until you approve.
Competitor teardown
You, in CodexWith Sprites, what is Gymshark running on Meta and what should we test?
- Sprites does
- Pulls their live ads from the Meta Ad Library, longest-running first, and reads the angles, offers and formats they keep paying for.
- You get back
- Their ads in the thread, and three test concepts drafted for your account.
What Codex can do with Meta Ads
The same doors, whichever client you are in. Marketing work that belongs in a commit: Codex can read the landing page it is about to ship and brief Sprites on the campaign pointing at it, in one session.
See fatigue before the CPA does
Frequency and the day a creative's CTR broke trend, per ad rather than per campaign.
Get new creative, not a brief
Hooks, headlines and image concepts drafted against what is already working, previewed in the real placement.
Untangle the ad sets
Learning-phase status, delivery issues and the targeting on every ad set, read side by side.
Watch the competition
Live ads from any advertiser in the Meta ad library, read as angles rather than screenshots.
Launch across placements
Campaign, ad sets, audiences and ads in one editable proposal, with the creative attached.
Reallocate on evidence
Move budget to the ad set that earns it, with the before-and-after stated in the card.
How approvals work here
Codex renders tool results as text, so a Meta change comes back written out rather than as a card. The approval waits for you in Sprites — open it there and the same run continues. Nothing is applied until you approve it.
What it reads
- Campaigns, ad sets, ads, audiences and their status
- Spend, ROAS, CPA, CTR, frequency and placement breakdowns
- Creative assets and per-creative performance
- Public competitor ads from the Meta ad library
What it can change
- Create campaigns, ad sets, audiences and ads
- Budgets, schedules, statuses and targeting
- New creative, previewed in placement before anything ships
When it does not work in Codex
Three things go wrong in this client specifically, and each has a one-line fix.
Codex says the tool is not found.
The config was edited while a session was open. Restart Codex — it reads config.toml at startup.
Login loops without ever completing.
The OAuth callback defaults to http://127.0.0.1/callback. If something else on the machine holds that port, set mcp_oauth_callback_url in config.toml and log in again.
Codex says a change was applied and nothing happened in the account.
It was proposed, not applied — that is the design. The approval is waiting in Sprites; open it there and the run continues from where it stopped.
And on the Meta side
The ad account I want is not listed.
Sprites sees the ad accounts your Facebook login can manage. Ask the Business Manager admin to give your user a role on that ad account — or, for a client, have their Business add yours as a partner — then refresh the Meta connection in Sprites.
Meta says the connection has expired.
Reconnect Meta on the Sprites integrations page. The run in your agent parks rather than failing, and continues once the connection is back.
Meta returns “(#17) User request limit reached”.
Meta limits calls per ad account, shared by every tool on it. Sprites paces its calls and slows as the account nears the limit, so a heavy question becomes a slower answer. If another tool has already spent the quota, wait a few minutes and ask again.
Meta Ads and Codex: questions
Which URL do I paste into Codex?
https://mcp.sprites.ai/mcp. There is one endpoint and every client uses it — every OAuth grant is bound to exactly that address, so a variant of it will not be honoured.
Can Codex change my Meta Ads account without asking?
Codex renders tool results as text, so a Meta change comes back written out rather than as a card. The approval waits for you in Sprites — open it there and the same run continues. Nothing is applied until you approve it.
Do I need a Meta Ads API key or developer token?
No. Meta Ads is connected once inside Sprites through Meta (Facebook and Instagram) Ads, and the connector acts on that connection. Codex never sees a credential for it.
Why Codex for Meta Ads specifically?
Marketing work that belongs in a commit: Codex can read the landing page it is about to ship and brief Sprites on the campaign pointing at it, in one session.
Is there an official Meta Ads MCP server?
Yes. Meta runs its own Ads MCP server at mcp.facebook.com/ads, as part of its ads AI connectors. It covers Meta only: reporting, campaign and ad management, catalogs, datasets and lift studies. Sprites is a separate MCP server that reaches Meta plus Google, LinkedIn, TikTok, Reddit and SEO, drafts new creative, and stages every write as an approval.
Is it safe to let an AI agent manage my Meta ads?
With Sprites, the agent proposes and you decide. Every change arrives with its before and after and applies only when you approve it. Sprites checks the learning phase before an edit, forecasts every budget change against your ceiling, refuses an over-ceiling change in code when enforcement is on, and traces every number back to your account. The agent never holds a Meta credential.
Keep going
The same Codex connector reaches every other channel — nothing else to add.
Meta Ads, from Codex
Paste one URL, sign in once, and the next Meta question you ask Codex gets answered from the live account.