meta-ad-library-mcp
Searches active Facebook ads through Meta Ad Library, with filters for country, active runtime, and media type, and supports competitor ad analysis and winning-ad detection.
Searches active Instagram ads through Meta Ad Library, with filters for country, active runtime, and media type, and supports competitor ad analysis and winning-ad detection.
Connects to Meta Ad Library and Graph API to search live ads, analyze competitor creative formats and CTAs, detect long-running winning ads, and generate pre-filtered Ad Library URLs.
Meta Ad Library Intelligence MCP Server π΅οΈββοΈπ
A Model Context Protocol (MCP) server that connects Claude Desktop, Cursor IDE, and autonomous AI agents directly to the Meta Ad Library (Facebook & Instagram).
Empower your AI models to inspect live competitor ad creatives, identify winning ads running 30+ days, analyze video vs. image splits, extract marketing hooks, and conduct automated marketing research without ever leaving your chat or editor.
β‘ Features
π Live Meta Ad Search: Search active Facebook and Instagram ads by brand, competitor name, or product keyword.
π Winning Ads Detector: Filter by
minDaysActive(e.g. 30, 60, 90+ days) to isolate proven, profitable ads that competitors keep spending budget on.π Competitor Intelligence Report: Instant breakdown of creative format split (Video, Image, Carousel), longest-running ad copy, and top CTA buttons.
π Deep Snapshot Links: Direct URLs to Meta Ad Library records for human verification and high-res video preview.
π€ Universal Compatibility: Works seamlessly with Claude Desktop, Cursor IDE, Windsurf, and any MCP client.
Related MCP server: Facebook Ads Library MCP Server
π¦ Installation & Setup
Option 1: One-Click Install via Smithery CLI
Run this in your terminal to automatically configure Claude Desktop:
npx -y @smithery/cli install meta-ad-library-mcp --client claudeOption 2: Claude Desktop (Manual Config)
Add this block to your claude_desktop_config.json:
MacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"meta-ad-library": {
"command": "npx",
"args": ["-y", "meta-ad-library-mcp"],
"env": {
"META_ACCESS_TOKEN": "YOUR_OPTIONAL_META_TOKEN",
"MCP_PRO_KEY": "YOUR_OPTIONAL_PRO_KEY"
}
}
}
}Option 3: Cursor IDE
Add to your project's .cursor/mcp.json:
{
"mcpServers": {
"meta-ad-library": {
"command": "npx",
"args": ["-y", "meta-ad-library-mcp"]
}
}
}π οΈ Available MCP Tools
1. search_meta_ads
Search active ads by keyword or brand name with multi-criteria filtering.
Arguments:
keyword(string, required): Brand or search term (e.g."Gymshark","Athletic Greens","running shoes").countryCode(string): Target country (e.g."US","GB","CA","AU", or"ALL"). Default:"US".minDaysActive(number): Minimum active runtime in days (e.g.30to only find proven winning ads). Default:0.mediaType(string): Filter by"ALL","IMAGE", or"VIDEO". Default:"ALL".maxAds(number): Number of results (up to 50). Default:20.
2. analyze_competitor_ads
Generates a structured marketing intelligence audit for a brand.
Arguments:
brandName(string, required): Exact brand name to analyze (e.g."Nike","Hims","Shopify").countryCode(string): Country code. Default:"US".sampleSize(number): Sample size (up to 50). Default:25.
3. get_ad_library_url
Generates pre-filtered Meta Ad Library URLs for instant browser preview.
π‘ Example Prompts to Ask Claude / Cursor
"Analyze Nike's active ads in the US. What percentage are videos vs images, and what are their longest-running creatives?"
"Find winning ads for 'collagen powder' running for more than 45 days in the US. Extract their main copywriting hooks."
"Compare the CTA buttons and headline strategies of Gymshark vs Lululemon based on their active Facebook ads."
π Authentication & Tokens
Free Tier: Works out of the box with sample intelligence queries and direct Ad Library routing.
Live Graph API Mode: To query Meta's high-speed Graph API archives directly, supply a free Meta Graph Developer token in
META_ACCESS_TOKEN.Go to Meta for Developers.
Generate a User Access Token with
ads_readpermission.Paste it into your MCP config
env.
π License
MIT Β© Abdul-Basit-Zahid
Available Tools
3 toolsanalyze_competitor_adsA
Deep marketing intelligence analysis on a competitor. Analyzes their longest-running ads, video vs. image split, top headlines, recurring hooks, and calls to action.
Inputs: brandName (required), sampleSize, countryCode.
get_ad_library_urlA
Generate a direct, pre-filtered Meta Ad Library URL for manual human verification and creative preview.
Inputs: keyword (required), countryCode.
search_meta_adsA
Search live active ads from the Meta Ad Library (Facebook & Instagram). Allows filtering by country, media type (VIDEO, IMAGE), and minimum days active to identify winning competitor ads.
Inputs: keyword (required), maxAds, mediaType, accessToken, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 3 tools
search_meta_ads (raw retrieval with filters) and analyze_competitor_ads (aggregated intelligence) could be confused by an agent wanting competitor ads, but the descriptions clearly delineate raw search vs. analysis. get_ad_library_url is distinct as a URL generator for manual verification.
All three tools follow a consistent verb_noun snake_case pattern (search_meta_ads, analyze_competitor_ads, get_ad_library_url). The noun segments vary naturally by resource but the convention is predictable.
Three tools is a tightly scoped surface for a narrow ad-library purpose, with each tool earning its place (search, analyze, URL generation). Slightly thin, but reasonable for the focused domain.
Core workflowsβfinding ads, analyzing a competitor's ad strategy, and generating a manual-verification URLβare covered. Minor gaps exist, such as fetching details for a single specific ad or paginating raw search results, but the URL tool provides a workaround.
Maintenance
Related MCP Connectors
Track competitors' Meta ads, save swipe files and run Meta campaigns from Claude, ChatGPT or Cursor.
Real-time Meta, Google, LinkedIn and TikTok ad library access for AI assistants. No API keys.
Analyze, edit and launch Meta (Facebook and Instagram) ads from Claude, ChatGPT, Cursor or Codex. Query insights and campaign health, change budgets, bids, status and targeting with undo, bulk-launch many ads across campaigns and ad sets from a live ad's settings, and duplicate by post to keep social proof. Choose per ad account what the agent may do and what waits in the Agent Inbox for approval. Requires a paid Ads Uploader account with MCP access.
Ad library and ad spy for AI agents: winning Facebook and Instagram ads, competitor ads and hooks.
Related MCP Servers
AlicenseBqualityCmaintenanceSee who is running ads in your space, clone a winning ad for your brand as an image or video, and launch it on Meta, Google, TikTok, X, or ChatGPT Ads. The full research, clone, launch loop from one chat in Claude, ChatGPT, or Cursor. Flat pricing, no fabricated metrics.4717 npmMIT- AlicenseAqualityBmaintenanceEnables searching and analyzing Facebook's public ads library for any brand, including ad images, text, and video analysis.916 npm332MIT
- AlicenseNot gradedqualityCmaintenanceEnables searching and scraping the public Facebook Ad Library to extract structured ad data such as advertiser, copy, landing URLs, and CTAs for competitive research, all without an account or API token.MIT
- AlicenseNot gradedqualityBmaintenanceEnables searching Meta ads by text, country, category, advertiser, or landing domain from an AI assistant, then opening individual ads and advertiser pages, ranking what is scaling, finding related ads by page or domain, and downloading images and videos for ad ids.1MIT