Meta Ad Library MCP
Click on "Install 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., "@Meta Ad Library MCPsearch for ads about sustainable fashion in France with reach data"
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.
Meta Ad Library MCP
An MCP server that searches the Meta (Facebook) Ad Library by keyword and returns each ad's advertiser, full ad copy, and EU reach (per‑country / age / gender breakdown) — the data the official Ad Library API does not expose for commercial ads.
It works by driving the public Ad Library like a real user (Playwright + your real Chrome) and reading the page's own data — no API key, no login required.
search_ads("dental implants", country="DE", limit=50, fetch_reach=True)
→ 50 advertisers + ad copy + EU reach, rankedRequirements
A residential internet connection. Meta
rd_challenge‑403s datacenter IPs (AWS/GCP/VPS) within seconds. On a normal home/office machine it just works; on a server you must setRESIDENTIAL_PROXY_URL(see Hosting).Python 3.10+
Google Chrome installed (the server launches your real Chrome for a clean fingerprint). No Chrome? Set
META_ADS_CHANNEL=""to use Playwright's bundled Chromium.
Related MCP server: Facebook Ads Library MCP Server
Install (uv — recommended)
git clone https://github.com/konstantin-tradient/meta-ad-library-mcp.git
cd meta-ad-library-mcp
uv sync # creates an isolated venv from pyproject.toml
uv run playwright install chromiumQuick local check (no MCP client needed):
uv run python smoke.py "dental implants" DE # live: search + reach
uv run --extra dev pytest -q # offline parser testpy -m pip install -r requirements.txt && py -m playwright install chromium # Windows
python3 -m pip install -r requirements.txt && python3 -m playwright install chromiumThen run/register with py -m meta_ads_mcp.server + --env PYTHONPATH=<dir>.
No-clone install (uvx)
To use it on a machine without cloning, uvx fetches + builds straight from GitHub.
Install Chromium once, then register the connector:
# one-time: download the browser into the shared cache
uvx --from playwright playwright install chromium
# Claude Code — pin a tag so deps don't drift
claude mcp add meta-ads --scope user -- \
uvx --from git+https://github.com/konstantin-tradient/meta-ad-library-mcp.git@v0.1.0 meta-ads-mcp(Claude Desktop: "command": "/full/path/to/uvx", "args": ["--from", "git+https://github.com/konstantin-tradient/meta-ad-library-mcp.git@v0.1.0", "meta-ads-mcp"].)
Use this for machines that only run the tool. To develop it, clone + uv run
below (so your local edits apply and uv.lock pins deps). If you hit a
"browser not found" error, re-run playwright install chromium.
Connect it to Claude (from a clone)
The MCP command is just uv run --directory <clone> meta-ads-mcp — uv auto-syncs the
venv, so there's nothing to install globally.
Claude Code (CLI)
# --scope user = available in every project. Use the clone's ABSOLUTE path.
claude mcp add meta-ads --scope user -- uv run --directory /abs/path/to/meta-ad-library-mcp meta-ads-mcpRestart Claude Code, then ask: "search the Meta Ad Library for dental implants in Germany."
Claude Desktop (Mac/Windows app)
Edit claude_desktop_config.json
(Windows: %APPDATA%\Claude\, macOS: ~/Library/Application Support/Claude/) and add
under mcpServers (use the full path to uv — which uv / where uv):
"meta-ads": {
"command": "/full/path/to/uv",
"args": ["run", "--directory", "/abs/path/to/meta-ad-library-mcp", "meta-ads-mcp"]
}Fully quit and reopen Claude Desktop (tray → Quit). The tools appear in the chat.
claude.ai (web) can't run a local server — it only connects to remote MCP servers (public HTTPS URL + auth). See Hosting.
Tools
Tool | Returns |
|
|
|
|
|
|
Use an EU country code (
DE,FR,NL…) to surface ads that carry EU‑reach data. Ads not delivered in the EU haveeu_total_reach = null(Meta's design).fetch_reach=Trueclicks every result in one warm session (~3–4s/ad) — great for ≤50; otherwise list fast and pull reach per‑ad withget_ad_details.
How it works
rd_challenge is a soft gate — the first request 403s but sets a clearance cookie; the server warms the session (homepage → library landing) and retries, which clears it. (This is what made headless work without a paid API.)
List = the page's own GraphQL, not DOM scraping.
search_adsreads the SSR'd first page (embedded JSON) +AdLibrarySearchPaginationQuerycaptured on scroll, so advertiser + ad copy are reliable for every ad (incl. image/video), and it paginates to 50+.Reach comes from
AdLibraryV3AdDetailsQuery, which only fires when you click an ad's "See ad details" on the search page — so reach is gathered by clicking, either in batch (fetch_reach=True) or per‑ad (get_ad_details).
Environment variables
Var | Default | Purpose |
| – |
|
|
| Browser channel; set |
| – |
|
|
| Persistent browser profile dir (keeps the warm session) |
Hosting / remote (claude.ai)
Runs locally on a residential IP for free — ideal for interactive use. To reach it from claude.ai (web) or run it 24/7 on a server, you need:
HTTP transport — switch
mcp.run()tostreamable-httpinserver.py.A public HTTPS endpoint with auth (claude.ai connectors expect OAuth).
Residential egress — set
RESIDENTIAL_PROXY_URL; there is no free way around the datacenter‑IPrd_challenge.
Legal
This automates access to a public transparency tool for competitive research. It nonetheless falls under Meta's automated‑access terms — use a disposable/burner account if you host it, pace conservatively, and don't hammer. Provided as‑is.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/konstantin-tradient/meta-ad-library-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server