meta-ads-mcp
Provides tools for managing Facebook ad accounts, Pages, campaigns, ad sets, creatives, audiences, and insights through the Meta Marketing API.
Enables managing Instagram Business Accounts and Instagram ad campaigns, creatives, targeting, and insights via the Meta Marketing API.
Provides tools to interact with the Meta Marketing API v22.0 for managing ad accounts, ODAX campaigns, ad sets and targeting, creatives, insights, custom audiences, and pixels.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@meta-ads-mcp list my active Facebook campaigns and their daily budgets"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
meta-ads-mcp
Live Web Workbench & 24-Tool Playground: https://ads-mcp-workbench.netlify.app
Model Context Protocol (MCP) server for the Meta Marketing API (v22.0) — manage Facebook & Instagram ad accounts, ODAX campaigns, ad sets, targeting, creatives, insights, custom audiences, pixels, and automated account performance audits directly from Claude Desktop, Cursor, Windsurf, or Antigravity.
Highlights
24 MCP Tools covering Account Discovery, Campaigns, Ad Sets & Targeting, Ads & Creatives, Insights & Automated Audits, Custom Audiences, and Pixels.
2 MCP Resources & 2 MCP Prompts (
meta-ads://config/status,meta-ads://reference/objectives,audit-ad-account,draft-campaign-plan).Spend Safety Guardrails:
New campaigns, ad sets, and ads default to
status: "PAUSED".Every mutating tool supports
dry_run: trueto inspect the exact Graph API endpoint and payload without touching live spend.
Production HTTP Client:
Automatic
act_account ID normalization (123456→act_123456).Automatic cursor pagination (
fetchAllPages).Exponential backoff retries on transient Meta rate-limit/server error codes (
1,2,4,17,32,613,80000,80004).Rate-limit header telemetry (
x-app-usage,x-ad-account-usage,x-business-use-case-usage).Detailed Meta error reporting (
error_user_title,error_user_msg,code,error_subcode,fbtrace_id).
Built-in Demo Mode: Set
META_ADS_DEMO_MODE=trueto test every tool with realistic mock ad accounts and insights before adding a live token.
Related MCP server: meta-ads-mcp-server
Quick Start
1. Clone & Build
git clone https://github.com/1nc0gn30/meta-ads-mcp.git
cd meta-ads-mcp
npm install
npm run build2. Configure Your MCP Client
Claude Desktop (claude_desktop_config.json) / Cursor / Antigravity
{
"mcpServers": {
"meta-ads": {
"command": "node",
"args": ["/absolute/path/to/meta-ads-mcp/dist/index.js"],
"env": {
"META_ACCESS_TOKEN": "EAAB...",
"META_AD_ACCOUNT_ID": "act_1234567890",
"META_API_VERSION": "v22.0"
}
}
}
}Test Without a Token (Demo Mode)
{
"mcpServers": {
"meta-ads": {
"command": "node",
"args": ["/absolute/path/to/meta-ads-mcp/dist/index.js"],
"env": {
"META_ADS_DEMO_MODE": "true"
}
}
}
}Environment Variables
Variable | Required | Default | Description |
| Yes (live) | — | Meta System User or User Access Token ( |
| No | — | Default Ad Account ID (with or without |
| No |
| Meta Graph / Marketing API version |
| No |
| Override Graph API base URL (proxies / testing) |
| No |
| Set |
| No |
| HTTP timeout per request in milliseconds |
Tool Reference (24 Tools)
Auth & Account Discovery
Tool | Description |
| Verify token validity, granted permissions, API version, and rate limits |
| List accessible ad accounts with status, currency, spend cap, and business info |
| Fetch full metadata, balance, spend cap, and funding details for an account |
| List Facebook Pages and linked Instagram Business Accounts |
Campaigns
Tool | Description |
| List campaigns with |
| Get full configuration and budget details for a campaign |
| Create an ODAX campaign (defaults to |
| Update campaign name, status, budget, or bid strategy (supports |
Ad Sets & Targeting
Tool | Description |
| List ad sets by ad account or campaign |
| Get full ad set details including targeting spec and schedule |
| Create an ad set (defaults to |
| Update ad set status, budget, bid amount, end time, or targeting (supports |
| Search interests, geos, employers, job titles, or locales |
| Estimate potential audience reach for a targeting spec |
Ads & Creatives
Tool | Description |
| List ads by account, campaign, or ad set |
| Get ad details and linked creative metadata |
| Create a link/image ad creative ( |
| Create an ad inside an ad set (defaults to |
| Update ad name, status, or creative (supports |
| List uploaded ad images and their |
Insights, Audits, Audiences & Pixels
Tool | Description |
| Pull account/campaign/adset/ad insights with breakdowns and blended ROAS/CPA/CTR summary |
| Automated audit flagging creative fatigue, zero-conversion spend bleed, low CTR, and scaling winners |
| List custom and lookalike audiences with approximate size and delivery status |
| List Meta Pixels / Datasets attached to an ad account |
Development & Testing
npm run typecheck
npm run build
npm testThe test suite runs unit tests for the HTTP client (retry/backoff, pagination, rate-limit header capture, error parsing), analytics/audit checks, and full end-to-end stdio MCP client tests in both Demo Mode and Live HTTP Mode against a local mock Graph API server.
Support
This project is 100% free and open-source under the MIT License. If it saves you time:
☕ Buy Us a Coffee: https://buy.stripe.com/3cIfZg27PdKo2D64Ocfw40X
Solana Tip Address:
GG2eQbVh8ut1BK6j1A2tz7pSySdLpD38BgyEhGcxdXoK
Engineered by Neal Frazier Tech (@1nc0gn30) • NullAI Platform
Available Tools
24 toolsmeta_audit_account_performanceBRead-only
Run an automated performance audit on a Meta Ad Account: computes blended ROAS/CPA/CTR/CPM, flags creative fatigue (high frequency), zero-conversion spend bleed, low-CTR ads, and scaling winners.
Inputs: level, date_preset, ad_account_id, min_scale_roas, +3 more.
meta_check_authARead-only
Verify Meta Marketing API access token, granted permissions, API version, default ad account, and rate limit telemetry.
Inputs: no named parameters.
meta_create_adA
Create an ad inside an ad set referencing an existing creative ID. Defaults to PAUSED and supports dry_run=true.
Inputs: name (required), adset_id (required), creative_id (required), status, +2 more.
meta_create_ad_creativeC
Create a Meta link/image ad creative using object_story_spec. Supports dry_run=true.
Inputs: link (required), name (required), message (required), page_id (required), +7 more.
meta_create_adsetB
Create an ad set inside a campaign. Defaults to PAUSED for safety and supports dry_run=true.
Inputs: name (required), targeting (required), campaign_id (required), status, +10 more.
meta_create_campaignA
Create a new Meta Ads ODAX campaign. Defaults to PAUSED for spend safety. Supports dry_run=true to preview the API payload without creating a live campaign.
Inputs: name (required), objective (required), status, dry_run, +5 more.
meta_estimate_reachBRead-only
Estimate potential audience size for a given Meta targeting specification before launching an ad set.
Inputs: targeting_spec (required), ad_account_id.
meta_get_adBRead-only
Get full details and creative metadata for a specific ad ID.
Inputs: ad_id (required).
meta_get_ad_accountARead-only
Fetch detailed metadata, spend caps, balance, and funding status for a specific Meta Ad Account.
Inputs: ad_account_id.
meta_get_adsetARead-only
Get full details for a single ad set including targeting spec, optimization goal, schedule, and budget.
Inputs: adset_id (required).
meta_get_campaignARead-only
Retrieve full configuration and budget details for a single Meta campaign by ID.
Inputs: campaign_id (required).
meta_get_insightsCRead-only
Fetch Meta Ads performance insights at account, campaign, adset, or ad level with optional breakdowns, attribution windows, and automatic blended ROAS/CPA/CTR summary.
Inputs: level, limit, since, until, +6 more.
meta_list_ad_accountsBRead-only
List all Meta Ad Accounts accessible to the configured token, including currency, status, timezone, spend cap, and business owner.
Inputs: limit, max_pages.
meta_list_ad_imagesBRead-only
List uploaded ad images and their hashes for an ad account.
Inputs: limit, ad_account_id.
meta_list_adsBRead-only
List ads across an ad account, a specific campaign, or a specific ad set.
Inputs: limit, adset_id, max_pages, campaign_id, +2 more.
meta_list_adsetsBRead-only
List ad sets for an ad account or a specific campaign.
Inputs: limit, max_pages, campaign_id, ad_account_id, +1 more.
meta_list_campaignsBRead-only
List campaigns in an ad account with optional effective_status filter and pagination.
Inputs: limit, max_pages, ad_account_id, effective_status.
meta_list_custom_audiencesCRead-only
List custom audiences and lookalike audiences for an ad account.
Inputs: limit, ad_account_id.
meta_list_pagesARead-only
List Facebook Pages (and linked Instagram Business Accounts) accessible to the token for creating ad creatives.
Inputs: limit.
meta_list_pixelsBRead-only
List Meta Pixels (Datasets) attached to an ad account for conversion tracking.
Inputs: limit, ad_account_id.
meta_search_targetingARead-only
Search Meta's targeting taxonomy for interests, geos, job titles, employers, or locales.
Inputs: query (required), type, limit, location_types.
meta_update_adBIdempotent
Update an existing ad's name, status (ACTIVE/PAUSED/ARCHIVED), or creative_id. Supports dry_run=true.
Inputs: ad_id (required), name, status, dry_run, +1 more.
meta_update_adsetBIdempotent
Update an ad set's name, status, daily/lifetime budget, bid_amount, end_time, or targeting spec. Supports dry_run=true.
Inputs: adset_id (required), name, status, dry_run, +5 more.
meta_update_campaignBIdempotent
Update an existing campaign's name, status (ACTIVE/PAUSED/ARCHIVED), budget, or bid strategy. Supports dry_run=true.
Inputs: campaign_id (required), name, status, dry_run, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Most tools have a clearly distinct resource and action, with strong separation between campaign, ad set, ad, creative, targeting, and insights operations. Minor overlap exists between meta_get_insights and meta_audit_account_performance, and between meta_create_ad_creative and meta_create_ad, but descriptions make the boundaries workable.
All tools consistently use a meta_ prefix followed by a verb_noun pattern such as list_campaigns, get_ad, create_adset, update_campaign, and search_targeting. The convention is predictable throughout, with only natural variations like check_auth and audit_account_performance.
Twenty-four tools is on the heavy side, but the breadth of Meta Ads management justifies separate operations for accounts, campaigns, ad sets, ads, creatives, targeting, insights, and auditing. Each tool maps to a meaningful API operation, though some auxiliary listing tools could potentially be consolidated.
The core lifecycle from account discovery through campaign, ad set, ad, creative, targeting, and performance insights is well covered. Gaps remain around explicit delete operations, creative retrieval/update beyond image listing, and creation of custom audiences or pixels, though archiving via status updates mitigates some of this.
Maintenance
Related MCP Connectors
Meta Ads MCP server: run Facebook and Instagram campaigns, ad sets, ads and reports from AI.
Meta Ads MCP: Facebook and Instagram reports, campaigns, creatives, audiences. Approval on writes.
Run Google, TikTok, LinkedIn, Reddit and X ads (Meta in limited access) from any MCP client.
1Ads MCP for Meta, Google Ads, TikTok, Snapchat and LinkedIn: stage launches and manage campaigns.
Related MCP Servers
- FlicenseCqualityDmaintenanceEnables managing Facebook ads campaigns, ad sets, ads, creatives, insights, and audience targeting via Meta's Marketing API.39-
- AlicenseAqualityBmaintenanceEnables MCP clients to read and analyze Facebook (Meta) Ads marketing data, including campaigns, ad sets, ads, insights, and 190 metrics, with optional write tools that preview changes before applying.412Apache 2.0
- AlicenseNot gradedqualityAmaintenanceEnables managing Meta advertising accounts, campaigns, ad sets, creatives, audiences, reporting, and batch workflows through an authenticated MCP endpoint with per-workspace OAuth connections.39 npmMIT
- AlicenseAqualityBmaintenanceEnables MCP-compatible clients to query advertising data, analyze spend, conversions, and audiences, compare campaigns, generate dashboards, and manage campaigns with optional read-only safeguards.28Apache 2.0