Skip to main content

ScrapeAdLibrary MCP Server

An MCP server that lets AI assistants (Claude Desktop, Claude Code, Cursor, Cline...) search the public Meta Ad Library (Facebook, Instagram, Messenger, Audience Network, Threads) through the ScrapeAdLibrary API: competitor ads, creatives, advertisers, political ad spend, EU (DSA) reach and targeting.

Features

5 Tools — search ads, ad detail, advertiser profile, advertiser's ads, advertiser search

4 Documentation Resources — API reference, quickstart, pricing, workflow examples

3 Prompt Templates — competitor ad research, keyword market scan, single ad analysis

Connect without installing (Claude, ChatGPT, Claude Code)

The same tools are available as a hosted remote MCP server with OAuth sign-in: no API key to copy, nothing to install. Add this URL as a custom connector and sign in with your ScrapeAdLibrary account:

https://api.scrapeadlibrary.com/mcp
  • Claude (web, Desktop, mobile): Customize → Connectors → Add custom connector.
  • ChatGPT: chatgpt.com/plugins → Add custom MCP server → OAuth.
  • Claude Code: claude mcp add --transport http scrapeadlibrary https://api.scrapeadlibrary.com/mcp, then /mcp to sign in.

Calls use your account's credits with the API's pricing. Step-by-step guide: scrapeadlibrary.com/docs/mcp.

Quick Start (local server with an API key)

1. Get an API Key

Sign up at scrapeadlibrary.com and create an API key (starts with sal_).

2. Configure Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "scrapeadlibrary": {
      "command": "uvx",
      "args": ["scrapeadlibrary-mcp"],
      "env": {
        "SCRAPEADLIBRARY_API_KEY": "sal_your_key_here"
      }
    }
  }
}

3. Use it

Ask Claude:

  • "What ads is Nike running in Italy right now? Summarise their messaging."
  • "Show me active video ads about 'protein powder' in the US, sorted by impressions"
  • "Which advertisers run ads for 'running shoes'?"
  • "Get the EU reach and targeting of ad 1550534860016399"

Configuration for Other Clients

Cursor

Add the same JSON block to .cursor/mcp.json.

Claude Code

claude mcp add scrapeadlibrary -e SCRAPEADLIBRARY_API_KEY=sal_your_key_here -- uvx scrapeadlibrary-mcp

Installation Alternatives

pip

pip install scrapeadlibrary-mcp
SCRAPEADLIBRARY_API_KEY=sal_xxx scrapeadlibrary-mcp

npx

SCRAPEADLIBRARY_API_KEY=sal_xxx npx scrapeadlibrary-mcp

(The npm package is a thin wrapper: it runs the Python server via uvx, or python3 -m as a fallback.)

Docker

docker build -t scrapeadlibrary-mcp .
docker run -i --rm -e SCRAPEADLIBRARY_API_KEY=sal_xxx scrapeadlibrary-mcp

Tools

Tool Description Cost Key defaults
search_ads Search ads by keyword and/or advertiser, with country, status, media, platform, language, date filters 1 credit per 10 ads limit=10, status=active
get_ad Full ad: text, media, cards, advertiser, payer/beneficiary, EU/UK transparency 2 credits —
get_page Advertiser profile: category, likes, Instagram, active ads estimate 1 credit —
get_page_ads Ads of one advertiser 1 credit per 10 ads limit=10, status=active
search_pages Advertisers that ran ads matching a keyword 1 credit per 10 results limit=10

Empty results and errors cost 0 credits. Lists return a cursor to fetch the next page.

Environment Variables

Variable Required Description
SCRAPEADLIBRARY_API_KEY Yes Your API key (starts with sal_)
SCRAPEADLIBRARY_BASE_URL No Override API base URL (default: https://api.scrapeadlibrary.com)

Development

uv venv && uv pip install -e ".[dev]"
.venv/bin/pytest
.venv/bin/ruff check . && .venv/bin/ruff format --check .

Test with MCP Inspector:

SCRAPEADLIBRARY_API_KEY=sal_xxx .venv/bin/mcp dev dev_server.py

assets/logo-400.png is still the placeholder logo inherited from the template: replace it with the final brand logo before publishing to registries.

License

MIT

Metadata

Release files for scrapeadlibrary-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scrapeadlibrary-mcp 0.1.0
File Size Uploaded Provenance Actions
scrapeadlibrary_mcp-0.1.0.tar.gz 124.6 kB Without provenance Details for scrapeadlibrary_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scrapeadlibrary-mcp 0.1.0
File Interpreter ABI Platform Actions
scrapeadlibrary_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for scrapeadlibrary_mcp-0.1.0-py3-none-any.whl

Total release size: 143.7 kB

Release files / scrapeadlibrary_mcp-0.1.0.tar.gz

Download URL scrapeadlibrary_mcp-0.1.0.tar.gz
Size 124.6 kB
Tags Source
SHA-256 checksum
How to use checksums
dbcb44f5cd244f6839815067e4e1b32c398af5a35a57090a3940e26c5b45fe4d
BLAKE2b-256 checksum
How to use checksums
b041823773926be47453fc8859de95ad6b1df132dc82e4f44226a8dd81b2a576
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / scrapeadlibrary_mcp-0.1.0-py3-none-any.whl

Download URL scrapeadlibrary_mcp-0.1.0-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06cf1e7263b6649110baa92c0a75463fbf3b895d1199d92cecf279ac33ac3ba5
BLAKE2b-256 checksum
How to use checksums
f475fa3088d4e98cd5ad0e219be42ed2ed1c50df91b3667db5edc6a389c03c28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for scrapeadlibrary-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page