Skip to main content
Glama
Meta Ad Library

Meta Ad Library

by pipeworx-io

@pipeworx/meta-ad-library

Ads in Meta's public Ad Library, searchable by keyword and Facebook Page ID (Meta, Ad Library).

Part of Pipeworx — an MCP gateway connecting AI agents to 2100+ live data sources. This is an independent, unofficial integration — not affiliated with, endorsed by, or published by the upstream provider.

Tools

  • meta_ad_library_search -- ad archive ID, Page ID and name, publisher platforms, active flag, start and end dates, ad text, link titles, captions and descriptions, snapshot URL, and a paging cursor. Political and issue ads also return funder, spend and impressions ranges; EU and UK ads return reach and targeting.

Related MCP server: Facebook Ads Library MCP Server

Auth

BYO only: pass your own Meta access token as _apiKey. Meta gates the Ad Library API behind an identity confirmation for the token holder; without it Meta refuses the token and the tool reports that as a problem with your credential. Without any key the tool answers that it requires an API key.

This is a different tool from facebook_ads (the Marketing API pack for your own ad accounts).

What the Ad Library API covers

Ads about social issues, elections or politics are returned for every country Meta covers. Ads of other kinds are returned only when they were delivered to the EU or the UK. Everywhere else an empty result does not mean the advertiser ran no ads; the tool says so in its note.

Not returned by this API: collation ID and count, call-to-action text and type, link URL, images, videos, cards. not_available in every response lists them.

Data sources

  • Meta, Ad Library. Every response carries the source name.

Quick Start

Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):

{
  "mcpServers": {
    "meta-ad-library": {
      "url": "https://gateway.pipeworx.io/meta-ad-library/mcp"
    }
  }
}

What this endpoint actually serves

tools/list at https://gateway.pipeworx.io/meta-ad-library/mcp returns the tools in the table above plus five Pipeworx tools: ask_pipeworx, discover_tools, ask_pipeworx_grounded, company_register_search and company_facts. ask_pipeworx answers a question this pack does not cover by routing across the whole catalog, without adding a second MCP server.

Add an option to the same URL:

  • https://gateway.pipeworx.io/meta-ad-library/mcp?meta=1 lists this pack's tools plus up to 48 shared Pipeworx tools (48 when this README was generated; a connection without an account lists fewer, and its own tools/list is the exact answer on any given day).

  • https://gateway.pipeworx.io/meta-ad-library/mcp?meta=0 lists this pack's tools alone.

Or connect to the full Pipeworx gateway to get every pack's tools listed directly, instead of just this one's:

{
  "mcpServers": {
    "pipeworx": {
      "url": "https://gateway.pipeworx.io/mcp"
    }
  }
}

Both URLs reach the same gateway and the same 2100+ data sources. The only difference is which pack's tools are listed directly; ask_pipeworx reaches all of them from either one (it is not listed on a ?meta=0 connection).

No MCP client? Call it over HTTP

This pack takes your own API key (_apiKey) — we don't front one for it, so there's no curl here that would run without it. Inspect any tool: GET https://gateway.pipeworx.io/v1/tools/meta_ad_library_search. Find one: POST https://gateway.pipeworx.io/v1/tools/search_packs with {"query":"..."}.

Run it from npm

@pipeworx/mcp-meta-ad-library is a local stdio bridge to the Pipeworx gateway: your MCP client starts it with npx, and it forwards every call to the same https://gateway.pipeworx.io/meta-ad-library/mcp endpoint shown above. It needs network access; there is no offline mode.

{
  "mcpServers": {
    "meta-ad-library": {
      "command": "npx",
      "args": ["-y", "@pipeworx/mcp-meta-ad-library"]
    }
  }
}

Without a key it calls anonymously, capped at 50 calls a day. A free account raises that to 200 a day: get a key at https://pipeworx.io/signup and add "env": { "PIPEWORX_API_KEY": "<your key>" } to the server entry. The key is sent as a Bearer token, the same way a hosted connection sends it, so calls are metered and billed exactly as they are there.

It lists only this pack's tools by default. Set PIPEWORX_META_TOOLS=1 to also list ask_pipeworx and the other gateway-wide tools.

Behind an HTTPS proxy: Node's built-in fetch does not read HTTPS_PROXY by default. Newer Node releases honour it when NODE_USE_ENV_PROXY=1 is set; check your Node version's documentation.

Using with ask_pipeworx

Instead of calling tools directly, you can ask questions in plain English — this works on the pack endpoint above as well as on the full gateway:

ask_pipeworx({ question: "your question about Meta Ad Library data" })

The gateway picks the right tool and fills the arguments automatically.

More

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Searches the Meta (Facebook) Ad Library by keyword and returns ad details including advertiser, ad copy, and EU reach, without requiring an API key.
      2
      3
      1
      -
    • A
      license
      Not graded
      quality
      D
      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