
Facebook Ads Library MCP Server
Search and analyze any brand's public Facebook ads — images, videos, messaging, and competitor strategy.
Add to your client
Copy the config for your MCP client and paste it into its config file.
git clone https://github.com/proxy-intell/facebook-ads-library-mcp.git && cd facebook-ads-library-mcp && ./install.shPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"facebook-ads-library-mcp-server": {
"command": "{{PATH_TO_PROJECT}}/venv/bin/python",
"args": [
"{{PATH_TO_PROJECT}}/mcp_server.py"
]
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Python 3.12+
- pip (Python package manager)
- Claude Desktop or Cursor
- A ScrapeCreators API key (SCRAPECREATORS_API_KEY) for ads data
- Optional: a Google Gemini API key (GEMINI_API_KEY) for video analysis
About Facebook Ads Library MCP Server
This MCP server lets an AI assistant query the public Facebook Ads Library for any brand and analyze its advertising. It resolves brand names to Meta platform IDs, fetches the ads a page is running, and analyzes ad creative — images (visual elements, text, colors, composition) and videos (Gemini-powered insights, including a batch mode for token efficiency). It supports multi-brand batch operations for side-by-side competitor comparisons, plus a media cache with stats, search, and cleanup tools. Requests are batched and cached, with credit monitoring and rate-limit handling to keep workflows from breaking. Data comes from an underlying ads-data provider (ScrapeCreators); video analysis uses Google Gemini.
Tools & capabilities (8)
get_meta_platform_idReturns the Meta platform ID given one or many brand names (supports multiple brands in a batch).
get_meta_adsRetrieves ads for specific page(s) by platform ID (supports multiple platform IDs in a batch).
analyze_ad_imageAnalyzes ad images for visual elements, text, colors, and composition (enhanced caching).
analyze_ad_videoAnalyzes a single ad video using Gemini AI for comprehensive insights (enhanced caching).
analyze_ad_videos_batchAnalyzes multiple videos in a single API call for token efficiency (~88% token savings).
get_cache_statsGets statistics about cached media (images and videos) and storage usage.
search_cached_mediaSearches previously analyzed media by brand, colors, people, or media type.
cleanup_media_cacheCleans up old cached media files to free disk space.
What this server can do
Facebook Ads Library MCP Server provides tools for these capabilities — tap one to see every MCP server that does the same:
When to use it
- See how many ads a brand is running and the split between video and image creative.
- Extract the messaging a brand is running right now across its ads.
- Analyze a brand's video ads for visual storytelling strategy, pacing, and brand messaging.
- Compare advertising strategies across competitors (ad volumes, messaging themes, creative approaches).
- Audit campaign strategies for a whole category (e.g. streaming services or soda brands) at once.
Security notes
Requires a ScrapeCreators API key (SCRAPECREATORS_API_KEY) and, optionally for video analysis, a Google Gemini API key (GEMINI_API_KEY). Keys are stored in a local .env file in the project root and loaded automatically at runtime — they are not passed on the command line. Only public Facebook Ads Library data is queried.
Facebook Ads Library MCP Server FAQ
Do I need to self-host?
No. Proxy (useproxy.dev) offers a fully hosted version of this MCP that works out of the box in ChatGPT, Claude, Manus, and other MCP clients with nothing to install or configure. Self-hosting via the steps above is optional.
What API keys do I need?
A ScrapeCreators API key (SCRAPECREATORS_API_KEY) is required for ads data. A Google Gemini API key (GEMINI_API_KEY) is optional and only needed for video ad analysis. Both are stored in a local .env file.
Which clients are supported for self-hosting?
The README documents an mcpServers config block for both Claude Desktop and Cursor; the server runs over stdio using the project's virtualenv Python.
What happens if my API credits run out?
The server surfaces an 'API credits exhausted' message with a direct link to your provider's dashboard and automatically resumes once credits are available. It also reports wait times when rate limits are hit.
Alternatives to Facebook Ads Library MCP Server
Compare all alternatives →Official MCP reference server that fetches a URL and returns its content as clean Markdown, with chunking.
Official Firecrawl MCP server — scrape, crawl, map, search, and structured extraction for any LLM client.
Exa's neural web search and crawling MCP server — runs locally via npx or as a hosted remote endpoint.
Compare Facebook Ads Library MCP Server with: