Ad library MCP server: ask Claude about competitor ads
Install the adlib-mcp server in Claude Code, Claude Desktop or Cursor and ask about competitor ads on Meta, Google, TikTok and more, with each call's cost.
The AdLib team · · updated · 6 min read
You can ask Claude "what ads is Nike running in Germany right now" and get an answer built from real ad library data, with ids and dates you can check. That takes an MCP server for ad library data, and we publish one: adlib-mcp. This post covers install, the tools, three prompts we use, and what the agent actually calls behind each one.
What MCP is, in two sentences
The Model Context Protocol is a standard way for an AI client like Claude or Cursor to call tools that live outside the model. You install a server once, and the agent decides when to call its tools while it works on your question.
Install the MCP server for ad library data
You need Node.js 20 or newer and an AdLib API key (plans and free credits are on /pricing). The server runs locally over stdio and sends your key as the X-API-Key header.
Claude Code, one command:
claude mcp add adlib --env ADLIB_API_KEY=your-key -- npx -y adlib-mcpClaude Desktop: open Settings > Developer > Edit Config, add this to claude_desktop_config.json and restart the app.
{
"mcpServers": {
"adlib": {
"command": "npx",
"args": ["-y", "adlib-mcp"],
"env": { "ADLIB_API_KEY": "your-key" }
}
}
}Cursor: the same block goes into ~/.cursor/mcp.json for all projects or .cursor/mcp.json for one. Any other client that can start a stdio server works with the command npx -y adlib-mcp.
Without a key the server still starts and lists its tools, and api_status works. Every other call returns an error that says how to set the key.
Which tools the agent gets
There are 20 tools. They map one to one onto the REST API, so anything the agent does you can later script yourself (see /for/developers).
| Tool | What it answers |
|---|---|
resolve_advertisers |
Which accounts belong to this domain on each platform, with score and match reason |
check_domain |
Is this company advertising right now, and where |
get_company |
All of a company's ad accounts across platforms and countries, with combined stats |
report_resolve_match |
Flag a wrong or missing account match; we review it and fix it for everyone |
search_ads |
Ads by keyword, advertiser or domain, filtered by platform, country, status, date, format, political |
get_ad, get_ad_history |
One ad in full; its creative versions and active periods |
get_advertiser, list_advertiser_ads |
An advertiser and all its ads, including vanished ones |
advertiser_stats |
Ads by status, format, country, language, run time, plus the 5 longest-running |
advertiser_timeline, advertiser_changes |
What started, stopped or changed, and when |
create_watchlist, get_watchlist, list_watchlists |
Ongoing monitoring with a webhook |
create_batch, get_batch |
Async jobs for many advertisers, domains or ad ids |
list_webhook_deliveries, test_webhook |
Webhook debugging |
api_status |
Health per platform and what each one supports |
create_watchlist, create_batch, test_webhook and report_resolve_match change something on your account, so they are marked readOnlyHint: false and your client asks before running them. The rest are read-only.
Tool results are compact text by default. A page of 30 Meta ads is over 100 KB of JSON, which would eat the agent's context, so the tools return one short block per ad with every id the next call needs. Pass output: "json" when you want the raw response.
Three Claude competitor ads prompts and what they call
These are prompts we run ourselves. The tool sequence is what Claude typically chooses; it can vary.
"Is nike.com advertising right now, and where?"
Claude calls check_domain with nike.com. That is one call at a flat 3 credits. On 26 Oct 2026 it came back with Meta, Google, TikTok and LinkedIn advertising, Pinterest not, and X unknown because X's ad search answered 503. Claude then summarises per platform with the advertiser it matched (Nike page meta:15087023444, Nike Retail BV on Google, NIKE Retail B.V. on TikTok).
If you follow up with "which accounts did you match?", it calls resolve_advertisers (10 credits) and shows the score and match reason for each. How that matching works is in finding advertiser IDs from a domain.
"What were Nike's longest-running Meta ads in Germany this year?"
This one takes a chain:
resolve_advertisersfor nike.com, keepsmeta:15087023444.advertiser_statsfor that id (5 credits), which returns the 5 longest-running ads from our history.get_adon the two or three that look interesting, for copy, landing pages and placements.
In our archive the longest of Nike's 30 DE Meta ads ran 86 days ("Get the gear that's up for it all", 30 Mar to 24 Jun 2026) and the shortest was an 8-day Black Friday ad. All 30 had ended by 26 Oct 2026, which is why step 2 reads from history instead of the live library. If you want to know whether run length means anything, we wrote about ad run length as a performance signal.
"Watch HelloFresh on every platform and tell me when they launch something"
resolve_advertisersfor hellofresh.com. In our live test it found 10 advertisers across platforms in one call.- Claude shows the list and asks which to keep. Worth doing, the low-score ones are often country pages or name collisions.
create_watchlistwith the ids, yourwebhook_urlandinterval_hours. Your client asks for confirmation first.test_webhookto send a signedwebhook.pingand check your endpoint.
From then on we crawl those advertisers and POST an advertiser.changes event with new, stopped and changed ads. Later, advertiser_changes with a since date answers "what changed since Monday" without waiting for the webhook.
What each call costs, visible in the result
Every tool result ends with a billing line, for example:
billed: 5 credits · request_id: 05b198b3-…That footer is never cut, even when max_chars (default 40,000) truncates the rest. The agent sees it too, so you can ask Claude to keep a running total and stop at a budget you name.
A live search page costs at most 5 credits per platform (10 on Google, 15 on LinkedIn), however many ads it returns, and results we already fetched in the past 24 hours are free. Single ads, history searches and advertiser ad lists are billed per ad: 1 on Meta, TikTok, Pinterest and X, 2 on Google, 3 on LinkedIn, double for ads last shown more than 12 months ago. Empty results, platform errors and malformed calls cost nothing. Tool arguments are validated before any request goes out (id format, YYYY-MM-DD dates, ISO country codes), so a typo in a country code is free.
Errors come back with the code, whether the call was billed and what to do next. A 429 for a used-up quota tells the agent not to retry, which stops it from looping.
Limits you should know about
X is beta. X's ad search often answers 503 "over capacity". Cross-platform search skips X unless you ask for platform=x, and resolve includes it but only as a name match. api_status shows the current state per platform, as does /platforms.
Remote or local. In Claude.ai or ChatGPT, add https://mcp.adlibapi.com/mcp as a custom connector and sign in with your AdLib account; the connector gets its own key, which you can revoke in the dashboard. In Claude Desktop, Claude Code or Cursor you can use either that URL or the local npx server with an API key.
Public data only. Everything comes from the logged-out ad libraries over plain HTTP requests. If a platform does not publish a field, such as run dates on LinkedIn, we cannot give it to the agent either.
For more on agent setups, see /for/ai-agents. If you are new to the topic, start with how to see competitors' ads, then install the server and ask your first question.
Questions people ask
- Is there an MCP server for ad library data?
- Yes. adlib-mcp is an MCP server on npm that gives Claude, Cursor and other MCP clients 20 tools for the public ad libraries of Meta, Google, TikTok, LinkedIn, Pinterest and X.
- How do I add the AdLib MCP server to Claude Code?
- Run claude mcp add adlib --env ADLIB_API_KEY=your-key -- npx -y adlib-mcp. It needs Node.js 20 or newer and an AdLib API key.
- Can I see what an MCP tool call costs?
- Yes. Every tool result ends with a billing line such as "billed: 5 credits", and that line is never cut when the output is truncated. Empty results and platform errors are not billed.
- Does the AdLib MCP server work in Claude.ai or ChatGPT?
- Yes. Add https://mcp.adlibapi.com/mcp as a custom connector and sign in with your AdLib account (OAuth); no key to paste. Claude Desktop, Claude Code and Cursor can also run the local server with an API key.