Skip to main content
Glama
meta-ad-library-mcp

meta-ad-library-mcp

Meta Ad Library Intelligence MCP Server πŸ•΅οΈβ€β™‚οΈπŸ“ˆ

Smithery Badge License: MIT Node: >=18

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 claude

Option 2: Claude Desktop (Manual Config)

Add this block to your claude_desktop_config.json:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %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. 30 to 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.

    1. Go to Meta for Developers.

    2. Generate a User Access Token with ads_read permission.

    3. Paste it into your MCP config env.


πŸ“„ License

MIT Β© Abdul-Basit-Zahid

Available Tools

3 tools
analyze_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

    A3.8/5.0

    Scored across 3 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      See 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.
      47
      17 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables 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
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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.
      1
      MIT