Facebook Ad Library MCP
Provides access to the Facebook Ad Library for competitive ad research, allowing keyword searches and URL scraping to retrieve ad records with advertiser details, landing pages, ad copy, CTAs, and creative thumbnails.
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., "@Facebook Ad Library MCPSearch the US Ad Library for 'AI tools' and list the top advertisers' landing pages."
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.
Facebook Ad Library MCP
A small MCP server that scrapes the public Facebook Ad Library for competitive ad research — from your MCP client, with no Facebook account and no API token.
Install
git clone https://github.com/leyovco/facebook-ads-library-mcp.git
cd facebook-ads-library-mcp
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python -m playwright install chromium # crawl4ai needs a browserRegister with your MCP client
Claude Code:
claude mcp add facebook-ads -- /abs/path/venv/bin/python /abs/path/facebook_ads_mcp_complete.pyClaude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"facebook-ads": {
"command": "/abs/path/venv/bin/python",
"args": ["/abs/path/facebook_ads_mcp_complete.py"]
}
}
}Restart the client.
Related MCP server: Facebook Ads Library MCP Server
Usage
"Search the Mexico Ad Library for 'automatización con inteligencia artificial',
group by advertiser, and list the landing domains."
"Scrape https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=MX&q=nike&search_type=keyword_unordered
with scroll_rounds=15 and summarise the creative angles."Tools
Two tools:
search_ad_library(query, country="MX", ...)— keyword search.scrape_ad_library_url(url, ...)— scrape any Ad Library URL you already have.
Both return structured records per ad:
field | meaning |
| Page name and its |
| first-seen date |
| how many creatives share this copy — a rough scale signal |
| destination, unwrapped from the |
| the button label ( |
| the headline strip under the creative |
| full ad copy |
| thumbnail URL |
| deep link to that ad's detail view |
Plus an advertisers histogram and the raw_markdown of the page so the model can pull anything the parser missed.
Configuration
scroll_rounds(default 8)wait_seconds(default 8)country— ISO code (e.g.,MX,US,ES)advertiser_page_id— target one Page's "all ads" view (less reliable than keyword search)
How it works
crawl4ai (AsyncWebCrawler) opens the Ad Library URL in headless Chromium, waits for the React app to hydrate, runs a scroll loop to trigger lazy-loaded cards, serialises the DOM to markdown, and a regex parser (_parse_ad_library_markdown) splits it on Library ID: boundaries and pulls the fields above.
Facebook answers the headless browser with HTTP 403 but still serves the rendered cards, so the tools judge success by whether cards parsed, not by status code.
License
MIT — original by Ramses Aguirre (RamsesAguirre777). Adapted and hosted under leyovco.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Search Meta, Google Ads, LinkedIn, and TikTok ad libraries plus creative analysis via MCP.
Every ad an advertiser runs on Google, from the public Ads Transparency Center. Unofficial tool.
Create, launch & analyze ad campaigns, spy on competitors - Google, Meta, TikTok, LinkedIn & more.
Competitive ad intelligence for AI agents: portfolios, ad/content search, analytics, discovery.
Related MCP Servers
- FlicenseAqualityDmaintenanceSearches the Meta (Facebook) Ad Library by keyword and returns ad details including advertiser, ad copy, and EU reach, without requiring an API key.31-
- AlicenseAqualityBmaintenanceEnables searching and analyzing Facebook's public ads library for any brand, including ad images, text, and video analysis.825295MIT
- AlicenseNot gradedqualityCmaintenanceEnables competitive intelligence, market analysis, and advertising insights by providing 15+ advanced tools to search, analyze, monitor, and predict Facebook ad performance.234MIT
- FlicenseNot gradedqualityCmaintenanceProvides tools to access Facebook Ads campaign data, insights, and account spend summaries without paid services.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/leyovco/facebook-ads-library-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server