Connect Your Ad Accounts to Codex (2026 Setup Guide)

Connect your ad accounts to Codex with one MCP server: competitor ad research, keyword data, Google Ads and TikTok linking, and paused campaign launches without leaving your terminal.

Basil Naser

Founder

· 8 min read

If you want to connect ads to Codex, you are in the right place. People arrive at this question from a few directions: "connect ad account to Codex", "Google Ads Codex", "Codex MCP for Meta ads". The underlying intent is the same. You live in the terminal, Codex is already doing real work for you, and you want your advertising data and your ad accounts wired into it so the agent can research, diagnose, and launch without you switching to a browser dashboard.

This guide covers the whole thing: why Codex is a genuinely good place to run ads from, the exact config to connect the AdWhispr MCP server, how to link your Google Ads and TikTok accounts, real prompts to try, and an honest section on what to do if your platform is not one we cover.

Why Codex is a serious surface for ads

This is not a gimmick. Three properties make a coding agent like Codex better at ad operations than most dashboards:

  • It works where your code lives. The same session that edits your landing page can pull the competitor ads that page is competing against. Ad context and code context stop being separate tabs.
  • It is repeatable. Anything you can prompt, you can turn into a routine. A weekly "check my keyword performance and summarize what changed" is a saved prompt, not a calendar reminder to go click through reports.
  • It runs multi-step work. Codex does not just answer one question. It can research a competitor, compare their longest-running ads, pull keyword volumes, and assemble a campaign draft in one continuous chain, asking you only when a decision actually needs you.

The missing piece is data and execution access. That is what MCP servers are for, and it is why we built one.

What the AdWhispr MCP gives Codex

AdWhispr is one MCP server that covers both halves of the job. Codex connects to the same full server Claude Code does, so everything below is available.

Research (no ad account needed):

  • Competitor Meta ad libraries with days-running history. Meta's API returns no run-time data, so AdWhispr builds it from daily snapshots. An ad live 100+ days is a proven winner, because no brand keeps paying to run a loser.
  • TikTok ad research: live ads in any niche, and shoot-ready scripts modeled on the proven ones.
  • Keyword research: real search volumes and click costs, plus the keywords your competitors go after.
  • AI classification of every ad by hook, format, tone, and offer, so questions get structured answers instead of vibes.

Execution (with your own accounts connected):

  • Google Search, Performance Max, YouTube and Shopping campaign launch.
  • Meta launch (single image, carousel, video, creative tests, retargeting).
  • TikTok campaign launch with a full video-ad builder.
  • X, ChatGPT Ads, Reddit and LinkedIn launch.
  • Budget changes, pause and resume, keyword and targeting changes, audiences, and account performance reads with keyword-level diagnostics.

Competitor data is read-only public Ad Library data. Your own accounts connect through standard OAuth, covered below.

How to connect your ad accounts to Codex

The whole setup is one config block plus one sign-in.

Step 1: Run the config helper

From any terminal:

npx adwhispr-mcp-server config

The npm package is unscoped: it is adwhispr-mcp-server, not @adwhispr/anything. The helper prints the MCP server entry your client expects, pointing at the hosted endpoint https://adwhispr.com/api/mcp. You will sign in with your AdWhispr account on first connect. A free account works, no credit card, and it is enough to confirm everything is wired up.

Step 2: Add the server to your Codex config

Codex reads MCP servers from its config file, in TOML. Open your Codex MCP config and add:

[mcp_servers.adwhispr]
command = "npx"
args = ["adwhispr-mcp-server"]

Or paste the block the config helper printed in Step 1. If your Codex setup takes remote MCP servers by URL instead of a local command, point it at the same hosted endpoint:

https://adwhispr.com/api/mcp

Either way it is the same server and the same tools; only the config syntax differs.

Step 3: Reload Codex and confirm

Restart your Codex session so it picks up the new server. The tools register automatically. To confirm, ask:

What can the AdWhispr tools do?

If Codex describes competitor research, keyword research and campaign launch rather than guessing, you are connected. Sign in when prompted on the first call. (On Claude Code instead? The Claude Code version of this guide has the same steps with the claude mcp add commands.)

Research works immediately. To launch or read your own performance, link the account. In Codex, just ask:

Connect my Google Ads account.

AdWhispr returns an authorization link. Open it, sign in with the Google account that has access to your ads, and approve. This is standard OAuth: AdWhispr gets scoped access to the ad account, never your Google password, and you can revoke it any time from your Google account's connected-apps settings. Then confirm what you are pointed at:

Which ad accounts can I launch into?

Codex lists every account the connection can reach. If you manage several accounts under one login, this is where you confirm you are aiming at the right one. The how-to hub has short-form guides for every platform.

Same pattern:

Connect my TikTok ad account.

One caveat that catches almost everyone: TikTok requires the ad account to be bound to a Business Center, with an identity and a payment method attached, before anything can launch, even a campaign you intend to leave paused. If you have never launched a TikTok ad manually, sort the Business Center out first. It is the most common reason a connection succeeds but a launch fails.

Six prompts to try first

Once Codex can see the server, run these in order. They mirror the actual research-to-launch loop:

  1. "Use the AdWhispr tools to add [competitor] and show me their ad library." Starts pulling a brand's entire public Meta ad library.
  2. "Show me their longest-running active ads and break down the hook, format, and offer on the top three." Days-running is the performance signal that public data actually supports.
  3. "What keywords is [competitor] going after? Pick the five that fit my brand best and show me search volumes." Research before spend, every time.
  4. "Check my account performance for the last 30 days and tell me which keywords are dragging." With Google linked, this surfaces keyword-level diagnostics such as first-page bid estimates and low quality scores.
  5. "Launch a Google Search campaign on those five keywords at $40 a day." Codex shows you the assembled campaign, budget, geography, and keywords before anything is created, and the campaign is created paused.
  6. "Pause the campaign and summarize what we learned this week." Campaign ops as conversation.

You can also clone a proven competitor creative before launch: ask for your own version of a long-running ad, and AdWhispr makes it with your product in it, ready to launch from the same session.

What if your platform isn't covered?

Honest section. AdWhispr covers Meta, Google, TikTok, X, ChatGPT Ads, Reddit and LinkedIn for launch and management, plus competitor research on Meta and TikTok and keyword research on Google. That is the list.

Searches also land here for platforms we do not support, so to be clear about the gaps:

  • AdSwizz and other audio ad platforms: not supported.
  • Adalyser and TV analytics: not supported.

If you need one of those inside Codex today, you have two generic options, and they are unglamorous but real. First, if the platform has an API, Codex can write and run scripts against it directly; you bring your own API credentials and the agent handles the request code. Second, most of these platforms export CSV. Drop the export into your repo and Codex will happily analyze it, join it against other data, and chart it. You lose the live connection and the launch capability, but for reporting and analysis it works today with zero new tooling.

The safety note

Nothing spends money without an explicit instruction from you. Research is read-only. A launch only happens when you ask for one, you set the daily budget in the instruction itself, you see the assembled campaign first, and every new campaign is created paused. Budgets, pausing, and resuming all follow the same rule: the agent executes what you asked for, and only that. If you ever want out, revoking OAuth access from the platform side immediately stops any further campaign actions.

FAQ

Can Codex run my ad campaigns?

Yes, for real. With an ad account connected, Codex can launch Google Search and Performance Max campaigns, launch TikTok campaigns including the video ad, launch on Meta, change budgets, pause, resume, and read performance. Every launch requires your explicit instruction, shows you what it built, and starts paused.

Is it the same as the Claude Code setup?

Yes. The MCP server is client-agnostic; only the config syntax differs. Claude Code uses claude mcp add, Codex uses a TOML block. The prompts and tools are identical in every client.

Do I need to connect an ad account just to do research?

No. Competitor research, days-running history, keyword research, and TikTok ad research all run on public data with no account connection. Connecting your own account is only required to launch campaigns or read your own performance.

Will it tell me a competitor's CTR or ROAS?

No, because it cannot know them. The Meta Ad Library does not expose CTR, CPC, conversions, or ROAS for competitor ads; those numbers live only inside the advertiser's own account. AdWhispr surfaces what public data actually supports, led by days-running, and any tool that quotes a competitor's exact ROAS is making it up.

One command to start

The whole thing begins with:

npx adwhispr-mcp-server config

A few minutes later Codex can read the ad market, and with one OAuth approval it can act on your accounts too. Start free at adwhispr.com.

Your terminal already ships the landing pages. Now it can run the ads that point at them.

More in MCP Setup

Your AI marketing agent

Run ad research on autopilot

AdWhispr is an AI agent inside Claude & ChatGPT. Research any brand’s ads, clone the winners, and run campaigns across Meta, Google & TikTok.

Try the AdWhispr agent for free