adlibrary.com Logoadlibrary.com
Share
Guides & Tutorials,  Platforms & Tools

Meta Ads MCP setup: connect Claude Code to Meta in 2026

Four commands to wire Claude Code to Meta's official MCP server — and what to do with it once it's running.

Claude Code terminal querying the adlibrary API with ad data streaming in, producing structured competitor intelligence reports

Meta Ads MCP is real, it launched April 29 2026, and the setup is four commands. If you spend €5k–€100k/mo on Meta and you have Claude Code installed, you can have a write-capable Meta Ads MCP agent talking to your ad account before lunch. The catch — and this is the one most tutorials skip — is that wiring Meta Ads MCP without a creative angle is how you automate mediocrity at scale.

TL;DR: The Meta Ads MCP server at mcp.facebook.com/ads exposes 29 Marketing API tools to Claude Code via OAuth 2.0 — no developer app required. Add the config block, complete the OAuth flow, run ads_get_ad_accounts to confirm the connection, then let your Meta Ads MCP agent draft campaigns in PAUSED state for human review. Do Step 0 first: find the angle on adlibrary before you build anything.

What Meta Ads MCP actually is — and why beta status matters

The Meta Marketing API has existed for years, but using it always required provisioning a Facebook developer app, going through app review, managing access tokens, and writing or buying a wrapper. Meta Ads MCP changes that stack entirely.

Hosted at mcp.facebook.com/ads, the official server implements the Model Context Protocol — an open standard that lets AI clients discover and call tools on external servers. Claude Code acts as the MCP client. Meta's server is the tool provider. Authentication runs entirely through OAuth 2.0; you authorize against your existing Meta Business Manager account and the server handles token management.

As of the April 29 2026 launch, the server exposes 29 tools across the Meta Marketing API v25.0 surface — including ads_create_campaign, ads_insights_advertiser_context, ads_get_opportunity_score, and ads_insights_industry_benchmark. The beta label matters: tool signatures may shift between versions, and Meta has not committed to a backward-compatibility guarantee during this phase. Pin your Claude Code MCP config to the current endpoint and watch the Marketing API changelog for deprecation notices.

The bigger deal is the write capability. Previous AI-to-Meta integrations were read-only or required a middleware app with full developer access. MCP gives you a scoped, auditable, OAuth-gated write path from a conversational AI interface to live ad account data — for the first time, without a developer.

Step 0: find the angle on adlibrary before you wire MCP

Before you run a single install command, do this: go to adlibrary's unified ad search and pull the top 20 active ads in your category. Look for the hook pattern that keeps recurring across different brands. That's the angle the algorithm has rewarded — and it's the input your MCP agent needs before it writes a single campaign brief.

Here's what happens when buyers skip this step: Claude Code writes a campaign structure that's technically correct but creatively generic. The Advantage+ catalog knows it's seen this hook before. The learning phase runs long, CPMs spike, and you blame the agent. The agent didn't fail — the brief did.

Ad timeline analysis makes this concrete: it shows whether a competitor has been running a specific hook for four days or four weeks. A four-week run at consistent spend is strong signal. A four-day run is a test that hasn't proven anything yet. That distinction — temporal signal — is exactly what an MCP agent can't generate on its own. It can build what you hand it. It can't observe what's working in-market without a data layer for AI agents.

Get the angle first. Then build.

Install: 4 commands to connect Claude Code to mcp.facebook.com/ads

Prerequisites for the Meta Ads MCP setup: Claude Code installed, a Meta Business Manager account with at least one ad account you control.

Step 1 — Add the MCP server to your Claude Code config

Open (or create) your Claude Code MCP config file. On macOS it lives at ~/.claude/mcp.json.

json
{
  "mcpServers": {
    "meta-ads": {
      "url": "https://mcp.facebook.com/ads",
      "transport": "http"
    }
  }
}

That's the entire config block. No API keys, no environment variables — OAuth handles auth.

Step 2 — Start Claude Code and trigger the OAuth flow

bash
claude

On first use of any meta-ads tool, Claude Code will surface a login link via mcp_meta_ads_get_login_link. Click it, log in with the Meta account that owns your ad account, and complete the OAuth consent screen.

Step 3 — Pick your OAuth scopes deliberately

Meta's consent screen offers three scope tiers:

  • Read — view accounts, campaigns, ad sets, ads, and insights
  • Read/write — all of the above plus create, edit, and pause campaigns
  • Read/write/financial — includes billing, payment methods, and spend limit management

For a first connection, grant read/write but not financial. You want the agent to be able to draft and pause campaigns without being able to touch billing. See the permissions section below for the full audit-trail pattern.

Step 4 — Verify the connection

ads_get_ad_accounts

Ask Claude Code to call this tool. It should return a list of your Business Manager's ad accounts with IDs and names. If you see accounts, you're connected. If you get an auth error, re-run mcp_meta_ads_get_login_link and repeat the OAuth flow.

First read: verify the connection without touching live spend

Once your Meta Ads MCP connection is confirmed via ads_get_ad_accounts, run two more read queries before you touch any write tools.

Query 1 — Industry benchmark:

ads_insights_industry_benchmark

This returns category-level CPC, CPM, and CTR benchmarks from Meta's aggregate data. It's a useful sanity check that your account has proper read access, and the numbers give you a baseline for evaluating your own account's performance — relevant if you're using the learning phase calculator to estimate how many conversions you need before an ad set exits learning.

Query 2 — Advertiser context:

ads_insights_advertiser_context

This pulls your account's historical performance context — recent CPMs, conversion volume, audience overlap signals. Cross-reference this against in-market ad data from adlibrary's API access layer — together they give you a read-side picture of account health and competitor signals.

At this point you have confirmed read access. Nothing you've done has touched live spend. Good place to pause and review what the agent is seeing before you grant it write tools in your prompts.

For a deeper look at agentic marketing workflows with Claude Code, including how to chain read queries into automated reporting loops, that post walks through the orchestration patterns in detail.

First write: drafting a paused campaign end-to-end

The safest Meta Ads MCP write pattern on day one: instruct Claude Code to create the full campaign structure — campaign, ad set, ad — with every object in PAUSED state. You review in Ads Manager before activating anything.

Here's a prompt template that enforces this:

Using the meta-ads MCP server, create a campaign in account [ACCOUNT_ID] with the following structure. Set status = PAUSED on every object. Do not activate anything.

Campaign:
- Name: [CAMPAIGN_NAME]
- Objective: OUTCOME_TRAFFIC
- Status: PAUSED
- Special ad categories: none

Ad set:
- Name: [AD_SET_NAME]
- Daily budget: 5000 (cents)
- Targeting: broad, [COUNTRY_CODE]
- Bid strategy: LOWEST_COST_WITHOUT_CAP
- Status: PAUSED

Ad:
- Name: [AD_NAME]
- Creative: [describe your creative briefly]
- Status: PAUSED

Claude Code will call ads_create_campaign, then build the ad set and ad in sequence. All three objects land in your Ads Manager in PAUSED state. You can inspect targeting, budget, creative spec, and placement settings before a human clicks Publish.

This is the core workflow covered in depth at 10 Meta Ads MCP workflows for media buyers — that post has ready-to-run prompt templates for bulk ad set creation, creative testing matrices, and audience exclusion management.

For automated Facebook ad launching at scale — where you're launching 20+ ad variations in a single session — the paused-first pattern is not just a safety measure; it's a quality gate. Review 20 AI-drafted ads at once, reject or edit the weak ones, activate the strong set in a batch. That's a different speed of iteration than building one ad at a time.

Pipeboard vs Meta's official server: when to pick which

There is a well-maintained third-party alternative to Meta Ads MCP: Pipeboard's meta-ads-mcp on GitHub. It's worth knowing when each option fits.

DimensionMeta official (mcp.facebook.com/ads)Pipeboard (meta-ads-mcp)
Auth modelOAuth 2.0, no developer app neededRequires Facebook developer app + access token
HostingMeta-managed cloudSelf-hosted or local
LicenseProprietary (Meta ToS)BSL 1.1 — restricts commercial hosting
Tool coverage29 tools, Meta-maintainedVaries by release; community-maintained
Setup complexity4 commandsDeveloper app provisioning + token management
Audit trailOAuth consent logs in Business ManagerManual token rotation logging
Beta riskYes — tool signatures may changeMore stable but less feature velocity

For most media buyer workflows, the official server wins on setup simplicity and the absence of app provisioning. The BSL 1.1 license on Pipeboard means you can't wrap it in a commercial SaaS product without a separate license — relevant if you're building an automation tool for clients.

Pipeboard makes sense if: you need local control over the server process, you're on a compliance regime that requires data to stay on-premise, or you want to fork and extend the tool surface yourself.

For everyone else: start with mcp.facebook.com/ads.

Permissions, audit trails, and the read-only safety pattern

The Meta Ads MCP OAuth scope conversation is the one most setup tutorials skip. Get it wrong and you've given an AI agent the ability to move budget across accounts or change payment methods.

The three-tier model:

  • Read — safe for any automated agent. Use this for reporting loops, benchmarking, competitive monitoring via API access.
  • Read/write — appropriate for supervised agents that draft campaigns for human review. The paused-first pattern above is your guard rail.
  • Read/write/financial — only appropriate for tightly scoped workflows with an explicit human approval step for any financial action. Don't grant this to a general-purpose agent.

The audit trail question: Meta Business Manager logs OAuth authorizations under Settings > Security > Active Sessions. For team accounts, create a dedicated Business Manager user for MCP access — not your personal admin account. Agent activity stays attributable separately from human actions in the account log.

The read-only safety pattern: For monitoring and reporting agents — think always-on Meta Ads agents running on a schedule — grant read scope only. These agents can pull ads_get_opportunity_score daily, flag under-performing ad sets, and surface dynamic creative fatigue signals without any write exposure. The workflow post at competitor ad to Meta campaign pipeline shows how to chain adlibrary data into a read-only monitoring loop before any write tools fire.

For Meta ads campaign automation that involves live budget changes, the minimum viable safety pattern is: read/write scope, PAUSED state on all agent-created objects, and a Slack or email approval gate before any status change to ACTIVE.

One more thing that often gets missed: ads_get_opportunity_score is a read tool that calls Meta's internal scoring model against your account. It can surface campaigns where Advantage+ signals are strong but your manual targeting is constraining delivery. Run it before you restructure anything — it's a fast signal on where the algorithm wants to go before you let an agent launch multiple ads quickly. Once the agent fires that launch, the MCP vs Ads Manager call shapes what comes next — speed-bound bulk work to MCP, judgment-bound creative QA back to the UI. See also: campaign template system.

Frequently asked questions

What is Meta Ads MCP and how does it work?

Meta Ads MCP is Meta's official Model Context Protocol server hosted at mcp.facebook.com/ads. It exposes 29 tools from the Meta Marketing API v25.0 — including campaign creation, insights retrieval, and opportunity scoring — to any MCP-compatible AI client like Claude Code. Authentication uses OAuth 2.0; you connect once and the AI agent can then read account data and, if you grant write scopes, create or modify campaigns on your behalf.

Is Meta Ads MCP safe to connect with write permissions?

Yes, with the right guard rails. Meta's OAuth scope picker lets you grant read-only, read/write, or read/write/financial access. The safest production pattern is to grant read and read/write but keep all agent-created campaigns in PAUSED state for human review before activating. Never grant financial scope to an automated agent without an explicit approval step in your workflow.

What is the difference between Meta's official MCP server and Pipeboard?

Meta's official server at mcp.facebook.com/ads is OAuth-based, requires no developer app provisioning, and is directly maintained by Meta. Pipeboard's open-source meta-ads-mcp (github.com/pipeboard-co/meta-ads-mcp) requires a Facebook developer app but gives you local control and is licensed under BSL 1.1, which restricts commercial hosting. Most media buyers should start with Meta's official server.

How many tools does Meta Ads MCP expose?

As of its April 29 2026 beta launch, Meta Ads MCP exposes 29 tools including ads_create_campaign, ads_insights_advertiser_context, ads_get_opportunity_score, ads_insights_industry_benchmark, and mcp_meta_ads_get_login_link, among others.

Do I need a Meta developer app to use Meta Ads MCP?

No. Meta's official MCP server handles authentication entirely through OAuth 2.0 — you authorize via your existing Meta Business Manager account. No developer app, no app review, no access token wrangling. That is the key advantage over older Marketing API integrations.

Bottom line

Meta Ads MCP is the first write-capable agent path to the Meta Marketing API that doesn't require a developer. The setup is four commands. The discipline is in what you do before command one: pull the in-market angle from adlibrary, understand what's working, then let the agent build it — paused, reviewable, and scoped to the minimum permissions the task actually needs. For the full Claude Code for marketers picture, including how MCP fits into a broader agentic marketing stack, those posts are the natural next read.

Originally inspired by mcp.facebook.com. Independently researched and rewritten.

Related Articles