Facebook Ad Library MCP
Reads Meta's public Ad Library — search, inspect, and compare any advertiser's ads — read-only, free, no account needed.
search_ads— keyword search or every ad from one Page, filtered by country, media type (image/meme/video), ad category, active status, and limit (up to 200). Returns advertiser, copy, creative count, destination domain, CTA, platforms and days active.list_advertisers— resolve a brand or company name to the Page IDs actually running ads, ranked by ad count, so you can then search bypage_id.get_ad— pull one ad in full by Ad Library ID: every creative, all copy variants, full destination URL, any transparency data.view_ad_creative— return the ad's actual images (up to 6, carousel cards in order) so the model can see the visual hook and layout, not just read the copy.transcribe_ad— speech-to-text on a video ad's script; requires thescrapecreatorsbackend and says so otherwise.diff_advertiser— compare an advertiser's ads against the last snapshot and report what they started and stopped running (first call records a baseline).get_eu_transparency— spend, impressions, reach and demographics from Meta's official API for EU-delivered and political/issue ads; needs the freeMETA_ADS_ARCHIVE_TOKEN.ad_library_url— turn filters into a public Ad Library URL a person can open to verify results or tell "no results" apart from "blocked".backend_status— report which backend is active, whether it costs money, and which optional features (transcription, EU transparency, tracked advertisers) are available.Caveats baked in: every tool is read-only and cannot touch an ad account; spend/reach are null outside the EU and political ads by design; no conversion or revenue data exists anywhere — only ad longevity as a hypothesis.
Allows searching and retrieving ads running on Facebook, including creatives, landing pages, platforms, and ad copy.
Provides access to ads running on Instagram through Meta's Ad Library, including creative assets and destination URLs.
Provides access to ads delivered on Messenger via Meta's Ad Library.
Integrates with Meta's Ad Library to provide read-only access to advertising creative, advertiser activity, and EU transparency data across Meta's platforms.
Provides access to ads running on Threads via Meta's Ad Library.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Facebook Ad Library MCP What ads is Ridge running right now, and which has been live longest?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Facebook Ad Library MCP Server & CLI
Facebook Ad Library MCP server and CLI for Claude Code, Codex and AI agents. 9 tools that read every ad running on Facebook, Instagram, Messenger, Threads and Audience Network, for any advertiser in any country, free and with no API key.
One install gives you both surfaces, the same 9 tools under the same names, reading one array of tool definitions so they cannot drift apart.
Meta's Ad Library is the largest public archive of advertising creative in the world, and it is completely open. This puts it inside your agent.
You: What is Ridge testing right now?
Claude: They have 34 ads live. The oldest has run 214 days: a single static image, "The last wallet you will buy", straight to a product page. The eleven newest are all video with a founder talking to camera, and every one of them points at a quiz funnel instead. They are moving from product-led to problem-led, and the old ad is still running because it still works.
Built by Navid Moazzez. Built on Slipway, which turns one definition of each tool into the MCP server and the CLI.
Two ways to use it
Command line
facebook-ad-library-cli runs every tool as a command. Agents that run
commands, like Claude Code, Codex and OpenCode, use it on their own, and you can
type the same commands in a terminal, a script or a cron job:
facebook-ad-library-cli # every command, one line each
facebook-ad-library-cli list-advertisers --query ridge # find a brand's Page ID
facebook-ad-library-cli search-ads --page-id 123456789 --country US
facebook-ad-library-cli search-ads --query "wallet" --json --select ads.library_id,ads.days_active
facebook-ad-library-cli ad-library-url --query "wallet" --country GB
facebook-ad-library-cli <command> --help # what any command takesEvery command reads a public archive, so nothing needs --confirm. --json
gives JSON, --compact puts it on one line, --select keeps only the fields
you name, and --agent is compact JSON with no prompts. Exit codes are 0 ok,
1 an unexpected error, 2 usage, 3 not found, 4 a rejected key, 5 upstream, 7 out
of credits and 10 a backend that is not set up, so a script branches on the
number.
facebook-ad-library-cli schema <command> prints the exact JSON Schema an MCP
client receives for that tool.
MCP server, for your AI app
facebook-ad-library-mcp is what Claude Code, Claude Desktop, Cursor and the
rest launch. You never run it by hand:
claude mcp add facebook-ad-library -- npx -y @thenavidm/facebook-ad-library-mcp-cliIn Claude Desktop, the .mcpb extension
installs on a double click. Section 4 has every other client.
Which one
Where you are | What you can reach |
An agent that can run shell commands, like Claude Code or Cursor | Both. The CLI is the cheaper one: it costs nothing until you type it |
claude.ai, the Claude Desktop chat tab, or a phone | The server only. There is no shell to run a command in |
A terminal, a script, cron or CI | The CLI only. There is no MCP client in a shell |
They are the same program reading the same tool definitions, so anything one can do, the other can.
What each costs
Both surfaces are the same program with the same 9 tools. The difference is when the model pays for them. Measured in Claude Code:
Cost | MCP server | CLI |
Every message, with every tool loaded | 3,900 tokens | nothing |
Every message, Claude Code's default | 740 tokens | nothing |
When the Ad Library comes up | nothing more, or the tools it picks | 3,400 tokens for |
20 messages with the Ad Library in 1, every tool loaded | 78,000 tokens | 3,400 tokens |
Claude Code's tool search is on by default: it sends only the tool names and the server instructions, and loads a tool's full definition when the model reaches for it. An app that loads every tool up front pays the first line on every message, whether the Ad Library comes up or not. With the skill added, Claude Code also lists its one-line description, about 170 tokens.
To spend less, turn the server off when you are not using it, which in Claude
Code is the /mcp panel.
Or install the CLI and add the server on the days it earns its place.
Measured on 2026-10-05 with Claude Code 2.1.286 on Claude Opus 5.5: one
short prompt with and without the server connected, once with
ENABLE_TOOL_SEARCH=false and once with the default, the difference read
from the API's own usage figures. SKILL.md was measured the same way. Other
apps and models count tokens a little differently.
Against 0.5.1, measured the same day: every tool loaded costs 3,894 tokens
instead of 4,190, tool search 737 against 735, within what two runs of the
same build vary by, and SKILL.md the same within 4 tokens. In Codex 0.159.3
on gpt-6.1-sol, the same task, "find the command that turns a brand name into
the advertiser's Facebook Page ID, and the flags it requires", read a median of
82,997 input tokens on 0.6.0 against 83,018 on 0.5.1 over the CLI, and 45,167
against 45,180 over MCP, five runs each. Codex prints the tool list with a
script and reads it, 5,839 tokens on both versions.
Related MCP server: Meta Ads MCP Server
Features
Every tool is both a command and an MCP tool, with the same name. The command is the tool name with dashes.
Capability | CLI command | MCP tool |
Search ads by keyword or advertiser |
|
|
Find a brand's Page ID |
|
|
Read one ad in full, or look at its images |
|
|
Transcribe a video ad |
|
|
See what an advertiser started and stopped |
|
|
EU spend, reach and demographics |
|
|
A link a person can open |
|
|
Check your setup |
|
|
All nine are in section 6.
Contents
# | Section | What is in it |
1 | Real prompts, not features | |
2 | One command, no account | |
3 | Optional, and why you probably do not need it | |
4 | Every client, copy and paste | |
5 |
| |
6 | All nine, and what each reaches | |
7 | Why it returns more than a scraper | |
8 | What no source can tell you | |
9 | Including what an MCP server is |
1. What you can ask it 💬
"What ads is Ridge running right now, and which has been live longest?"
"Show me every hook Athletic Greens is testing this month, grouped by angle."
"Compare two competitors: who runs more creative, and who refreshes it faster?"
"Find advertisers running cold plunge ads in the UK, ranked by ad count."
"Pull every ad from this Page and tell me which landing pages they send to."
"What changed for this advertiser since last week?"
"Which of these are video and which are static? Give me the video URLs."
"This ad has run 8 months. Read the copy and tell me why it works."
"What is this German brand spending, and who is paying for it?"
2. Quick install ⚡
Node 22 or newer. Nothing else.
npx -y @thenavidm/facebook-ad-library-mcp-cli --versionThe free backend drives a real browser, so install Chromium once:
npx playwright install chromiumThat is the whole install. No account, no API key, no credential.
For the CLI as a command you or your agent can run anywhere, install it once:
npm install -g @thenavidm/facebook-ad-library-mcp-cli
facebook-ad-library-cli3. Setup 🔑
There is nothing to set up. The default backend needs no key and no account.
Everything below is optional, and only worth doing if you hit a specific limit.
Optional: a provider key, for speed and scale
The free backend runs Chromium on your machine, so a search takes 30 to 60 seconds and Meta will rate limit you if you hammer it. Two hosted providers remove both problems for money.
Backend | Roughly | Adds |
| $1.88 per 1,000 ads | fast, serverless, |
| $3.40 to $5.80 per 1,000 ads | fast, serverless, e-commerce enrichment |
Set FBADS_BACKEND and the matching key in your client config. Every tool behaves identically on all three.
Optional: EU spend and reach
Meta's official Ad Library API publishes real spend, impressions and demographics. It is free, and it covers political and issue ads worldwide plus every ad delivered in the EU.
Go to developers.facebook.com and create an app.
Generate an access token for it.
Set it as
META_ADS_ARCHIVE_TOKEN.
get_eu_transparency then returns data. Everything else works without it.
4. Connect your client 🔌
The long version, every step with what to do when one fails, is in INSTALL.md.
Claude Code
claude mcp add facebook-ads -- npx -y @thenavidm/facebook-ad-library-mcp-cli@latest--scope user makes it available in every project rather than the current one.
With a provider key:
claude mcp add facebook-ads \
-e FBADS_BACKEND=scrapecreators \
-e SCRAPECREATORS_API_KEY=xxx \
-- npx -y @thenavidm/facebook-ad-library-mcp-cli@latestClaude Desktop
The short way: download the .mcpb extension
from the latest release and double-click it. It carries its own dependencies,
and Claude Desktop asks which backend to use. The free browser backend still
needs Chromium installed once with npx playwright install chromium; the
scrapecreators and apify backends need only their key.
The long way, if you would rather edit the config yourself:
Platform | Path |
macOS |
|
Windows |
|
{
"mcpServers": {
"facebook-ads": {
"command": "npx",
"args": ["-y", "@thenavidm/facebook-ad-library-mcp-cli@latest"]
}
}
}Tip Claude Desktop does not inherit your shell PATH. If
npxis not found, use the absolute path fromwhich npx.
Quit Claude Desktop completely and reopen it.
claude.ai on the web
claude.ai runs connectors from Anthropic's cloud, not from your machine, so it needs a public HTTPS URL.
npx -y @thenavidm/facebook-ad-library-mcp-cli@latest --http --port 8000Host that somewhere with a public HTTPS URL, then in claude.ai: Customize, Connectors, +, Add custom connector. Paste the URL and click Add. A page from another site is refused unless FBADS_HTTP_ALLOWED_ORIGINS lists it.
Note the free backend needs a real browser, so whatever hosts it must be able to run Chromium. A provider backend is the easier choice for a hosted deployment.
Cursor
.cursor/mcp.json, same JSON shape as Claude Desktop, key mcpServers.
Windsurf
~/.codeium/windsurf/mcp_config.json, key mcpServers.
VS Code
.vscode/mcp.json. The key is servers, not mcpServers, and each entry takes "type": "stdio".
{
"servers": {
"facebook-ads": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@thenavidm/facebook-ad-library-mcp-cli@latest"]
}
}
}Codex CLI
~/.codex/config.toml:
[mcp_servers.facebook-ads]
command = "npx"
args = ["-y", "@thenavidm/facebook-ad-library-mcp-cli@latest"]Gemini CLI
~/.gemini/settings.json, key mcpServers.
Everything else
Any stdio MCP client takes the same three things: the command npx, the args, and an optional env block.
Or let the CLI write the entry, in each client's own format:
npx -y -p @thenavidm/facebook-ad-library-mcp-cli facebook-ad-library-cli install claude-codeIt takes claude-code, codex, claude-desktop, cursor, vscode or gemini, and --dry-run shows the change first.
5. Check it worked 🩺
npx -y @thenavidm/facebook-ad-library-mcp-cli@latest doctorIt launches a browser, runs a real search, and tells you whether ads came back.
Symptom | Fix |
"Chromium will not launch" |
|
"Meta served a captcha" | Wait a few minutes, or set a provider key |
Empty results on every search | Meta is rate limiting this machine |
Server missing from the client |
|
6. Tools 🛠️
Every tool is read-only. This server cannot post, cannot spend, and cannot reach an ad account.
Tool | What it does |
| Keyword search, or every ad from one Page. The main one. |
| Resolve a brand name to Page IDs, ranked by ad count. |
| One ad in full: every creative, every copy variant. |
| What an advertiser started and stopped running since last look. |
| Spend, reach and demographics. EU and political ads only. |
| Speech to text on a video ad. Needs the |
| Which backend is active and whether it costs money. |
| The ad's actual images, so the model can see them rather than only read the copy. |
| Turn filters into a URL a person can open and check. |
Plus two prompts, competitor-teardown and creative-angles, and two resources so a client can read the config and the Ad Library's own concepts without spending a tool call.
diff_advertiser is the one worth knowing about. Every other tool answers "what is running". That one answers "what changed", which needs a memory of last time. The first call records a baseline.
7. How it works ⚙️
Worth knowing, because it explains what you get back.
The Ad Library is a React app. Meta hands it every ad as structured JSON. The obvious way to scrape it is to let the page render, flatten it to text, and pull the fields back out with regular expressions.
That round trip loses most of the ad. You get one creative instead of the six in the carousel, a redirect instead of the real landing page, and an empty platform list because those render as icons rather than text.
This server reads the JSON the page was already given. Same browser, same cost, no parsing step.
It reads two places, because Meta uses two: the first page of results is embedded in the document, and later pages arrive over the wire as you scroll. Reading only the second is why scrapers return nothing on the first search.
What that buys you, per ad:
Creatives | all of them, with HD and SD video URLs |
Platforms |
|
Destination | the real URL, query string intact |
Call to action |
|
Pagination | a real cursor, plus Meta's own total result count |
Also | page likes, ad format, variant count, EU spend and reach |
8. Limits, honestly 🧭
No performance data exists. Conversions, revenue, cost per acquisition, return on ad spend: none of it is public for another advertiser, from any source, at any price.
What you can infer is longevity. An ad running six months is probably working, because advertisers turn off ads that lose money. That is a hypothesis worth acting on, and it is not a measurement. The server's own instructions tell the model not to report it as one.
Spend and reach are usually null. They exist only for ads delivered in the EU, under the Digital Services Act, and for political ads anywhere. A null on a US ecommerce ad is the correct answer, not a bug.
The free backend gets rate limited. It drives a real browser against a public site. If searches start coming back empty, wait. That is also the point where a provider key starts paying for itself.
Creative URLs expire. Meta's CDN links are short-lived. Download what you want to keep, when you find it.
9. FAQ
An MCP server is a standard way to give an AI assistant real tools. Once this is connected, your assistant can search the Ad Library itself instead of you copying results into a chat.
facebook-ad-library-cli is the same program as the MCP server, run as commands. AI agents that run commands, like Claude Code, Codex and OpenCode, use it on their own, and you can type the same commands in a terminal, a script or a cron job. Every tool is a command with dashes, so search_ads runs as facebook-ad-library-cli search-ads.
Use the MCP server in an app with no terminal, like Claude Desktop's chat. Use the CLI anywhere commands run: an agent like Claude Code, Codex or OpenCode, a script or a cron job. The MCP server's tools take up context on every message, and the CLI costs nothing until it runs.
You do not need one. The Ad Library is public and this reads it without signing in to anything.
It is free by default. The free backend runs on your machine. The two provider backends bill per ad and are opt-in.
The free backend launches a real browser and scrolls a page, which takes 30 to 60 seconds. A provider backend answers in about a second, for money.
Only for EU-delivered ads and political ads, through get_eu_transparency. For a US commercial advertiser that number is not published anywhere.
No, and nothing can. You can see which have run longest, which is a reasonable proxy and not the same thing.
It is a catalog ad. Meta fills those tokens per product at delivery. That is the real ad text.
Yes, with --http. The free backend needs Chromium available, and a provider backend is easier to host.
The Ad Library is published deliberately, for transparency, and is open without login. This reads it the way a browser does. You are responsible for your own use.
All of them. Pass any two-letter country code.
It cannot. Every tool reads Meta's public Ad Library, the same pages anyone can open in a browser. Nothing here signs in to an ad account, posts, pays or deletes, so there is no approval step and no read-only switch to set.
The one thing it keeps is diff_advertiser's snapshots of what an advertiser
was running, on your own machine, so it can tell you what changed.
With @latest in your client's config, npx fetches the newest version when
the client starts the server, so there is nothing to update by hand. A global
install updates with npm i -g @thenavidm/facebook-ad-library-mcp-cli.
To remove it, delete its entry from your client's config and restart the
client, or run npm uninstall -g @thenavidm/facebook-ad-library-mcp-cli for a
global install. The snapshots diff_advertiser keeps live in FBADS_STORE_DIR,
or your app data folder, and can be deleted with it.
Environment variables
Credentials, all optional. The default browser backend needs none of them.
Variable | Default | What it does |
|
|
|
| none | For the scrapecreators backend |
| none | For the apify backend |
|
|
|
| none | Unlocks EU spend, reach and demographics. Free from Meta |
Tuning.
Variable | Default | What it does |
| off |
|
|
| How long to let the Ad Library page load |
|
| Pause between scrolls while collecting ads |
|
| Retries when the browser comes back empty |
|
| How old a ScrapeCreators cached answer may be. |
| your app data folder | Where |
HTTP, for --http only.
Variable | Default | What it does |
|
| Port |
|
| Interface to bind |
| none | Bearer token for the endpoint |
| none | Comma-separated browser origins allowed to connect; a page from any other site is refused |
Slipway's own.
Variable | Default | What it does |
|
|
|
| none | Give up on any tool after this long |
|
|
|
Dependencies
Package | License | Why |
Apache-2.0 | the MCP server and the CLI from one definition of each tool | |
Apache-2.0 | the MCP protocol and transports, through Slipway | |
MIT | tool argument schemas | |
Apache-2.0 | drives Chromium for the free backend, optional |
Questions
Run into a problem or have a question? Open an issue and I will help.
Built by
Navid Moazzez
Navid Moazzez is a leading AI business strategist, and the host of the AI Creator Summit, watched by 100,000+ creators. He helps creators and founders master AI and build their own AI Operating System (AI OS) to automate their business and life. He creates useful free tools, MCP servers and CLIs that creators and founders can use in their own workflows.
License
MIT. Free to use, modify, and share.
Not affiliated with, endorsed by, or connected to Meta Platforms, Inc.
© 2026 Navid Media. Made with ❤️ by Navid Moazzez.
Available Tools
9 toolsad_library_urlBuild an Ad Library URLARead-onlyIdempotent
Turn a set of filters into the public Ad Library URL, so a person can open the same search in a browser and check the results independently. Useful when a search comes back empty and you need to tell 'no results' apart from 'blocked'.
Inputs: query, country, page_id, media_type, +1 more. Returns: url
backend_statusBackend statusARead-onlyIdempotent
Which backend is serving requests, whether it costs money per call, and which optional features are available in this configuration. Call this when a tool reports something unavailable, before telling the user it cannot be done.
Inputs: no named parameters. Returns: note, backend, needs_api_key, tracked_advertisers, +3 more
diff_advertiserWhat changed for an advertiserARead-onlyIdempotent
Compare an advertiser's ads now against the last time this server looked, and report what they started and stopped running. The first call on a Page records a baseline and reports nothing changed, which is expected: call it again later to see movement. This is the only tool here that answers 'what changed' rather than 'what is running'.
Inputs: page_id (required), limit, country. Returns: note, page_id, running_now, tracked_now, +4 more
get_adGet one ad in fullARead-onlyIdempotent
Fetch a single ad by its Ad Library ID, with every creative, all copy variants, the full destination URL and any transparency data. Use this after search_ads when one ad is worth studying properly.
Inputs: library_id (required), country. Returns: ad, note, found, library_id
get_eu_transparencyEU spend and reachARead-onlyIdempotent
Spend, impressions, reach and demographic breakdown from Meta's official Ad Library API. Covers ads delivered in the EU and political or issue ads anywhere. Returns nothing for an ordinary US commercial ad because that data is not published, which is the correct answer rather than an error. Needs META_ADS_ARCHIVE_TOKEN, which is free.
Inputs: limit, query, country, page_ids. Returns: ads, next, note, count, +2 more
list_advertisersFind advertisersARead-onlyIdempotent
Resolve a brand name to the advertiser Pages actually running ads for it, ranked by how many ads each is running. Use this first when you know the brand but not its Page ID, then pass that ID to search_ads to get everything they run.
Inputs: query (required), country. Returns: note, count, advertisers
search_adsSearch the Ad LibraryARead-onlyIdempotent
Search Meta's public Ad Library by keyword, or list every ad from one advertiser by passing page_id. Returns advertiser, copy, creative count, destination domain, call to action, platforms and how long each ad has run. Works for ordinary commercial advertisers in any country. Spend and reach are null outside the EU, which is correct rather than a failure: that data is only published for EU and political ads.
Inputs: limit, query, ad_type, country, +3 more. Returns: ads, url, note, count, +4 more
transcribe_adTranscribe a video adARead-onlyIdempotent
Speech to text for a video ad, so its spoken script becomes readable. Only the scrapecreators backend can do this. On any other backend it explains that rather than failing silently.
Inputs: library_id (required). Returns: note, backend, available, library_id, +1 more
view_ad_creativeLook at an ad's imagesARead-onlyIdempotent
Return the actual images from one ad so you can see them, rather than only reading its copy. Use this when the question is about what an ad looks like: the visual hook, the layout, the product shot, how the text sits on the image, or what several ads have in common visually. A carousel returns each card in order. Video ads have no still to show and report that instead. Needs no API key.
Inputs: library_id (required), limit, country.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Most tools have clearly distinct roles: list_advertisers resolves a brand to a Page, search_ads finds ads, get_ad fetches one ad, and diff_advertiser tracks change over time. The cluster around examining a single ad's creative (get_ad, view_ad_creative, transcribe_ad) has mild overlap, but each is scoped to a different output (metadata, images, speech), so descriptions keep them separable.
The dominant pattern is verb_noun (search_ads, list_advertisers, get_ad, transcribe_ad, view_ad_creative, diff_advertiser, get_eu_transparency). Two tools break it with noun phrases (ad_library_url, backend_status), but they remain readable and the overall convention is predictable.
Nine tools is well-scoped for a read-only Ad Library exploration domain. Each tool covers a distinct capability (search, resolve, fetch, transcribe, visualize, diff, EU data, diagnostics) with no filler.
The surface covers the core lifecycle of a public ad-research workflow: finding advertisers, searching, inspecting single ads, viewing creatives, transcribing, diffing over time, and EU transparency data, plus a diagnostics tool. Minor gaps exist (no explicit pagination/export or bulk creative handling), but nothing blocks typical agent workflows.
Maintenance
Related MCP Connectors
Real-time Meta, Google, LinkedIn and TikTok ad library access for AI assistants. No API keys.
The simplest way to manage your Meta (Facebook and Instagram) ad accounts with your AI agent.
Read-only Meta Ads analytics for AI, built for agencies: every client account plus ROAZ insights.
Track competitors' Meta ads, save swipe files and run Meta campaigns from Claude, ChatGPT or Cursor.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables management and analysis of Meta (Facebook/Instagram) ads through natural language conversations, with 30 tools for reading and writing ad data.MIT
- FlicenseNot gradedqualityDmaintenanceProvides read-only access to Meta Ads API, enabling campaign management, creative analysis, targeting research, and performance analytics via 39 tools.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to browse and query Facebook Ads data including ad accounts, campaigns, ad sets, and performance insights via natural language.184 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI clients to read Meta Ads performance with breakdowns and diagnostics and to create, update, or pause campaigns, ad sets, ads, creatives, audiences, and catalogs, with every write requiring explicit user approval. Runs as a hosted, OAuth-authenticated remote server with no local install.1MIT