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
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.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | Meta ad account ID |
reason required | string | Why this tool call is needed |
2 optional parameters
| Parameter | Type | Description |
|---|---|---|
date_preset | string | Predefined date range (e.g., last_7d, last_30d, this_month) |
time_range | object | Custom date range {since, until} in YYYY-MM-DD |
activities
meta_ads_get_activities Get Meta Ads Activities
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.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | The ad account ID (with or without act_ prefix) |
reason required | string | Why this tool call is needed |
7 optional parameters
| Parameter | Type | Description |
|---|---|---|
entity_id | string | Filter activities to a specific entity (campaign, ad set, or ad ID). If omitted, returns account-level activities. |
entity_type | string | Type of entity: ACCOUNT, CAMPAIGN, AD_SET, AD. Used with entity_id for filtering. |
start_date | string | Start date for activity range (ISO 8601, e.g. 2024-01-01) |
end_date | string | End date for activity range (ISO 8601, e.g. 2024-01-31) |
limit | integer | Number of activities per page (default: 20, max: 100) |
cursor | string | Pagination cursor from previous response |
refresh | boolean | Force 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. |
ad-accounts
meta_ads_list_ad_accounts List Meta Ad Accounts
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.
| Parameter | Type | Description |
|---|---|---|
reason required | string | Why this tool call is needed |
8 optional parameters
| Parameter | Type | Description |
|---|---|---|
refresh | boolean | Force fresh data from Meta API instead of using cache. Defaults to false (cache-first). Only set to true when you need real-time data. |
cursor | string | Pagination cursor from previous response |
search | string | Search ad accounts by name (case-insensitive partial match) |
account_id | string | Filter by exact account ID (without act_ prefix) |
account_ids | array | Get multiple accounts by ID. Mutually exclusive with account_id. When provided, ignores other filters/pagination. |
status | integer | Account status code (1=Active, 2=Disabled, etc.) |
limit | integer | Number of accounts per page (default: 20, max: 100) |
include_activities | boolean | Include recent activity log (last 7 days of changes) for each entity |
reporting
meta_ads_get_ad_creative_report Get Meta Ads Creative Performance Report
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.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | Meta ad account ID |
time_range required | object | Required date range {since, until} in YYYY-MM-DD |
reason required | string | Why this tool call is needed |
4 optional parameters
| Parameter | Type | Description |
|---|---|---|
level | string | Grouping 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_increment | unknown | Time grouping: 1=daily, 7=weekly, or "monthly" |
breakdowns | array | Segment 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 |
filtering | array | Filters as [{field, operator, value}] |
meta_ads_get_performance_report Get Meta Ads Performance Report
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.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | Meta ad account ID |
time_range required | object | Required date range {since, until} in YYYY-MM-DD |
reason required | string | Why this tool call is needed |
5 optional parameters
| Parameter | Type | Description |
|---|---|---|
time_increment | unknown | Time grouping: 1=daily, 7=weekly, or "monthly" |
level | string | Aggregation level (default: account): account, campaign, adset, ad |
breakdowns | array | Dimensions 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 |
filtering | array | Filters as [{field, operator, value}] |
action_attribution_windows | array | Attribution 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 |
ads
meta_ads_list_ads List Meta Ads
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.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | The ad account ID (with or without act_ prefix) |
reason required | string | Why this tool call is needed |
10 optional parameters
| Parameter | Type | Description |
|---|---|---|
ad_id | string | Get a specific ad by ID. When provided, returns only that ad and ignores other filters/pagination. |
ad_ids | array | Get multiple ads by ID. Mutually exclusive with ad_id. When provided, ignores other filters/pagination. |
adset_id | string | Filter by ad set ID |
search | string | Search ads by name (case-insensitive partial match) |
status | array | Filter by ad status: ACTIVE, PAUSED, DELETED, ARCHIVED |
limit | integer | Number of ads per page (default: 20, max: 100) |
cursor | string | Pagination cursor from previous response |
refresh | boolean | Force 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_activities | boolean | Include recent activity log (last 7 days of changes) for each entity |
include_assets | boolean | Include resolved creative asset URLs (asset_url, thumbnail_url, asset_type) for each ad. Uses cached GCS URLs when available. |
adsets
meta_ads_list_adsets List Meta Ad Sets
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.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | The ad account ID (with or without act_ prefix) |
reason required | string | Why this tool call is needed |
9 optional parameters
| Parameter | Type | Description |
|---|---|---|
adset_id | string | Get a specific ad set by ID. When provided, returns only that ad set and ignores other filters/pagination. |
adset_ids | array | Get multiple ad sets by ID. Mutually exclusive with adset_id. When provided, ignores other filters/pagination. |
campaign_id | string | Filter by campaign ID |
search | string | Search ad sets by name (case-insensitive partial match) |
status | array | Filter by ad set status: ACTIVE, PAUSED, DELETED, ARCHIVED |
limit | integer | Number of ad sets per page (default: 20, max: 100) |
cursor | string | Pagination cursor from previous response |
refresh | boolean | Force 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_activities | boolean | Include recent activity log (last 7 days of changes) for each entity |
auth
meta_ads_check_auth_status Check Meta Ads Authentication Status
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.
| Parameter | Type | Description |
|---|---|---|
reason required | string | Why this tool call is needed |
meta_ads_ping Ping Meta Ads MCP Server
Health check for the Meta Ads MCP server.
| Parameter | Type | Description |
|---|---|---|
reason required | string | Why this tool call is needed |
1 optional parameter
| Parameter | Type | Description |
|---|---|---|
message | string | Optional message to echo back |
campaigns
meta_ads_list_campaigns List Meta Ad Campaigns
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.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | The ad account ID (with or without act_ prefix) |
reason required | string | Why this tool call is needed |
8 optional parameters
| Parameter | Type | Description |
|---|---|---|
status | array | Filter by campaign status: ACTIVE, PAUSED, DELETED, ARCHIVED |
limit | integer | Number of campaigns per page (default: 20, max: 100) |
cursor | string | Pagination cursor from previous response |
refresh | boolean | Force 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_id | string | Get a specific campaign by ID. When provided, returns only that campaign and ignores other filters/pagination. |
campaign_ids | array | Get multiple campaigns by ID. Mutually exclusive with campaign_id. When provided, ignores other filters/pagination. |
search | string | Search campaigns by name (case-insensitive partial match) |
include_activities | boolean | Include recent activity log (last 7 days of changes) for each entity |
feedback
meta_ads_developer_feedback Submit Developer Feedback
Submit feedback about missing tools, improvements, bugs, or workflow gaps in the MCP toolset. Not for user-facing issues like auth or API errors.
| Parameter | Type | Description |
|---|---|---|
feedback_type required | string | Feedback category: new_tool (request new capability), improvement (enhance existing tool), bug (report issue), workflow_gap (missing workflow) |
title required | string | Concise title summarizing the feedback |
description required | string | What is needed and why |
reason required | string | Why this tool call is needed |
3 optional parameters
| Parameter | Type | Description |
|---|---|---|
current_workaround | string | Current workaround, if any |
priority | string | Impact level: low (nice-to-have), medium (improves workflow), high (blocking issue) |
interface | string | Interface the feedback originated from: MCP (default) or CLI |
insights
meta_ads_get_insights Get Meta Ads Insights
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.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | Meta ad account ID |
reason required | string | Why this tool call is needed |
9 optional parameters
| Parameter | Type | Description |
|---|---|---|
date_preset | string | Predefined 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_range | object | Custom date range {since, until} in YYYY-MM-DD |
time_increment | unknown | Time grouping: 1=daily, 7=weekly, or "monthly" |
level | string | Aggregation level: account, campaign, adset, ad |
fields | array | Metrics to retrieve (defaults to standard set) |
breakdowns | array | Dimensions 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_breakdowns | array | Action 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 |
filtering | array | Filters as [{field, operator, value}] |
action_attribution_windows | array | Attribution 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 |
pixel-health
meta_ads_get_pixel_health Get Meta Pixel Health
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.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | The ad account ID (with or without act_ prefix) |
reason required | string | Why this tool call is needed |
5 optional parameters
| Parameter | Type | Description |
|---|---|---|
pixel_id | string | Specific pixel ID to check. If omitted, checks all pixels on the account. |
event_names | array | Filter event stats to these event names (e.g. ["Purchase", "Lead"]) |
days_back | integer | Number of days of event stats to include (default: 28, max: 90) |
limit | integer | Max pixels per page (default: 5, max: 20) |
cursor | string | Pagination cursor from previous response |
preferences
meta_ads_store_preference Store Meta Ads Preference
Store a persistent preference for a Meta ad entity. Use when you infer a recurring preference about analysis, reporting, or management. Updates existing keys.
| Parameter | Type | Description |
|---|---|---|
entity_type required | string | Type of ad entity: ad_account, campaign, ad_set (Meta ad sets / Google ad groups), or ad |
entity_id required | string | The platform entity ID (e.g. act_123456, 23842453456789) |
key required | string | Preference key (e.g. preferred_conversion_metric, budget_alert_threshold) |
reason required | string | Why this tool call is needed |
3 optional parameters
| Parameter | Type | Description |
|---|---|---|
value | unknown | Preference value — string, number, boolean, or JSON object |
source | string | Who set this preference: agent (default), user, or system |
note | string | Optional context about why this preference was set |
meta_ads_get_preferences Get Meta Ads Preferences
Get all stored preferences for a Meta ad entity. Preferences are also auto-attached to list tool responses as _stored_preferences.
| Parameter | Type | Description |
|---|---|---|
entity_type required | string | Type of ad entity: ad_account, campaign, ad_set, or ad |
entity_id required | string | The platform entity ID |
reason required | string | Why this tool call is needed |
meta_ads_delete_preference Delete Meta Ads Preference
Delete a stored preference by key. No-op if it doesn't exist.
| Parameter | Type | Description |
|---|---|---|
entity_type required | string | Type of ad entity: ad_account, campaign, ad_set, or ad |
entity_id required | string | The platform entity ID |
key required | string | The preference key to delete |
reason required | string | Why this tool call is needed |