FbAdLibraryMCPServer
@StinCodes
About FbAdLibraryMCPServer
Build a Model Context Protocol (MCP) server that provides access to Facebook's Ad Library through web scraping. The server should allow clients to search for advertisements with various filters and retrieve comprehensive ad data.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"FbAdLibraryMCPServer": {
"command": "npx",
"args": [
"playwright",
"install"
]
}
}
}Tools
No tools detected
Fetch the live tool list by running this server in a temporary sandbox using the button above.
Overview
What is FbAdLibraryMCPServer?
FbAdLibraryMCPServer is an MCP server that provides access to Facebook's Ad Library through web scraping. It exposes a single MCP tool for searching advertisements with comprehensive filtering options.
How to use FbAdLibraryMCPServer?
Install dependencies (npm install and npx playwright install), then start the server with npm run dev (development) or npm run build && npm start (production). Connect any MCP-compatible client to the HTTP endpoint (default http://localhost:3000/mcp). Use the built-in search_ads tool with parameters such as company, start_date, end_date, keywords, limit, and order.
Key features of FbAdLibraryMCPServer
- MCP-compliant, built using the official MCP SDK
- Extracts full ad data: advertiser, content, dates, impressions, spend
- Advanced filtering by company, date range, and keywords
- Smart pagination retrieves up to 100 ads per search
- Flexible sorting by date (ascending/descending) or relevance
- Anti-bot detection countermeasures for reliable scraping
Use cases of FbAdLibraryMCPServer
- Researching competitor advertising strategies
- Analyzing ad content, impressions, and spending patterns
- Tracking ad campaigns for specific companies over time
- Studying ad targeting demographics for academic research
FAQ from FbAdLibraryMCPServer
What MCP tool does the server expose?
The server exposes a single tool called search_ads that accepts optional parameters for company, dates, keywords, limit, and sort order.
What is the maximum number of ads returned per search?
The server can return up to 100 ads per search. The default limit is 50.
Does the server require authentication?
No authentication is required to connect to the server's HTTP endpoint.
How does the server handle anti-bot detection?
It uses virtual display (Xvfb), natural navigation patterns, simplified browser configuration, a 30-second browser launch timeout, and different behavior in production vs development to bypass Facebook's detection.
What are the known limitations of FbAdLibraryMCPServer?
The server runs in non-headless mode, is limited to 100 ads per search, date formats depend on Facebook's display, and it is subject to Facebook's anti-bot measures.
Frequently asked questions
What MCP tool does the server expose?
The server exposes a single tool called `search_ads` that accepts optional parameters for company, dates, keywords, limit, and sort order.
What is the maximum number of ads returned per search?
The server can return up to 100 ads per search. The default limit is 50.
Does the server require authentication?
No authentication is required to connect to the server's HTTP endpoint.
How does the server handle anti-bot detection?
It uses virtual display (Xvfb), natural navigation patterns, simplified browser configuration, a 30-second browser launch timeout, and different behavior in production vs development to bypass Facebook's detection.
What are the known limitations of FbAdLibraryMCPServer?
The server runs in non-headless mode, is limited to 100 ads per search, date formats depend on Facebook's display, and it is subject to Facebook's anti-bot measures.
Basic information
More Developer Tools MCP servers
TranscriptFetch MCP Server
TranscriptFetchModel Context Protocol (MCP) server for TranscriptFetch: fetch YouTube transcripts, search, channels, and playlists from any MCP client.
Hello World MCP Server (Reference Extension)
anthropicsDesktop Extensions: One-click local MCP server installation in desktop apps

PuzzleTide Puzzle Generator
Caravaca-LabsWord search generator, crossword generator, and sudoku generator + solver as a local-first MCP server. 15 deterministic tools: printable PDF puzzle worksheets, themed word banks, and verifiable LLM evals. From the makers
Serena
oraiosA powerful MCP toolkit for coding, providing semantic retrieval and editing capabilities - the IDE for your agent
endoflife.ai
endoflife.aiFree MCP server for software end-of-life intelligence: EOL dates, support status, and the 0-100 EOL Risk Score across 485 tracked products. Agents can check a single version, pull a product's full lifecycle schedule, or
Comments