meta-ads-mcp
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
MCP server for the **Meta Marketing API v26.0** — 134 tools for managing Facebook & Instagram ad campaigns, audiences, creatives, insights, catalogs, and more.
When to Use
Use this MCP when you need to:
- **"Create a new Facebook ad campaign"** — use create_campaign, create_adset, create_ad, and create_creative to build a full funnel
- **"Check how my ads are performing today"** — use get_account_insights or get_campaign_insights with today's date range
- **"Pause all campaigns with ROAS below 2"** — use list_campaigns + get_campaign_insights to find underperformers, then update_campaign to pause
- **"Set up A/B test between two ad creatives"** — use create_experiment to run a controlled test between ad sets
- **"Create a lookalike audience from my customers"** — use create_custom_audience, add_users_to_audience, then create_lookalike_audience
- **"Upload ad images and create a carousel ad"** — use upload_image for each image, then create_creative with carousel format
- **"Get a detailed performance report for last 30 days"** — use create_async_report for large date ranges, then get_async_report to retrieve
- **"Search the Facebook Ad Library for competitor ads"** — use search_ad_library to find public ad data
- **"Set up automated rules to pause underperforming ads"** — use create_rule with conditions like CPA > threshold
- **"Manage my product catalog for dynamic ads"** — use create_catalog, create_feed, and upload_feed to set up dynamic product ads
What's New in v1.5.0
- Conversion tools validate the existing events JSON input and send it as the required data array. Use test_event_code to verify receipt in Events Manager; offline events use a dataset ID and action_source=physical_store for store events.
- Creative creation accepts top-level destination_spec, wamo_whatsapp_identity_spec, and degrees_of_freedom_spec JSON objects. Dynamic creatives also accept object_story_spec for Page identity. To opt out of the v26 Shops destination default, set destination_spec to {"destination_type":"WEBSITE_AND_SHOP_OPT_OUT"}.
- Includes complete async-report result retrieval, token extension, and budget schedule fixes since v1.4.1. Some detailed Insights breakdowns require an Ads Manager opt-in; an empty response does not necessarily mean zero performance.
Installation
Environment Variables
| Variable | Required | Description |
|---|---|---|
| META_ADS_ACCESS_TOKEN | **Yes** | Meta Marketing API access token |
| META_AD_ACCOUNT_ID | **Yes** | Ad account ID (numeric, without act_ prefix) |
| META_APP_ID | Optional | App ID — required for token exchange/extension and debug |
| META_APP_SECRET | Optional | App secret — required for token exchange/extension and debug |
| META_BUSINESS_ID | Optional | Business Manager ID — required for business tools |
| META_PIXEL_ID | Optional | Pixel ID — required for conversion tools |
Tools (134)
Campaign Management (25)
| Tool | Description |
|---|---|
| list_campaigns | List campaigns with filtering and pagination |
| get_campaign | Get campaign details by ID |
| create_campaign | Create a new campaign |
| update_campaign | Update campaign settings |
| delete_campaign | Delete a campaign |
| copy_campaign | Copy an existing campaign with ad sets and ads |
| get_campaign_adsets | List ad sets within a campaign |
| get_campaign_ads | List ads within a campaign |
| get_campaign_leads | Get leads from a campaign |
| list_adsets | List ad sets with filtering |
| get_adset | Get ad set details by ID |
| create_adset | Create a new ad set |
| update_adset | Update ad set settings |
| delete_adset | Delete an ad set |
| copy_adset | Copy an existing ad set to same or different campaign |
| get_adset_targeting_sentence | Get human-readable targeting description |
| get_adset_ads | List ads within an ad set |
| get_adset_leads | Get leads from an ad set |