Meta Ads

Facebook and Instagram campaign management via Meta Marketing API v21.0

16 tools available

Installation

Claude Desktop

{
  "mcpServers": {
    "hopkin-meta-ads": {
      "url": "https://mcp.hopkin.ai/meta-ads/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

CLI

npm install -g @hopkin/cli
hopkin auth set-key hpk_live_...
hopkin meta ping

Platform Overview

The Meta Ads MCP server enables AI assistants to manage and analyze Meta (Facebook/Instagram) advertising campaigns through the Meta Marketing API v21.0. It provides comprehensive tools for account management, campaign and audience targeting configuration, performance analytics, creative analysis, and pixel health diagnostics — allowing you to automate campaign workflows, retrieve insights at any aggregation level, and debug tracking issues.

Your prompt → Claude + Hopkin → Meta Marketing API v21.0
                                    ↓
                              Campaign Data
                              Performance Metrics  
                              Audience Insights
                              Creative Reports
                              Pixel Health Diagnostics

Common Workflows

Performance Reporting

Get a snapshot of how your campaigns are performing across impressions, clicks, conversions, and return on ad spend.

"What was our total spend, impressions, and ROAS last month?"

Calls meta_ads_get_account_summary with a date range. Returns aggregated account-level metrics in a standardized format for quick overviews without needing to drill down into individual campaigns.

"Show me performance by campaign for January."

Calls meta_ads_get_performance_report with level: 'campaign' and a custom date range. Returns full-funnel metrics (delivery → engagement → conversions → ROAS) broken down by campaign so you can compare which campaigns are driving the most value.

"What are the impressions, clicks, and conversion rate for all active campaigns this week?"

Calls meta_ads_list_campaigns with status filter, then meta_ads_get_insights or meta_ads_get_performance_report at the campaign level for the current week. Returns a table-format response showing each campaign's key metrics side-by-side.

Campaign Management

View, search, and explore the hierarchy of campaigns, ad sets, and individual ads.

"List all my active campaigns"

Calls meta_ads_list_campaigns with status: ['ACTIVE']. Returns paginated list of active campaigns with names, IDs, statuses, budgets, and stored preferences or recent change history.

"Find ad sets in campaign ABC123 that are paused"

Calls meta_ads_list_adsets with campaign_id: 'ABC123' and status: ['PAUSED']. Returns ad sets filtered by that campaign with pagination, search capability, and optional metrics if include_assets: true.

"Get all ads in ad set XYZ with their creative assets and landing pages"

Calls meta_ads_list_ads with adset_id: 'XYZ' and include_assets: true. Response includes resolved creative media URLs (images, videos) plus a summary section listing all unique landing page URLs found in those ads — ideal for quickly auditing destination URLs without reading every ad individually.

Audience & Creative Analysis

Analyze demographic performance and compare which creative variants are driving engagement.

"Break down our last week's performance by age and gender"

Calls meta_ads_get_insights with date_preset: 'last_7d', level: 'account', and breakdowns: ['age', 'gender']. Returns demographic slice of performance metrics showing which age/gender groups have the highest CTR, conversion rate, and ROAS.

"Show creative performance for all ads, aggregated by creative name"

Calls meta_ads_get_ad_creative_report with level: 'ad_name' and a date range. Returns creative variants grouped by name with full-funnel metrics; each group includes a representative ad_id that can be passed to meta_ads_preview_ads to visually inspect that creative.

"Which video ads have the highest video completion rate?"

Calls meta_ads_get_insights with level: 'ad', fields: ['video_p25_watched_actions', 'video_p50_watched_actions', 'video_p75_watched_actions', 'video_p100_watched_actions'], and a date range. Returns per-ad video completion funnel showing what percentage of viewers watched 25%, 50%, 75%, and 100% of each video.

Budget & Spend Monitoring

Keep tabs on spending and campaign pacing.

"How much have we spent this month across all campaigns?"

Calls meta_ads_get_account_summary with the current month's date range. Returns account-level spend, impressions, clicks, and conversions in one call.

"Show daily spend trend for the past week"

Calls meta_ads_get_performance_report with time_increment: 1 (daily), date_preset: 'last_7d'. Returns spend broken down day-by-day, ideal for spotting anomalies or tracking pacing toward daily/monthly budgets.

Recipes

"I suspect a tracking issue is tanking our ROAS. Check our pixel health first."

Calls meta_ads_get_pixel_health to retrieve pixel metadata, CAPI connection status, event volume, automatic matching config, and diagnostic checks (including event match quality). If CAPI is not connected or event volume is low, tracking is the problem — not campaign performance. This is the essential diagnostic tool before investigating campaign-level metrics.

"Show me the top 3 performing creatives by ROAS this month, with a visual preview of each."

Calls meta_ads_get_ad_creative_report with level: 'ad_name' sorted by ROAS descending, limited to 3 results. Extracts the representative ad_id from each, then calls meta_ads_preview_ads with those ad IDs and includes ROAS as a metric label. Returns visual previews of the creative images/videos alongside the ROAS figure so you can visually compare winners.

"List all paused campaigns, show me their recent change history, and tell me who paused them."

Calls meta_ads_list_campaigns with status: ['PAUSED']. For each campaign ID, calls meta_ads_get_activities with entity_id: <campaign_id> and entity_type: 'CAMPAIGN'. Aggregates the activity logs to show when each campaign was paused and by whom (from the activity record).

"Find underperforming ad sets (low ROAS) within my top-spend campaign and show me their demographic breakdowns."

Calls meta_ads_get_performance_report with level: 'adset', filtered to the top-spend campaign. Identifies ad sets with ROAS below a threshold. For each, calls meta_ads_get_insights with breakdowns: ['age', 'gender'] to find demographic segments (e.g., women 35-44) that are underperforming — useful for tightening audience targeting.

"I need to audit all landing pages being used across active ads. Give me a categorized summary."

Calls meta_ads_list_ads with status: ['ACTIVE'] and include_assets: true. The markdown response includes a "Landing Page URLs" summary section listing all unique destination URLs. Group those by domain (e.g., homepage vs. product pages) to identify which landing pages are live and used by active ads.

"Show me a 90-day performance trend by publisher (Instagram vs. Facebook) to decide where to shift budget."

Calls meta_ads_get_insights with date_preset: 'last_90d', breakdowns: ['publisher_platform'], and optional time_increment: 7 for weekly aggregation. Returns 90-day performance sliced by Instagram, Facebook, Audience Network, etc., so you can see which platform is most efficient and recommend budget reallocation.

Tips

Date Presets vs. Custom Ranges: Use date_preset for standard lookbacks (e.g., last_7d, last_30d, last_quarter) for faster responses. For precise custom ranges, use time_range: { since: '2026-01-01', until: '2026-01-31' }. Both meta_ads_get_insights and meta_ads_get_performance_report support both modes.

Breakdowns Available: Demographic (age, gender, country), device/platform (device_platform, publisher_platform, platform_position), time-based (hourly_stats_aggregated_by_advertiser_time_zone for intra-day analysis), and creative assets (ad_format_asset, video_asset, image_asset, etc.). Not all breakdowns are available at all levels — try the combination first; if unsupported, the API will return an error with guidance.

Cache-First Behavior: List tools (meta_ads_list_campaigns, meta_ads_list_ad_accounts, etc.) return cached data by default with a cached: boolean flag and synced_at timestamp. For real-time data, pass refresh: true. Reporting tools (meta_ads_get_performance_report, meta_ads_get_insights) always fetch fresh data — no caching applies.

Landing Pages in Ad List: When calling meta_ads_list_ads with include_assets: true, the markdown response automatically includes a "Landing Page URLs" summary at the end listing all unique destination URLs found across the ads — saves you from parsing individual ad objects to audit where traffic is going.

Tools

account-summary

meta_ads_get_account_summary Get Meta Ads Account Summary

Read-onlyIdempotent

Standardized account-level performance summary for cross-platform comparison. Normalized format identical to google_ads_get_account_summary. Includes conversion_detail breakdown from both Meta actions and conversions arrays. Preferred over get_insights or get_performance_report for quick account-level overviews. Always fetches fresh data.

ParameterTypeDescription
account_id requiredstringMeta ad account ID
reason requiredstringWhy this tool call is needed
2 optional parameters
ParameterTypeDescription
date_presetstringPredefined date range (e.g., last_7d, last_30d, this_month)
time_rangeobjectCustom date range {since, until} in YYYY-MM-DD
View full documentation →

activities

meta_ads_get_activities Get Meta Ads Activities

Read-onlyIdempotentOpen-world

Retrieve activity/change history for a Meta ad account or specific entity. Cached with 1-hour TTL; use refresh=true for fresh data. Meta's API only returns the last 7 days per call, but cached data accumulates for historical lookups.

ParameterTypeDescription
account_id requiredstringThe ad account ID (with or without act_ prefix)
reason requiredstringWhy this tool call is needed
7 optional parameters
ParameterTypeDescription
entity_idstringFilter activities to a specific entity (campaign, ad set, or ad ID). If omitted, returns account-level activities.
entity_typestringType of entity: ACCOUNT, CAMPAIGN, AD_SET, AD. Used with entity_id for filtering.
start_datestringStart date for activity range (ISO 8601, e.g. 2024-01-01)
end_datestringEnd date for activity range (ISO 8601, e.g. 2024-01-31)
limitintegerNumber of activities per page (default: 20, max: 100)
cursorstringPagination cursor from previous response
refreshbooleanForce fresh activity data from Meta API instead of using cache. Defaults to false (cache-first). Only set to true when you need real-time data.
View full documentation →

ad-accounts

meta_ads_list_ad_accounts List Meta Ad Accounts

Read-onlyOpen-world

List Meta ad accounts with search, status filtering, single/multi-account lookup by ID, and pagination. Cached by default; pass refresh=true for latest data. Entities may include _stored_preferences and optionally recent activities.

ParameterTypeDescription
reason requiredstringWhy this tool call is needed
8 optional parameters
ParameterTypeDescription
refreshbooleanForce fresh data from Meta API instead of using cache. Defaults to false (cache-first). Only set to true when you need real-time data.
cursorstringPagination cursor from previous response
searchstringSearch ad accounts by name (case-insensitive partial match)
account_idstringFilter by exact account ID (without act_ prefix)
account_idsarrayGet multiple accounts by ID. Mutually exclusive with account_id. When provided, ignores other filters/pagination.
statusintegerAccount status code (1=Active, 2=Disabled, etc.)
limitintegerNumber of accounts per page (default: 20, max: 100)
include_activitiesbooleanInclude recent activity log (last 7 days of changes) for each entity
View full documentation →

reporting

meta_ads_get_ad_creative_report Get Meta Ads Creative Performance Report

Read-onlyIdempotent

Ad-level performance report with full funnel metrics. All conversion types shown individually. Supports two grouping modes: ad_name (default, aggregates ads sharing the same name with a representative ad_id for preview) and ad_id (one row per ad). The representative ad_id can be passed to meta_ads_preview_ads. Always fetches fresh data.

ParameterTypeDescription
account_id requiredstringMeta ad account ID
time_range requiredobjectRequired date range {since, until} in YYYY-MM-DD
reason requiredstringWhy this tool call is needed
4 optional parameters
ParameterTypeDescription
levelstringGrouping level: ad_name (default, aggregate ads sharing the same name, providing a representative ad_id that can be passed to meta_ads_preview_ads) or ad_id (one row per ad)
time_incrementunknownTime grouping: 1=daily, 7=weekly, or "monthly"
breakdownsarraySegment by dimension. Pass multiple values for cross-tabulated rows (e.g. ["age","gender"] → one row per "35-44 / female" segment). Available: age, gender, country, region, device_platform, publisher_platform, platform_position, impression_device, dma
filteringarrayFilters as [{field, operator, value}]
View full documentation →

meta_ads_get_performance_report Get Meta Ads Performance Report

Read-onlyIdempotent

Full impression-to-conversion funnel report with delivery, engagement, actions, conversions, ROAS, and quality rankings. Preferred over meta_ads_get_insights for standard analysis. Use get_insights only for custom fields, hourly/creative-asset breakdowns, or video metrics. Always fetches fresh data.

ParameterTypeDescription
account_id requiredstringMeta ad account ID
time_range requiredobjectRequired date range {since, until} in YYYY-MM-DD
reason requiredstringWhy this tool call is needed
5 optional parameters
ParameterTypeDescription
time_incrementunknownTime grouping: 1=daily, 7=weekly, or "monthly"
levelstringAggregation level (default: account): account, campaign, adset, ad
breakdownsarrayDimensions to segment data by. Pass multiple values in a single call to get cross-tabulated rows (e.g. ["age","gender"] → one row per "35-44 / female" segment). Do NOT make separate calls for each dimension. Available: age, gender, country, region, device_platform, publisher_platform, platform_position, impression_device, dma
filteringarrayFilters as [{field, operator, value}]
action_attribution_windowsarrayAttribution windows for action/conversion metrics. Controls which click/view windows are reported. Common: ["7d_click"] for 7-day click only. Default (when omitted): ["7d_click","1d_view"]. Available: 1d_click, 7d_click, 28d_click, 1d_view, 7d_view, 28d_view, 1d_ev, default
View full documentation →

ads

meta_ads_list_ads List Meta Ads

Read-onlyIdempotentOpen-world

List ads for a Meta ad account with ad set filtering, status, name search, single/multi-ad lookup by ID, and pagination. Each ad includes a Landing URL when available (extracted from object_story_spec, link_url, or asset_feed_spec depending on ad format). A "Landing Page URLs" summary section at the end of the response lists all unique destination URLs found — use this to quickly answer landing page questions without reading every ad. Set include_assets=true to include resolved creative media URLs (adds latency for cache misses). Entities may include _stored_preferences and optionally recent activities.

ParameterTypeDescription
account_id requiredstringThe ad account ID (with or without act_ prefix)
reason requiredstringWhy this tool call is needed
10 optional parameters
ParameterTypeDescription
ad_idstringGet a specific ad by ID. When provided, returns only that ad and ignores other filters/pagination.
ad_idsarrayGet multiple ads by ID. Mutually exclusive with ad_id. When provided, ignores other filters/pagination.
adset_idstringFilter by ad set ID
searchstringSearch ads by name (case-insensitive partial match)
statusarrayFilter by ad status: ACTIVE, PAUSED, DELETED, ARCHIVED
limitintegerNumber of ads per page (default: 20, max: 100)
cursorstringPagination cursor from previous response
refreshbooleanForce fresh data from Meta API instead of using cache. Defaults to false (cache-first). Only set to true when you need real-time data.
include_activitiesbooleanInclude recent activity log (last 7 days of changes) for each entity
include_assetsbooleanInclude resolved creative asset URLs (asset_url, thumbnail_url, asset_type) for each ad. Uses cached GCS URLs when available.
View full documentation →

adsets

meta_ads_list_adsets List Meta Ad Sets

Read-onlyIdempotentOpen-world

List ad sets for a Meta ad account with campaign filtering, status, name search, single/multi-adset lookup by ID, and pagination. Entities may include _stored_preferences and optionally recent activities.

ParameterTypeDescription
account_id requiredstringThe ad account ID (with or without act_ prefix)
reason requiredstringWhy this tool call is needed
9 optional parameters
ParameterTypeDescription
adset_idstringGet a specific ad set by ID. When provided, returns only that ad set and ignores other filters/pagination.
adset_idsarrayGet multiple ad sets by ID. Mutually exclusive with adset_id. When provided, ignores other filters/pagination.
campaign_idstringFilter by campaign ID
searchstringSearch ad sets by name (case-insensitive partial match)
statusarrayFilter by ad set status: ACTIVE, PAUSED, DELETED, ARCHIVED
limitintegerNumber of ad sets per page (default: 20, max: 100)
cursorstringPagination cursor from previous response
refreshbooleanForce fresh data from Meta API instead of using cache. Defaults to false (cache-first). Only set to true when you need real-time data.
include_activitiesbooleanInclude recent activity log (last 7 days of changes) for each entity
View full documentation →

auth

meta_ads_check_auth_status Check Meta Ads Authentication Status

Read-onlyIdempotent

Troubleshoot authentication issues and get user profile info. Only use this tool when another tool fails with a permission or authentication error — do NOT call proactively.

ParameterTypeDescription
reason requiredstringWhy this tool call is needed
View full documentation →

meta_ads_ping Ping Meta Ads MCP Server

Read-onlyIdempotent

Health check for the Meta Ads MCP server.

ParameterTypeDescription
reason requiredstringWhy this tool call is needed
1 optional parameter
ParameterTypeDescription
messagestringOptional message to echo back
View full documentation →

campaigns

meta_ads_list_campaigns List Meta Ad Campaigns

Read-onlyIdempotentOpen-world

List campaigns for a Meta ad account with status filtering, name search, single/multi-campaign lookup by ID, and pagination. Entities may include _stored_preferences and optionally recent activities.

ParameterTypeDescription
account_id requiredstringThe ad account ID (with or without act_ prefix)
reason requiredstringWhy this tool call is needed
8 optional parameters
ParameterTypeDescription
statusarrayFilter by campaign status: ACTIVE, PAUSED, DELETED, ARCHIVED
limitintegerNumber of campaigns per page (default: 20, max: 100)
cursorstringPagination cursor from previous response
refreshbooleanForce fresh data from Meta API instead of using cache. Defaults to false (cache-first). Only set to true when you need real-time data.
campaign_idstringGet a specific campaign by ID. When provided, returns only that campaign and ignores other filters/pagination.
campaign_idsarrayGet multiple campaigns by ID. Mutually exclusive with campaign_id. When provided, ignores other filters/pagination.
searchstringSearch campaigns by name (case-insensitive partial match)
include_activitiesbooleanInclude recent activity log (last 7 days of changes) for each entity
View full documentation →

feedback

meta_ads_developer_feedback Submit Developer Feedback

IdempotentOpen-world

Submit feedback about missing tools, improvements, bugs, or workflow gaps in the MCP toolset. Not for user-facing issues like auth or API errors.

ParameterTypeDescription
feedback_type requiredstringFeedback category: new_tool (request new capability), improvement (enhance existing tool), bug (report issue), workflow_gap (missing workflow)
title requiredstringConcise title summarizing the feedback
description requiredstringWhat is needed and why
reason requiredstringWhy this tool call is needed
3 optional parameters
ParameterTypeDescription
current_workaroundstringCurrent workaround, if any
prioritystringImpact level: low (nice-to-have), medium (improves workflow), high (blocking issue)
interfacestringInterface the feedback originated from: MCP (default) or CLI
View full documentation →

insights

meta_ads_get_insights Get Meta Ads Insights

Read-onlyIdempotent

Retrieve performance metrics from Meta Ads with date presets/custom ranges, time grouping, entity-level aggregation, dimensional breakdowns, and filtering. Always fetches fresh data. Provide date_preset or time_range. For standard full-funnel analysis, prefer meta_ads_get_performance_report; use this for custom fields, hourly/creative-asset breakdowns, or video metrics.

ParameterTypeDescription
account_id requiredstringMeta ad account ID
reason requiredstringWhy this tool call is needed
9 optional parameters
ParameterTypeDescription
date_presetstringPredefined date range: today, yesterday, last_3d, last_7d, last_14d, last_28d, last_30d, last_90d, this_month, last_month, this_quarter, last_quarter, this_year, last_year, lifetime, maximum
time_rangeobjectCustom date range {since, until} in YYYY-MM-DD
time_incrementunknownTime grouping: 1=daily, 7=weekly, or "monthly"
levelstringAggregation level: account, campaign, adset, ad
fieldsarrayMetrics to retrieve (defaults to standard set)
breakdownsarrayDimensions to segment data by. Pass multiple values in a single call to get cross-tabulated rows (e.g. ["age","gender"] → one row per "35-44 / female" segment). Do NOT make separate calls for each dimension. Available: age, gender, country, region, dma, device_platform, publisher_platform, platform_position, impression_device, frequency_value, place_page_id, product_id, ad_format_asset, body_asset, call_to_action_asset, description_asset, image_asset, link_url_asset, title_asset, video_asset
action_breakdownsarrayAction breakdown dimensions: action_type, action_target_id, action_destination, action_reaction, action_video_sound, action_video_type, action_carousel_card_id, action_carousel_card_name
filteringarrayFilters as [{field, operator, value}]
action_attribution_windowsarrayAttribution windows for action/conversion metrics. Controls which click/view windows are reported. Common: ["7d_click"] for 7-day click only. Default (when omitted): ["7d_click","1d_view"]. Available: 1d_click, 7d_click, 28d_click, 1d_view, 7d_view, 28d_view, 1d_ev, default
View full documentation →

pixel-health

meta_ads_get_pixel_health Get Meta Pixel Health

Read-onlyIdempotent

Comprehensive pixel health check: metadata, CAPI connection status, event volume stats, automatic matching config, and diagnostic checks (including event match quality indicators). Use this to diagnose tracking issues before analyzing ad performance — low ROAS could be a tracking problem, not a campaign problem.

ParameterTypeDescription
account_id requiredstringThe ad account ID (with or without act_ prefix)
reason requiredstringWhy this tool call is needed
5 optional parameters
ParameterTypeDescription
pixel_idstringSpecific pixel ID to check. If omitted, checks all pixels on the account.
event_namesarrayFilter event stats to these event names (e.g. ["Purchase", "Lead"])
days_backintegerNumber of days of event stats to include (default: 28, max: 90)
limitintegerMax pixels per page (default: 5, max: 20)
cursorstringPagination cursor from previous response
View full documentation →

preferences

meta_ads_store_preference Store Meta Ads Preference

Idempotent

Store a persistent preference for a Meta ad entity. Use when you infer a recurring preference about analysis, reporting, or management. Updates existing keys.

ParameterTypeDescription
entity_type requiredstringType of ad entity: ad_account, campaign, ad_set (Meta ad sets / Google ad groups), or ad
entity_id requiredstringThe platform entity ID (e.g. act_123456, 23842453456789)
key requiredstringPreference key (e.g. preferred_conversion_metric, budget_alert_threshold)
reason requiredstringWhy this tool call is needed
3 optional parameters
ParameterTypeDescription
valueunknownPreference value — string, number, boolean, or JSON object
sourcestringWho set this preference: agent (default), user, or system
notestringOptional context about why this preference was set
View full documentation →

meta_ads_get_preferences Get Meta Ads Preferences

Read-onlyIdempotent

Get all stored preferences for a Meta ad entity. Preferences are also auto-attached to list tool responses as _stored_preferences.

ParameterTypeDescription
entity_type requiredstringType of ad entity: ad_account, campaign, ad_set, or ad
entity_id requiredstringThe platform entity ID
reason requiredstringWhy this tool call is needed
View full documentation →

meta_ads_delete_preference Delete Meta Ads Preference

DestructiveIdempotent

Delete a stored preference by key. No-op if it doesn't exist.

ParameterTypeDescription
entity_type requiredstringType of ad entity: ad_account, campaign, ad_set, or ad
entity_id requiredstringThe platform entity ID
key requiredstringThe preference key to delete
reason requiredstringWhy this tool call is needed
View full documentation →