adlibrary.com Logoadlibrary.com
Share
Guides & Tutorials,  Platforms & Tools

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.

adlibrary MCP server connected to Claude — ad intelligence chat illustration

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_key into 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

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.

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:

  1. Copy your API key from adlibrary.com/api-access.

  2. In Claude, open Settings → Connectors → Add custom connector (Anthropic documents the flow in its custom connectors guide).

  3. Name: adlibrary. Remote MCP server URL — your key is the last part of the URL:

    https://mcp.adlibrary.com/adl_your_key_here
    
  4. Leave the OAuth fields empty and click Add.

  5. Start a new chat. The adlibrary tools appear in the tools menu (hammer icon).

Claude custom connector dialog with adlibrary MCP server URL pasted

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):

adlibrary MCP server tools listed in Claude connector settings with per-tool permissions

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
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.

ToolCostWhat it does
count_adsfreeMarket sizing: how many ads match your filters, without fetching them. Run before search_ads.
resolve_brandfreeBrand name → advertiser IDs on Meta (page id), Google ATC (AR… id), LinkedIn (company id).
find_advertiser_pagesfreeFind Meta advertiser pages (page id, ad count, verification). Required probe before scan_winners.
get_ad_detailfreeFull metadata for one ad: copy, media, CTA, runtime, impressions, Meta audience breakdown.
list_saved_advertisersfreeList brands you track.
save_advertiser / update_saved_advertiser / delete_saved_advertiserfreeManage tracked brands via Saved Ads.
search_ads1 credit/pageMulti-platform unified ad search with 25+ filters (media type, geo, run time, engagement, CTA, sort).
get_advertiser_ads1 credit / 30-min sessionPull a saved brand's ads across Meta + Google + LinkedIn; paging within 30 minutes is free.
analyze_ad1+ creditsAI creative analysis of one ad: breakdown, summary, scene-marked transcription. Long videos cost more.
scan_winners10 creditsScan 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 running adlibrary MCP tools count_ads and search_ads in a chat

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:

Claude answer built from adlibrary MCP data — winning ad angles for a gum brand with runtimes and impressions

That's creative research that normally takes an afternoon of manual ad library digging, compressed into one chat turn.

Get your API key →

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 with find_advertiser_pages first (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

SymptomFix
Connector added but no tools appearStart a new chat; check the tools (hammer) menu. On Desktop, restart the app.
"Missing API key in URL" errorThe 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" repliessearch_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.

Get your API key at adlibrary.com/api-access →

Related Articles

Prompt template cards arranged like a Rolodex with bracket variables like TARGET AUDIENCE and PRODUCT, representing how to customize Claude prompts for marketing
Guides & Tutorials,  Platforms & Tools

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.