Log in

AdChat for Codex

Connect Facebook & Google Ads to Codex

Add AdChat to OpenAI Codex with one command and ask about your Meta and Google ads from the CLI or IDE.

FacebookGoogle AdsOne MCP server, one AdChat account, both ad platforms

Run this in your terminal

codex mcp add adchat --url https://mcp.adchat.app
  • OAuth sign-in, no API keys
  • 7-day free trial, no card
  • Set up in about a minute

Three steps. That's it.

  1. 1

    Paste it into Codex

    Run the command. It adds AdChat to ~/.codex/config.toml.

  2. 2

    Connect Facebook and Google

    Run codex mcp login adchat and sign in to AdChat in your browser.

  3. 3

    Ask about your ads

    Live numbers from your account, in plain English. Nothing changes without your yes.

Then just ask

Codex pulls live data from your Facebook and Google ad accounts through AdChat and answers with real numbers. Click a question to copy it.

CodexCodexAdChat connected

Which Facebook ads wasted money this month?

I checked your Meta ads for the last 30 days. Three ads spent $412 with zero purchases:

  • Summer sale – carousel$188 · 0 purchases
  • UGC video v2$131 · 0 purchases
  • Broad 25-45 – static$93 · 0 purchases

Want me to pause them? I'll show you each change first.

via AdChat · Meta Ads

Example conversation. The numbers are made up.

One link works in every AI app

Use AdChat wherever you already chat. Same tools, same safety, one account.

AdChat for Codex: FAQ

Yes. The CLI, the IDE extension and the ChatGPT desktop app read the same config.toml.

No. Codex signs in to AdChat with OAuth, and you connect Facebook and Google by logging in to each. You never paste a token anywhere.

No. The AI has to tell you the exact change and get your yes first, and new campaigns, ad sets and ads start paused.

Yes. Connect Google Ads in the same AdChat account, when you sign in or later from your dashboard, and Codex sees it through the same link. There's no second server to add. Ask about results and search terms, change budgets and keywords, and add search ads. TikTok isn't supported.

Every new account gets a 7-day free trial of everything, no card, on all your ad accounts. After that, plans start at $29 a month. Cancel anytime.

Let Codex run your Facebook and Google ads

Start your 7-day free trial, connect Facebook and Google, and paste the link. You approve every change.

Start free trial

7-day free trial of everything, no credit card (built-in chat: 10 messages; unlimited in your own Claude or ChatGPT). Then from $29/month. Cancel anytime.

Step-by-step guide

Connect Facebook and Google Ads to OpenAI Codex with AdChat

Add AdChat to the Codex CLI, IDE extension or ChatGPT desktop app with one URL and a browser sign-in. Ask about your Meta and Google ads from the terminal.

Eric Strohmaier
By , founder of AdChatPublished Updated 4 min read

Try AdChat free for 7 days, no card. Start your trial

OpenAI Codex can connect to remote MCP servers, so you can ask it about your Facebook and Instagram ads, export numbers, or build reports while you work. This guide shows how to add AdChat to the Codex CLI. The same setup also works in the Codex IDE extension and the ChatGPT desktop app, because all three share one config file.

Google Ads too. The same AdChat link covers Google Ads. Connect Google in your AdChat account, when you sign in or later from your dashboard, and Codex sees your Facebook and Google ad accounts through this one server. There's nothing extra to add.

What you need

  • Codex installed (CLI, IDE extension or ChatGPT desktop app).
  • An AdChat account. Sign up. You can connect Facebook now or when you sign in from Codex.

How Codex connects

Codex supports remote "Streamable HTTP" MCP servers, which is what AdChat is. You add AdChat's URL, then sign in once in your browser. There's no key to copy.

Step 1: Add AdChat

Run:

bash
codex mcp add adchat --url https://mcp.adchat.app

Or open ~/.codex/config.toml (create it if it doesn't exist) and add:

toml
[mcp_servers.adchat]
url = "https://mcp.adchat.app"

If you only want AdChat in one project, put the same block in .codex/config.toml inside that project instead. Codex only reads project config for projects you've marked as trusted.

Step 2: Sign in

Run:

bash
codex mcp login adchat

A browser window opens. Sign in to AdChat, connect Facebook if you haven't yet, and click Allow. You only do this once. Codex stays connected as long as you use AdChat at least once every 90 days.

Step 3: Optional safety setting

Codex lets you decide when it should ask before using a server's tools. This setting makes it ask before any tool that isn't marked read-only:

toml
[mcp_servers.adchat]
url = "https://mcp.adchat.app"
default_tools_approval_mode = "writes"

Combined with AdChat's read-only default, that gives you two layers of protection.

Step 4: Check the connection

Run:

bash
codex mcp list

AdChat should appear in the list. Inside the Codex terminal app, type /mcp to see your active servers.

Try it on your own account. Connect your Meta and Google ads to Claude, ChatGPT or the built-in chat. 7-day free trial of everything, no credit card (built-in chat: 10 messages; unlimited in your own Claude or ChatGPT). Then from $29/month. Cancel anytime.

Start free trial

Step 5: Ask a question

Start codex and try:

Use AdChat to show my active Facebook campaigns with spend, results and cost per result for the last 7 days.

Or:

With AdChat, pull daily spend for my ad account over the last 30 days and write it to a CSV.

More ideas are in Your first 10 questions to ask.

Using the IDE extension or ChatGPT desktop app

Both read the same ~/.codex/config.toml, so if you did the steps above, AdChat is already there. You can also add it through the app:

  1. Open settings (the gear menu in the IDE extension, Settings in the desktop app) and select MCP servers.
  2. Click Add server, name it adchat, choose Streamable HTTP, and enter https://mcp.adchat.app.
  3. Save, then restart the extension or app and sign in when asked.

Can't sign in? Use your key as a bearer token

Signing in is the way to go. If it doesn't work where you run Codex, you can send your AdChat key as a header instead. Your key is in the dashboard and starts with adchat_. Save it in your shell profile (for example ~/.zshrc):

bash
export ADCHAT_KEY="adchat_..."

Then point Codex at it:

toml
[mcp_servers.adchat]
url = "https://mcp.adchat.app"
bearer_token_env_var = "ADCHAT_KEY"

Codex then sends Authorization: Bearer <your key> with each request. Treat the key like a password. If it ever leaks, roll it in the dashboard and update ADCHAT_KEY.

Troubleshooting

AdChat isn't listed. Check the table name is exactly [mcp_servers.adchat] (with an underscore) and that the TOML is valid.

AdChat is listed but calls fail with an auth error. Check the URL is exactly https://mcp.adchat.app. The old AdChat address no longer works. Update the URL, then run codex mcp login adchat again. If you use the bearer token instead, run echo $ADCHAT_KEY in the same terminal to check the variable is set.

"Your AdChat free trial has ended". After the 7-day trial, AdChat needs a plan. Pick Weekly or Daily on the pricing page. On every plan, Codex asks you yes or no before each change. See How AdChat confirms changes.

Requests get slowed down. Use through your own AI apps is unlimited, with a limit of 120 requests per minute.

FAQ

Is this the same as ChatGPT on the web? No. ChatGPT web uses its own Plugins setup. See Connect AdChat to ChatGPT.

What if my key leaks? This only matters if you use the bearer token. Click Roll API key in the API key section of the Claude & ChatGPT page. The old key stops working right away. Update ADCHAT_KEY with the new one.

Get going

Start your 7-day free trial. No credit card needed. Questions? Email [email protected].

Try it on your own ad account

Connect your Meta and Google ads to Claude, ChatGPT or our built-in chat in about a minute.

Start free trial7-day free trial of everything, no credit card (built-in chat: 10 messages; unlimited in your own Claude or ChatGPT). Then from $29/month. Cancel anytime.

Questions? Email me at [email protected]