Meta Ads

io.github.mikusnuz由 GitHub 账号 mikusnuz 发布v1.6.1更新于 Nov 3, 2026

MCP server for Meta Marketing API — Facebook & Instagram ad campaign management

概览

AI 生成的概览

面向 Meta Marketing API 的本地 MCP 服务器,让助手创建、查看、修改和删除 Facebook 与 Instagram 广告系列、受众、创意和报表。

可以做什么
  • 列出、创建、更新、复制和删除广告系列、广告组与广告,并可生成预览和投放估算
  • 管理创意、图片、视频和 Instant Experience 画布,包括上传素材
  • 创建和编辑自定义受众、类似受众与已保存受众,搜索兴趣和地域定向,估算覆盖人数
  • 获取账户、广告系列、广告组和广告层级的成效数据,并为长时间范围创建异步报表
  • 处理潜在客户表单与线索、商品目录、数据源以及批量商品操作
  • 管理自动规则、A/B 实验、预算排期、屏蔽列表、企业用户和系统用户,并发送转化或线下事件
适用场景
适合让助手直接操作真实的 Meta 广告账户:搭建完整广告漏斗、查看当日表现、暂停表现不佳的广告、设置 A/B 测试或类似受众,或生成较长时间范围的报表。
运行要求
通过 npx 在本地运行,需要 Node.js 20 或更高版本。需要 Meta Marketing API 访问令牌(META_ADS_ACCESS_TOKEN)和广告账户 ID(META_AD_ACCOUNT_ID);令牌交换与调试需要 META_APP_ID 和 META_APP_SECRET,企业工具需要 META_BUSINESS_ID,转化工具需要 META_PIXEL_ID。令牌需按所用工具具备 ads_management、ads_read、business_management、leads_retrieval、catalog_management 等权限。
安装前请注意
该令牌拥有真实的写入权限:工具会创建、修改和删除广告系列、广告、受众、目录和规则,创建受众是真实写入而非试运行。广告系列和预算排期的改动会影响预算与花费。META_ADS_ACCESS_TOKEN 和 META_APP_SECRET 属于机密,不应放入共享配置。线索与客户数据(包括受众用户名单)会被发送给 Meta。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Meta Ads,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

meta-ads-mcp

[npm version] [License: MIT]

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.6.0

  • create_adset accepts bid_amount; creation and updates accept dsa_beneficiary and dsa_payor. For EU-targeted ads, supply each required value or configure the corresponding account default. The payer does not automatically copy the beneficiary.
  • Ad and ad-set lists use campaign/ad-set edges when scoped. Combined campaign/ad-set filters and explicit account IDs are checked for consistency.
  • create_adset and update_adset accept destination_type, attribution_spec, adset_schedule, pacing_type, and validate_only. Existing calls still perform their requested writes; set validate_only: true to ask Meta to validate without mutation. A successful validation does not create an ad set.
  • Hourly schedules accept minute ranges and days (Sunday = 0); specify timezone_type as USER or ADVERTISER. Scheduling adds day_parting pacing. Meta validates effective lifetime budgeting, objective eligibility, and attribution restrictions. No budget or status is changed automatically.
  • create_custom_audience accepts a JSON rule, pixel_id, and retention_days for rule-based audiences. Audience creation is a real write, not a dry run.

See the official ad-set creation and ad-set update contracts.

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

Requires Node.js 20 or later, including the MCP host's npx environment.

json
{  "mcpServers": {    "meta-ads": {      "command": "npx",      "args": ["-y", "@mikusnuz/meta-ads-mcp"],      "env": {        "META_ADS_ACCESS_TOKEN": "your-access-token",        "META_AD_ACCOUNT_ID": "123456789",        "META_APP_ID": "your-app-id",        "META_APP_SECRET": "your-app-secret",        "META_BUSINESS_ID": "your-business-id",        "META_PIXEL_ID": "your-pixel-id"      }    }  }}

Environment Variables

VariableRequiredDescription
META_ADS_ACCESS_TOKENYesMeta Marketing API access token
META_AD_ACCOUNT_IDYesAd account ID (numeric, without act_ prefix)
META_APP_IDOptionalApp ID — required for token exchange/extension and debug
META_APP_SECRETOptionalApp secret — required for token exchange/extension and debug
META_BUSINESS_IDOptionalBusiness Manager ID — required for business tools
META_PIXEL_IDOptionalPixel ID — required for conversion tools

Tools (134)

Campaign Management (25)

ToolDescription
list_campaignsList campaigns with filtering and pagination
get_campaignGet campaign details by ID
create_campaignCreate a new campaign
update_campaignUpdate campaign settings
delete_campaignDelete a campaign
copy_campaignCopy an existing campaign with ad sets and ads
get_campaign_adsetsList ad sets within a campaign
get_campaign_adsList ads within a campaign
get_campaign_leadsGet leads from a campaign
list_adsetsList ad sets with filtering
get_adsetGet ad set details by ID
create_adsetCreate a new ad set
update_adsetUpdate ad set settings
delete_adsetDelete an ad set
copy_adsetCopy an existing ad set to same or different campaign
get_adset_targeting_sentenceGet human-readable targeting description
get_adset_adsList ads within an ad set
get_adset_leadsGet leads from an ad set
list_adsList ads with filtering
get_adGet ad details by ID
create_adCreate a new ad
update_adUpdate ad settings
delete_adDelete an ad
copy_adCopy an existing ad to same or different ad set
get_ad_previewGenerate ad preview HTML
get_delivery_estimateGet delivery estimate for an ad set

Creatives (6)

ToolDescription
list_creativesList ad creatives
get_creativeGet creative details
create_creativeCreate a new ad creative
update_creativeUpdate an ad creative
create_dynamic_creativeCreate a dynamic creative
generate_previewGenerate ad preview from creative spec without an existing ad

Media Assets (12)

ToolDescription
list_imagesList ad images
upload_imageUpload an image from a URL or local file
get_imageGet image details
delete_imageDelete an image
list_videosList ad videos
upload_videoUpload a video from a URL or local file
get_videoGet video details
delete_videoDelete a video
list_canvasesList Instant Experience canvases
get_canvasGet canvas details
create_canvasCreate a canvas
delete_canvasDelete a canvas

Audiences & Targeting (16)

ToolDescription
list_custom_audiencesList custom audiences
get_audienceGet audience details
create_custom_audienceCreate a custom audience
update_audienceUpdate audience settings
delete_audienceDelete an audience
add_users_to_audienceAdd users to a custom audience
remove_users_from_audienceRemove users from a custom audience
create_lookalike_audienceCreate a lookalike audience
get_audience_healthGet audience health, delivery status, and match rate
list_saved_audiencesList saved audiences
get_saved_audienceGet saved audience details
search_targetingSearch targeting interests, behaviors, demographics
search_locationsSearch targetable locations
search_targeting_mapBrowse targeting category tree
get_reach_estimateEstimate audience reach for targeting spec
get_targeting_suggestionsGet related targeting suggestions

Insights & Reporting (6)

ToolDescription
get_account_insightsAccount-level performance metrics
get_campaign_insightsCampaign-level performance metrics
get_adset_insightsAd set-level performance metrics
get_ad_insightsAd-level performance metrics
create_async_reportCreate an async insights report
get_async_reportPoll the report-run status, then fetch its /insights results when complete

date_preset values are lowercase Graph API identifiers such as today, yesterday, last_7d, and last_30d. create_async_report always creates an asynchronous job; get_async_report returns status immediately and, by default, fetches the paginated result edge after the status becomes Job Completed.

Leads (5)

ToolDescription
get_form_leadsGet leads from a lead form
get_leadGet a single lead by ID
create_lead_formCreate a new lead generation form on a page
list_lead_formsList lead gen forms for a page
get_lead_formGet lead form details

Catalog & Commerce (17)

ToolDescription
list_catalogsList product catalogs
get_catalogGet catalog details
create_catalogCreate a product catalog
update_catalogUpdate a catalog
list_product_setsList product sets in a catalog
create_product_setCreate a product set
get_product_setGet product set details
update_product_setUpdate a product set
list_productsList products in a catalog
get_productGet product details
update_productUpdate a product
list_feedsList data feeds for a catalog
create_feedCreate a data feed
upload_feedUpload data to a feed
get_feed_uploadsGet feed upload history
batch_productsBatch create, update, or delete products (up to 5,000/request)
get_batch_statusCheck status of a catalog batch operation

Automation & Rules (5)

ToolDescription
list_rulesList automated rules
get_ruleGet rule details
create_ruleCreate an automated rule
update_ruleUpdate a rule
delete_ruleDelete a rule

Experiments (5)

ToolDescription
list_experimentsList A/B test experiments
create_experimentCreate an experiment
get_experimentGet experiment details
update_experimentUpdate an experiment
get_experiment_resultsGet experiment results

Conversions (4)

ToolDescription
send_conversion_eventSend server-side conversion event via Conversions API
send_offline_eventSend an offline conversion event
list_offline_event_setsList offline event sets
create_offline_event_setCreate an offline event set

Budget & Planning (8)

ToolDescription
list_budget_schedulesList schedules from a campaign or ad set budget_schedules edge
create_budget_scheduleCreate a schedule on a campaign or ad set
update_budget_scheduleUpdate a budget schedule
delete_budget_scheduleDelete a budget schedule
list_rf_predictionsList Reach & Frequency predictions
create_rf_predictionCreate a Reach & Frequency prediction
get_rf_predictionGet prediction details
delete_rf_predictionDelete a prediction

Brand Safety (5)

ToolDescription
list_block_listsList publisher block lists
create_block_listCreate a block list
add_to_block_listAdd URLs/domains to a block list
remove_from_block_listRemove entries from a block list
delete_block_listDelete a block list

Account & Business (15)

ToolDescription
get_ad_accountGet ad account details
list_ad_accountsList ad accounts for a business
update_ad_accountUpdate ad account settings
get_account_activitiesGet account activity log
list_account_usersList users with access to the account
list_businessesList businesses you have access to
get_businessGet business details
list_business_ad_accountsList ad accounts in a business
list_business_usersList users in a business
add_business_userAdd a user to a business
remove_business_userRemove a user from a business
list_business_pagesList Facebook Pages owned by a business
list_business_instagram_accountsList Instagram accounts owned by a business
list_system_usersList system users for a business
create_system_userCreate a system user

Auth & Token (3)

ToolDescription
exchange_tokenExchange short-lived token for long-lived token
refresh_tokenExtend a valid long-lived user token through the documented exchange flow
debug_tokenDebug/inspect token metadata

Ad Library (1)

ToolDescription
search_ad_librarySearch Meta Ad Library for public ad data

Resources (3)

URIDescription
ads://accountAd account overview — status, balance, currency, timezone, and total spend
ads://campaigns-overviewAll active campaigns with budget information
ads://spending-todayToday's spending summary — spend, impressions, clicks, and reach

Prompts (3)

PromptDescription
campaign_wizardStep-by-step guide to create a full ad campaign from scratch
performance_reportAnalyze ad performance with detailed breakdowns and recommendations
audience_builderBuild and refine target audiences using Meta's targeting tools

Permissions Required

Your Meta access token needs the following permissions depending on which tools you use:

PermissionTools
ads_managementAll campaign, ad set, ad, and creative CRUD operations
ads_readAll read/list operations and insights
business_managementBusiness tools, system users, account assignments
leads_retrievalLead form and lead data tools
catalog_managementCatalog, product set, product, and feed tools
pages_read_engagementLead forms linked to pages

License

MIT

来源:README.md,提交 ccb4489

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

3
  1. v1.6.1最新Oct 19, 2026
  2. v1.5.0Oct 8, 2026
  3. v1.2.1Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分