Meta Ads (Facebook Ads) connector for Claude Code

Use Porter’s Meta Ads connector for Claude Code to pull Facebook and Instagram ad data into your terminal, then turn it into files, scripts and scheduled reports in your own project.

  • Save Meta Ads data as CSV or JSON in your repo
  • Build a local HTML dashboard from live spend and ROAS
  • Run a weekly Meta Ads report from a script
  • Join ad spend with the sales files already in your project
G2★★★★★Rated 4.6/5 from 288 G2 reviews (October 2026) · Used by 1,600+ marketing teams and agencies

By · Last updated November 26, 2026

Claude Codeporter connected
Pull last week’s Meta Ads spend and Purchase ROAS by campaign and save it to reports/meta-weekly.csv
porter / Meta Ads / Trailgear Demo✓ 4 rows
Saved reports/meta-weekly.csv with 4 campaigns. Retargeting – Carts leads at 5.8 Purchase ROAS; Prospecting – Video is lowest at 2.1.
CampaignAmount spentPurchase ROAS
Retargeting – Carts$1,8405.8
Advantage+ – Lookalike$3,2103.9
Prospecting – Video$2,4602.1
Brand – Reach$9801.4
Demo data, Trailgear Demo account
1,378 Meta Ads fields
01Setup

How to connect Meta Ads to Claude Code

Connecting Meta Ads to Claude Code takes 3 steps and no API keys: connect your ad accounts in Porter with Facebook Login, add Porter’s MCP server to Claude Code with one command, then sign in from /mcp and ask. The same server also works in Cursor, VS Code and Codex, as Porter’s Meta Ads MCP server page shows. Using the Claude app instead? See the Meta Ads (Facebook Ads) connector for Claude.

Before you start

  • You need Claude Code installed (Anthropic’s Claude Code overview), a free Porter account and a Facebook user with a role on the ad account in Meta Business Manager.
  • In Meta’s ad account roles, Admins and Advertisers can create and edit ads while Analysts only view, so changes need one of the first two.
  • Works with any Claude model in Claude Code, from Opus to Sonnet and Haiku.
  1. Step 1: Connect Meta Ads in Porter

    Sign up free at Porter, pick Meta Ads as the source and sign in with Facebook. Tick every ad account you want Claude Code to read.

  2. Step 2: Add Porter to Claude Code

    In your terminal, run this command. It adds Porter for every project on your machine; drop --scope user to add it to the current project only.

    Terminal
    claude mcp add --transport http --scope user porter https://mcp.portermetrics.com/mcp

    Or, inside Claude Code, install Porter’s plugin, which adds the server and Porter’s skill together: /plugin marketplace add portermetrics/porter, then /plugin install porter-metrics@portermetrics.

  3. Step 3: Sign in and ask

    Start claude, type /mcp, pick porter and sign in with the Google account you use in Porter. When porter shows as connected, paste this prompt:

    Prompt
    Which Meta Ads accounts can you see? For the last 7 full days, rank my campaigns by Purchase ROAS and save the table to reports/meta-roas.csv.

Guides and videos

app.portermetrics.com / create
Porter's Select accounts window for Meta Ads with a demo account and the Connect button
First, in Porter, open Meta Ads and select Connect.
Porter's Facebook Ads authorization page with the authorized profile
Then, log in with Facebook and come back to Porter.
$ claude mcp add --transport http --scope user porter https://mcp.portermetrics.com/mcp

$ claude mcp list
porter: https://mcp.portermetrics.com/mcp (HTTP)
Then, add Porter's MCP server from your terminal.
> /mcp
porter · needs authentication → Authenticate

> Which Meta Ads accounts can you see?
● porter - list_accounts (MCP)
Trailgear Demo
After you sign in from /mcp, Claude Code lists your Meta Ads accounts.
02Use cases and prompts

What you can do in Claude Code

Claude Code works inside your project, so Meta Ads answers can become files, scripts and dashboards instead of chat replies. Each use case has a prompt to copy and uses the Meta Ads fields Porter reads.

Can Claude Code save Meta Ads data as a CSV?

The problemYou export from Ads Manager, rename the columns and drop the file into your project every week.

What Claude Code doesClaude Code queries Meta Ads through Porter and writes the result straight to a CSV or JSON file in your project, with the column names you ask for.

What you getA clean data file in your repo, ready for a notebook, a script or a teammate, with no manual export.

Prompt
For the last 30 days, by Date and Campaign name, pull Amount spent, Impressions, Link clicks, Purchases and Purchase ROAS from Meta Ads and save it as data/meta-ads-30d.csv.

Can Claude Code build a Meta Ads dashboard?

The problemClients want a page they can open, not a spreadsheet, and Ads Manager views don’t travel well.

What Claude Code doesClaude Code pulls the numbers, writes one HTML file with charts for spend, ROAS and cost per purchase, and opens it for you to check.

What you getA single dashboard file you can host or send. Ask for a hosted Porter AI dashboard instead and it gets its own link and refreshes itself.

Prompt
Build dashboard/meta.html: a daily line chart of Amount spent and Purchase ROAS for the last 28 days and a table of the top 10 ads by Purchases. Use Meta Ads data from Porter.

Can I schedule a Meta Ads report with Claude Code?

The problemEvery Monday someone opens Ads Manager, sets the date to last week and copies ROAS into a deck.

What Claude Code doesA cron job runs claude -p each Monday; Claude Code pulls Amount spent, Purchases, Cost per purchase and Purchase ROAS per campaign for both weeks and writes the summary.

What you getreports/meta-weekly.md with each campaign’s week-over-week change, ready before the Monday standup.

Prompt
claude -p "Compare last week with the week before for every Meta Ads campaign: Amount spent, Purchases, Cost per purchase and Purchase ROAS. Write a short summary to reports/meta-weekly.md" --allowedTools "mcp__porter" "Write"

Can Claude Code spot creative fatigue?

The problemThe ad that won last month now costs more per purchase, but Ads Manager won’t call it fatigue.

What Claude Code doesClaude Code lines up Frequency, CTR (Link click-through rate) and CPM by ad and day, flags the ads where frequency climbs while CTR falls, and saves the list.

What you getA short list of tired ads to replace, before they push up cost per purchase.

Prompt
For the last 14 days, by Ad name and Date, show Amount spent, Frequency, CTR (Link click-through rate) and Cost per purchase. Flag ads where Frequency rose above 3 while CTR fell 3 days in a row, and save them to reports/fatigue.csv.
Then ask
Prompt
Pause the flagged ads that spent more than $200. Ask me before each change.

Can Claude Code combine Meta Ads with my sales data?

The problemYour real revenue sits in a CSV or database export that Ads Manager never sees.

What Claude Code doesClaude Code reads the file in your project, pulls Meta Ads spend for the same days and joins them by date or campaign tag.

What you getBlended ROAS on your own revenue numbers, without uploading your sales data anywhere.

Prompt
Read data/orders.csv, sum revenue by day, then pull daily Meta Ads Amount spent for the same dates and write daily blended ROAS to reports/blended-roas.csv.

Can Claude Code audit my Meta Ads naming?

The problemInconsistent campaign names and missing UTMs break every report downstream.

What Claude Code doesClaude Code reads campaign and ad names with their URL tags across every ad account you connected, checks them against your naming rule and writes a fix list.

What you getOne file with every name or tag to fix, account by account.

Prompt
List every active Meta Ads campaign and ad with its URL tags and Source (utm) across all my ad accounts. Flag names that don’t follow Country_Funnel_Offer and ads with an empty Source (utm), then save the list to reports/naming-fixes.md.
03Why Porter

Why Porter for Meta Ads in Claude Code

Meta’s own Ads MCP server also works in Claude Code once Meta enables your ad account, and it fits teams that only need Meta (Meta’s Ads MCP server docs). Porter adds every ad account your Facebook user can reach and 30+ other marketing sources behind the same server.

✓

One server for all your sources

The same porter server answers about Meta Ads, Google Ads, GA4, Shopify and more, so one script can pull every channel.

⊞

Changes only after you approve

Claude Code can pause ads, move budgets and build campaigns through Porter, and each change waits for your yes. New campaigns start paused.

⚙

No Meta app or token to manage

You sign in with Facebook in Porter and with Google in Claude Code. There is no developer app, access token or refresh job to maintain.

↻

Hosted dashboards when a file isn’t enough

Ask for a Porter AI dashboard and it is published at its own link, synced automatically and ready to share with a client.

04Dashboard

Dashboard template

If your team reviews ads together, you can skip the chat: Porter fills the free Facebook Ads Dashboard template in Data Studio (formerly Looker Studio). It charts impressions, clicks, Amount spent, CPC and CTR by campaign, ad set and ad, since Porter’s Meta Ads to Data Studio connector feeds it.

AI dashboards

Build a live Meta Ads dashboard from your terminal

Describe the dashboard in one sentence and Porter builds it. A client-ready dashboard in minutes, with no chart dragging and no BI tool to learn. Ask Claude Code:

Prompt
Build a live Meta Ads dashboard for my account with the last 30 days, the main KPIs and a weekly trend.
Live URLEach dashboard at its own link: no login, no app, no download
Auto-syncFresh Meta Ads data, nobody re-exports each period
Scheduled deliveryEmail or PDF sends on a set day
White labelYour logo and branding for clients
Sharing permissionsView or edit access per person
Meta Ads dashboard template by Porter
Template

The Meta Ads AI dashboard template

Start from a ready-made Meta Ads (Facebook Ads) layout, or run the prompt above in Claude Code and Porter publishes the dashboard at its own link.

05Pricing

Pricing

You can start free, since Porter’s Meta Ads connector for Claude Code comes with every plan. Use the calculator for your number of accounts, or see Porter pricing for every plan.

Free plan

$0, and it never expiresUnlimited connected accounts, the last 15 days of data in Claude (30 in Data Studio and Sheets) and 100 AI credits a month.

Start free

What you get

  • Reporting: from $12.50 per account a month billed annually, or $15 month to month for one account
  • Billing: each Meta ad account counts as one account, with volume discounts and no per-seat fee
  • Changes: 1 AI credit per completed change; failed tasks are free, and the Free plan includes 100 credits a month
  • Trial: 14 days of full access, no card

Price calculator

$33.33/mo$6.67 per account

An account is one ad account, Stripe account, store, page or GA4 property. The Free plan never expires and has unlimited accounts, with the last 15 days of data in AI chats.

06Data and actions

Meta Ads data and actions in Claude Code

The Meta Ads connector gives Claude 1,378 fields, including 167 dimensions, from account down to ad and creative. Porter also gives Claude 32 actions to read and change the account. Most questions need only the 12 fields below, while the Meta Ads fields list has every label and id.

The 12 Meta Ads fields Claude uses most

FieldWhat it's for
Amount spentspendSpend in the account currency for the period
Purchase ROAS (Return on ad spend)purchase_roas_purchaseROAS on each ad set's own attribution setting
Cost per purchasecost_per_purchaseCPA for purchase campaigns
PurchasespurchasePurchases on the ad set's attribution setting
Purchase conversion valuevalue_omni_purchaseRevenue Meta attributes to ads
FrequencyfrequencyAverage times each person saw an ad; a fatigue signal
CTR (Link click-through rate)inline_link_click_ctrLink clicks per impression
CPM (Cost per 1000 impressions)cpmCost of reach by audience or placement
Publisher platformpublisher_platformFacebook, Instagram, Audience Network, Messenger or Threads
Attribution settingattribution_settingWhich window an ad set reports on
Campaign budget remainingcampaign_budget_remainingPacing for campaign budgets
Ad preview URL: mobile feedad_mobile_feed_preview_urlThe creative behind the numbers

Can Claude pause, edit or create Meta Ads campaigns?

Yes. Claude pauses, edits, creates and deletes campaigns, ad sets, ads, audiences and lead forms. Deletes are permanent, so check each one before you approve it.

TypeCountExamples
Read14Campaigns, ad sets, ads, any object by ID, audiences, pixels, custom conversions, Pages, lead forms, leads, interest and location search
Create9Campaigns, ad sets, ads, image and video uploads, custom audiences and customer lists, lookalikes, lead forms
Update5Campaign, ad set and ad status, budget, bid, schedule, targeting, placements, creative; audiences; lead forms
Delete4Campaigns with their ad sets and ads, ad sets, ads, audiences

How far back can Claude read Meta Ads data?

Meta serves ads insights for up to 37 months, per Meta's 37-month reporting limit. Paid Porter plans read everything Meta returns, while the Free plan reads the last 15 days in Claude (30 days in Data Studio and Sheets).

Product stats

WhatMeta Ads connector
Fields1,378 (167 dimensions), from account down to ad and creative
Actions32 (14 read, 9 create, 5 update, 4 delete)
FreshnessLive query to Meta on each question, today included
HistoryUp to 37 months on paid plans; the last 15 days in Claude on the Free plan (30 days in Data Studio and Sheets)
Attribution windowsDefault, 1-day click, 7-day click, 28-day click and 1-day click + 1-day view
Rate limitsMeta's Insights cap: 600 calls per ad account per hour on the Dev tier, 190,000 with full Ads API access
AccessFacebook Login on the ad accounts you tick; changes need an Admin or Advertiser role

See all 1,378 Meta Ads fields

07Security

Is it safe?

Yes, the Meta Ads connector for Claude Code signs in with Facebook Login, so Porter reaches only the ad accounts you tick. Deleting a campaign, ad set, ad or audience is permanent, so check each delete before you approve it.

What the connector needs from Meta Ads

Meta ties each task to a permission: ads_read for reports, ads_management for changes and leads_retrieval for lead forms, as Meta's Marketing API permissions list them. Porter then reads and writes only on the ad accounts you tick at sign-in, and you can revoke its access anytime.

How you approve changes

New campaigns and creatives are created paused, and Porter asks before writing anything, so nothing delivers until you turn it on. Large budgets also need an extra confirmation.

Status, budget and targeting changes can be reverted with another change. However, deleting a campaign also deletes its ad sets and ads. Each completed change uses 1 AI credit.

Will Meta ban my ad account for using an MCP?

No. Meta says "it's unlikely that an account would be banned simply for using" its ads MCP (Meta's guidance on connecting the ads MCP safely). Porter calls the same Marketing API through Facebook Login, while Porter's guide on Meta Ads ban risk covers what does get ad accounts disabled.

Instead, the real limit is Meta's rate limit (Meta Marketing API rate limits). Insights calls per ad account per hour cap at 600 on Meta's Dev tier, compared to 190,000 with full Ads API access. In addition, you get 400 per active ad.

08FAQ

FAQ

Answers on setup, scope, scripts and the official Meta server, plus fixes for the most common Claude Code errors. Setup questions every source shares, like where Claude Code saves the server and how to share it with your team, are in the Claude Code hub FAQ.

Can one script cover Meta Ads and Google Ads?

Yes. Connect both in Porter and name both in the prompt, for example Amount spent from Meta Ads next to Cost from Google Ads. Claude Code reads both through the same Porter server and writes one file.

Is this the same as Meta’s official Ads MCP?

No. Meta’s server runs at mcp.facebook.com and works once Meta enables your ad account. Porter’s server reads any ad account your Facebook user has a role on, next to your other marketing sources. You can add both to Claude Code.

Do Claude Code questions use Porter credits?

Reading Meta Ads data uses no AI credits. Each completed change, such as pausing an ad, uses 1 credit, and every Porter account gets 100 free credits a month.

Troubleshooting

Why does /mcp show porter as needing authentication?

Claude Code adds the server before you sign in. Pick porter in /mcp, choose Authenticate and sign in with the Google account you use in Porter. If the browser doesn’t open, copy the link Claude Code prints.

Why does my claude -p script stop and ask for permission?

Scripts can’t answer permission prompts. Pass the tools the script may use, for example --allowedTools "mcp__porter" "Write", so Claude Code can read Porter and save files without stopping.

Why does Claude Code list my ad accounts but return no data?

This happens when an ad account wasn’t ticked on the Facebook consent screen. Reconnect Meta Ads in Porter and tick each account. If one still shows nothing, check that your Facebook user has a role on it in Business Manager.

09Next

More Claude connectors

Claude reads more than Meta Ads through Porter, and the same Meta Ads connection also feeds Porter's other destinations. Browse all Claude connectors or pick another ad platform below, since each page lists that platform's prompts, fields and limits. Testing Reddit next to Meta? The Reddit Ads MCP connector for Claude uses the same URL.

Not only Claude. Send Meta Ads data anywhere

The same Porter account and connection also send Meta Ads data to these destinations, at no extra cost.

Try the connector in Claude Code

Porter’s Meta Ads connector for Claude Code takes one command, so your first Meta Ads file can land in your project today. Start with a CSV, then turn it into a dashboard or a weekly script.

Free plan · 14-day trial · No card needed

Marketing ops and analysts: Meta Ads data lands in your repo as clean files, ready for your own models.

Agencies: one script builds the Monday report for every client ad account.

Growth marketers: blended ROAS runs on your own sales data, not only Meta’s.