Home>Connect>Meta Ads to Claude Code

Connect Meta Ads to Claude Code in One Command

By Ahmed Ashraf|Updated September 23, 2026
Meta Ads Claude Code

Run claude mcp add --transport http paidsync https://mcp.paidsync.ai/mcp, type /mcp, and sign in with your PaidSync login. Claude Code then reaches your Meta ad accounts through 83 tools: performance by placement, age, country and device, ad sets, audiences, creatives and campaign builds. Claude Code asks before it runs each tool, and most Meta writes preview with a dry run first.

One command. OAuth sign-in, no key pasted. Free plan, 15 tasks a month, no card.

Free to start · No credit card · OAuth 2.0 sign-in · 530+ tools total

The command

Claude Code talks to remote MCP servers over Streamable HTTP. PaidSync is one of them. Add it once and the same terminal that edits your code can read and change your Meta ad accounts.

claude mcp add --transport http paidsync https://mcp.paidsync.ai/mcp

By default that registers the server for the current project only. Add --scope user to make it available in every project on your machine. Run claude mcp list to confirm it is there, then start a session and type /mcp to sign in.

5-Step Setup

1

Sign up at paidsync.ai/signup

Takes 10 seconds. Google or email sign-in. The free plan is 15 tasks a month at $0, no card.

2

Connect Meta Ads in the PaidSync dashboard

Click Connect on Meta Ads and sign in with the Facebook account that manages your Business Manager. Meta Ads authorizes via Facebook OAuth with the ads_read and ads_management permissions. PaidSync stores the tokens encrypted at rest with AES-256-GCM.

Already inside Claude Code? Ask it to run connect_facebook_ads. The tool returns an OAuth link to open in your browser.

3

Pick the ad account Claude Code should work on

After the sign-in, PaidSync lists the Meta ad accounts that login can reach. Tick the ones that belong in this workspace. Inside a session, list_fb_ad_accounts shows them and set_fb_ad_account picks the active one.

4

Add PaidSync to Claude Code

In your terminal, run:

claude mcp add --transport http paidsync https://mcp.paidsync.ai/mcp

Start a session, type /mcp, pick paidsync, and sign in with your PaidSync login in the browser window that opens. Claude Code stores the OAuth token for you. No key is pasted anywhere.

Setting this up for a team? Commit a .mcp.json at the repo root so every engineer gets the same connector:

{ "mcpServers": { "paidsync": { "type": "http", "url": "https://mcp.paidsync.ai/mcp" } } }

Prefer an API key, for example for headless runs? Send it in a header, never in the URL, where it would end up in logs:

claude mcp add --transport http paidsync https://mcp.paidsync.ai/mcp --header "Authorization: Bearer $PAIDSYNC_API_KEY"

In a committed .mcp.json, add "headers": { "Authorization": "Bearer ${PAIDSYNC_API_KEY}" } so the key stays in each engineer's environment and never enters git. Applying a change to Google Ads still requires the OAuth sign-in. On other platforms a key can apply changes too, so treat it like a password and prefer OAuth.

5

Test the connection

In a Claude Code session ask: “Show me last 7 days Meta performance by campaign”

Claude Code returns spend, impressions, clicks, CTR, CPC and ROAS for each campaign in the active ad account. The connection is live.

Free plan includes 15 tasks a month. Pro from $99 a month, Team from $249.

Start Free See a Demo

Meta Ads prompts to try in Claude Code

Each prompt below maps to tools in the PaidSync Meta Ads group. Claude Code picks the tool. The last column says whether the call can change anything in the ad account.

AskTools it callsChanges your account?
“Show last 7 days campaign performance with spend, CTR, CPC and ROAS”get_fb_performanceNo
“Which placements drove the cheapest conversions this month?”get_fb_performance_by_placementNo
“Rank every ad by CTR for the last 14 days”get_fb_ad_performanceNo
“How is budget pacing this month on the active account?”get_fb_budget_pacingNo
“Pause the three ad sets with the highest cost per result”get_fb_adset_performance, pause_fb_adsetYes, after you confirm
“Duplicate the best ad set into the Prospecting campaign with its ads”duplicate_fb_adsetYes, after you confirm
“Create a 1 percent lookalike of the Purchasers audience in the US”create_fb_lookalike_audienceYes, after you confirm
“Draft a Sales campaign with a $50 daily budget and show me the preview”create_fb_campaignYes, after you confirm

Run it headless with claude -p

The -p flag runs Claude Code without the interactive session. Sign in once through /mcp and the stored OAuth token carries over. A report that lands in a file looks like this:

claude -p "Pull last 7 days Meta performance by placement and list the placements with the highest cost per result." \ --allowedTools "mcp__paidsync" \ --output-format json > reports/meta-ads-$(date +%F).json

Reads run straight through, and so do writes. --allowedTools "mcp__paidsync" allows every PaidSync tool, writes included, with no prompt. For an unattended job, allow only the read tools it needs, each by name as mcp__paidsync__tool_name.

What reads and what writes

Of the 83 Meta Ads tools, 46 only read and 34 can write. Reads cover performance at campaign, ad set and ad level, breakdowns by age and gender, country, device, placement and time, budget pacing, pixels, catalogs and the account activity log.

Writes cover campaigns, ad sets, ads, creatives, audiences, lead forms, automated rules and budget schedules. Each one previews by default with dry_run, except upload_fb_ad_image and upload_fb_ad_video, which apply on the first call.

Over MCP, the approval step is Claude Code’s own prompt. It asks before it runs a tool unless you allowed it with --allowedTools or in your settings. PaidSync adds checks on its side. Deletes, pauses and budget changes need confirm_destructive, and a pre-write rule check blocks unsafe arguments. The approval card and one-tap undo apply only in the PaidSync workspace.

Limits worth knowing

  • delete_fb_campaign and delete_fb_audience are permanent. Pause instead when you want to keep the history.
  • A duplicated ad set lands paused and, by default, without its ads. Pass deep_copy to copy the ads too.
  • get_fb_leads returns names, emails and phone numbers. If you write the output to a file in a repo, keep that file out of version control.
  • Where the budget lives decides the rest. A budget on the campaign means Meta splits it across ad sets. Leave it off and each ad set carries its own.

Frequently Asked Questions

How do I connect Meta Ads to Claude Code?

Sign up at paidsync.ai, connect Meta Ads via Facebook OAuth in the dashboard, then run claude mcp add --transport http paidsync https://mcp.paidsync.ai/mcp in your terminal. Type /mcp inside a session, pick paidsync, and sign in with your PaidSync login.

Can Claude Code create Meta campaigns?

Yes. Meta Ads is a build tier platform in PaidSync. Claude Code can create campaigns, ad sets, ads and audiences. Most writes preview as a dry run first, and Claude Code asks before it runs each tool. Image and video uploads apply on the first call.

Which Meta permissions does PaidSync request?

PaidSync requests ads_read and ads_management through Facebook OAuth. That covers reads and writes on campaigns, ad sets, ads, audiences and performance data for the ad accounts you connect.

Does it work in headless mode with claude -p?

Yes. Once you have signed in through /mcp, claude -p reuses the stored OAuth token. Reads run straight through. Writes need care. No one is there to answer the Claude Code prompt, so any write tool you allowed with --allowedTools runs straight through. For an unattended job, allow only the read tools it needs.

Is it free?

Yes. The free plan is $0 for 15 tasks a month with no card. Pro starts at $99 a month and Team at $249 a month.

83 Meta Ads tools. One command in Claude Code.