Use adlibrary inside Claude: official MCP server setup (2-minute connector)
Connect the official adlibrary MCP server to Claude in two minutes — search ads, resolve brands, and scan for winners without leaving the chat.

Sections
adlibrary ships an official MCP (Model Context Protocol) server, and connecting it to Claude takes about two minutes. Instead of copying data between the adlibrary app and your AI chat, Claude (or Cursor, or any MCP client) calls the adlibrary API directly as tools. You ask "what's Nike running on Meta right now, and which of their ads are winners?" — Claude runs the right calls, spends your credits transparently, and reasons over the results from Meta, Instagram, Google Ads Transparency Center, and LinkedIn.
There are two ways to connect. Almost everyone should use the first.
TL;DR — Paste
https://mcp.adlibrary.com/adl_your_keyinto Claude → Settings → Connectors → Add custom connector. Done. Claude can now search ads, resolve brands, scan advertisers for winners, and run AI creative analysis across Meta, Instagram, Google Ads Transparency Center, and LinkedIn — without you leaving the chat.
What you need
- An adlibrary Business subscription
- An API key (format
adl_…) — create one at adlibrary.com/api-access
That's it. No Node, no terminal, no config files for the recommended path. If you're still weighing which ad data source to wire into your AI agent stack, the ad spy API comparison and what an ad library API actually is cover the landscape.
Option A — Remote MCP connector (recommended, no install)
Works with Claude on the web (claude.ai) and Claude Desktop.
Fastest path — one-click link: Add adlibrary to Claude → opens Claude with the connector dialog already filled in (name adlibrary, server URL prefilled). Replace adl_your_key_here with your real key in the URL field, click Add, done.
Or set it up manually:
-
Copy your API key from adlibrary.com/api-access.
-
In Claude, open Settings → Connectors → Add custom connector (Anthropic documents the flow in its custom connectors guide).
-
Name:
adlibrary. Remote MCP server URL — your key is the last part of the URL:https://mcp.adlibrary.com/adl_your_key_here -
Leave the OAuth fields empty and click Add.
-
Start a new chat. The adlibrary tools appear in the tools menu (hammer icon).

The server is a stateless pass-through to the adlibrary API: your key is read from the URL on each request and forwarded as the auth token. It is never stored server-side.
Treat the connector URL like a password. Anyone who has the full URL can spend your credits. If it leaks, revoke the key at adlibrary.com/api-access and create a new one — then update the connector URL.
Once added, the connector's settings page lists every tool with its credit cost, and you can set per-tool permissions (always allow, ask, or block):

Option B — Local install via npm (Cursor and other MCP clients)
For clients that speak stdio MCP (Cursor, Claude Desktop as an alternative, custom agents like the ones in Claude Code + adlibrary API workflows). Requires Node.js ≥ 18.
Claude Desktop — edit the config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"adlibrary": {
"command": "npx",
"args": ["-y", "@adlibrary/mcp"],
"env": { "ADLIBRARY_API_KEY": "adl_your_key_here" }
}
}
}
Restart Claude Desktop.
Cursor — Settings → MCP → Add new MCP server → type stdio, command npx -y @adlibrary/mcp, env var ADLIBRARY_API_KEY. Cursor's own MCP documentation covers where the config lives per project.
The same stdio server also slots into Claude Code sessions — useful if you already run agentic marketing workflows from the terminal, or want to pair it with the Meta Ads MCP for a research-to-launch pipeline.
What Claude can do once the MCP server is connected
Free tools cost nothing and exist so Claude can probe before spending. Paid tools state their cost up front — the tool descriptions steer Claude to run the free probes first.
| Tool | Cost | What it does |
|---|---|---|
count_ads | free | Market sizing: how many ads match your filters, without fetching them. Run before search_ads. |
resolve_brand | free | Brand name → advertiser IDs on Meta (page id), Google ATC (AR… id), LinkedIn (company id). |
find_advertiser_pages | free | Find Meta advertiser pages (page id, ad count, verification). Required probe before scan_winners. |
get_ad_detail | free | Full metadata for one ad: copy, media, CTA, runtime, impressions, Meta audience breakdown. |
list_saved_advertisers | free | List brands you track. |
save_advertiser / update_saved_advertiser / delete_saved_advertiser | free | Manage tracked brands via Saved Ads. |
search_ads | 1 credit/page | Multi-platform unified ad search with 25+ filters (media type, geo, run time, engagement, CTA, sort). |
get_advertiser_ads | 1 credit / 30-min session | Pull a saved brand's ads across Meta + Google + LinkedIn; paging within 30 minutes is free. |
analyze_ad | 1+ credits | AI creative analysis of one ad: breakdown, summary, scene-marked transcription. Long videos cost more. |
scan_winners | 10 credits | Scan an advertiser's full Meta portfolio and detect winning ads: winner/loser tiers, composite scores, creative-DNA diffs. |
That toolset covers most of the competitor-ad-to-campaign pipeline without a single tab switch — and it's the same data layer our ad data for AI agents use case documents for custom builds.
Prompts to try first
- "How many active Meta video ads mention 'free shipping' in Germany? Don't fetch them yet, just size the market."
- "Resolve the brand Gymshark to its advertiser IDs on Meta, Google, and LinkedIn, then save it."
- "Find Nike's Meta advertiser page, confirm it's the verified one, then scan it for winning ads."
- "Search for skincare ads that have been running longer than 90 days, sorted by impressions — long runtime usually means they're profitable."
- "Take the top ad from that search and run a full creative analysis on it."
Each prompt mirrors the same flow: free probe first, paid call second. For a deeper stack of ready-made prompts, the Meta ads MCP prompts library and the MCP workflow recipes for agency teams transfer almost verbatim.
Here's the flow in practice. We primed a chat on building a nicotine gum brand, then asked Claude to find ad angles:

Claude sized the market with the free count_ads probe, ran two search_ads calls, and came back with the in-market split — nicotine gums running 150–230-day advertorials versus energy gums positioning against coffee and energy drinks — with runtimes and estimated impressions per creative attached:

That's creative research that normally takes an afternoon of manual ad library digging, compressed into one chat turn.
Limits worth knowing
search_ads: max 60 results per page (upstream hard limit), max page 100, 10 calls/min. LinkedIn caps at 25 results — the LinkedIn ad library API guide explains why B2B coverage works differently. API keys return e-commerce ads.scan_winners: one scan at a time per user; takes 1–5 minutes. Auto-refunds if the advertiser has no ads or an upstream error occurs — but a valid-but-wrong page id still charges, so let Claude confirm the page withfind_advertiser_pagesfirst (it's free).- Impressions and spend are ranges/estimates, never exact platform disclosures. Same constraint as every transparency surface — see Meta Ad Library API limitations for the upstream reality.
- All credits bill the team owner's balance.
If your agent starts hitting walls, the patterns in handling ad API errors — credits, rate limits, retries — apply one-to-one to MCP tool calls.
Troubleshooting
| Symptom | Fix |
|---|---|
| Connector added but no tools appear | Start a new chat; check the tools (hammer) menu. On Desktop, restart the app. |
| "Missing API key in URL" error | The URL must end with your key: https://mcp.adlibrary.com/adl_… — no trailing slash after the key. |
| 401 / "invalid key" | Key revoked or mistyped. Create a fresh one at adlibrary.com/api-access. |
| "Rate limit" replies | search_ads is capped at 10 calls/min. Ask Claude to slow down or narrow the search. |
| npx path: "command not found" | Install Node.js ≥ 18, or switch to Option A (no install needed). |
When the tools connect fine but the agent misreads results, that's a different class of problem — Meta ads MCP debugging covers the agent-side failure modes.
FAQ
Does the adlibrary MCP server cost extra? No. The MCP server is free; tool calls spend the same credits as the API and the app. Every paid tool reports your remaining balance after each call.
Which plan do I need? API keys are a Business-tier feature.
Can my whole team use one connector? Each teammate should create their own key; all usage bills the team owner's credit balance either way, but per-key revocation stays clean. Agencies running multiple client accounts should read the multi-account MCP architecture first.
Does it work with ChatGPT / other clients? Any MCP-compatible client works: remote (Streamable HTTP) via the connector URL, or local via npx -y @adlibrary/mcp.
Prefer to build your own? If you want a custom subset of endpoints or your own hosting, see build your own adlibrary MCP server in 60 lines of Python. The official server is the zero-maintenance path.
Bottom line
The official adlibrary MCP server turns Claude into a front end for ad intelligence: free probes to scope, paid calls to fetch, and your competitor monitoring running where you already work. Paste the URL, start a chat, and put the ad research where the reasoning happens — it's the shortest on-ramp to the AI marketing team pattern.
Further Reading
Related Articles

adlibrary MCP server: build your own in 60 lines of Python
Build a custom adlibrary MCP server with fastmcp in 60 lines of Python. Expose ad search, timeline, and enrichment as Claude tools—pair with Meta Ads MCP.

Meta Ads MCP setup: connect Claude Code to Meta in 2026
Connect Claude Code to Meta's MCP server in four commands. OAuth scopes, read queries, paused campaign drafting, and Pipeboard vs official server compared.

Meta ads MCP prompts: 20 copy-paste templates
Twenty production-ready meta ads MCP prompts organized by risk class — read-only, draft, status-changing, and financial — with guardrails for each.

Meta ads MCP for agencies: multi-account architecture
How agencies route MCP prompts to the right client account, isolate writes per client, and maintain a clean audit trail across 30 Meta ad accounts.

Claude Code + adlibrary API: End-to-End Competitor Intelligence Workflows
Run five Claude Code workflows against the adlibrary API for automated competitor monitoring: Slack alerts, bulk teardowns, hook extraction across 500 ads, monthly landscape reports, and new entrant detection.

Meta Ads MCP vs Ads Manager: when to automate, when to click
Meta Ads MCP vs Ads Manager: a framework by operation type — where MCP wins on speed, where Ads Manager wins on judgment, and how to run both tools.
Claude Code + AdLibrary API: Building Agentic Marketing Workflows That Actually Ship
Build unattended competitor intelligence workflows using Claude Code and the AdLibrary API. Includes real API call patterns, two worked examples, and observability practices.