Facebook Ads Library
The Facebook Ads Library MCP Server connects Claude directly to Meta’s public advertising database through the Model Context Protocol.
It transforms Claude into a powerful advertising research tool that can search, analyze, and compare ad campaigns from any company or brand running Facebook advertisements.
Features
- π Company Ad Search – Find all active advertisements for any brand or company name
- π Campaign Analysis – Break down ad spend distribution between video and image formats
- π Messaging Extraction – Pull advertising copy and messaging strategies from live campaigns
- βοΈ Competitive Comparison – Side-by-side analysis of multiple brands’ advertising approaches
- π― Creative Intelligence – Access ad images, video links, and creative assets
- π Performance Insights – Understand what messaging and formats competitors are actively running
Use Cases
- Competitive Research: Marketing teams can monitor competitors’ advertising strategies, messaging shifts, and creative approaches without manual Facebook browsing
- Campaign Planning: Agencies can analyze successful ad formats and messaging from industry leaders before launching client campaigns
- Market Intelligence: Business analysts can track advertising trends across multiple companies to identify market positioning and messaging patterns
- Content Strategy: Creative teams can examine high-performing ad copy and visual styles to inform their own campaign development
How to Use It
1. You need Python 3.12 or higher, Claude Desktop (or Cursor), pip package manager, and a Scrape Creators API token.
2. Clone the Repository.
git clone https://github.com/trypeggy/facebook-ads-library-mcp.git
cd facebook-ads-library-mcp3. Sign up at Scrape Creators to obtain your API token.
4. Configure MCP Connection. Create a configuration file with your paths and API key:
- For Claude Desktop: Save as
claude_desktop_config.jsonin~/Library/Application Support/Claude/ - For Cursor: Save as
mcp.jsonin~/.cursor/
{
"mcpServers": {
"fb_ad_library": {
"command": "python",
"args": [
"{{PATH_TO_SRC}}/fb_ad_library_mcp/src/mcp_server.py",
"--scrapecreators-api-key",
"{{YOUR_SCRAPECREATORS_API_KEY}}"
]
}
}
}5. Restart Claude Desktop or Cursor. The Facebook Ads Library integration will appear in your available tools.
6. Available Tools
get_meta_platform_id: Converts brand names into Facebook platform IDsget_meta_ads: Retrieves all active advertisements for a specific platform ID
7. Usage Examples
How many ads is 'AnthropicAI' running? What's their split across video and image?What messaging is 'AnthropicAI' running right now in their ads?Do a deep comparison to the messaging between 'AnthropicAI', 'Perplexity AI' and 'OpenAI'. Give it a nice forwardable summary.FAQs
Q: Do I need a Facebook Business account to use this MCP server?
A: No Facebook account required. This server accesses Meta’s public ads library, which contains all political and issue advertisements plus commercial ads that companies choose to make transparent.
Q: What’s the cost structure for the Scrape Creators API?
A: Scrape Creators operates on a credit-based system. Check their pricing page for current rates, but basic usage for competitive research typically costs a few dollars per month.
Q: Can I access historical ad data or just current campaigns?
A: The Facebook Ads Library contains both active and recently ended campaigns. You can access ads that have run within the past several months, not just currently active ones.
Q: What happens if a company name matches multiple Facebook pages?
A: The get_meta_platform_id tool returns platform IDs for all matching pages. You can then specify which page’s ads you want to analyze based on follower count, verification status, or page description.
Q: Are there rate limits I should know about?
A: Yes, both the Scrape Creators API and Facebook’s ads library have rate limits. The MCP server handles basic rate limiting, but heavy usage may require request spacing or upgraded API plans.
Q: Can I download the actual ad images and videos?
A: The server provides direct links to ad creatives hosted on Facebook’s CDN. You can view and analyze the content, but downloading would need to respect Facebook’s terms of service.
Latest MCP Servers
Notion
Log Mcp
Apple
Featured MCP Servers
Notion
Claude Peers
Excalidraw
FAQs
Q: What exactly is the Model Context Protocol (MCP)?
A: MCP is an open standard, like a common language, that lets AI applications (clients) and external data sources or tools (servers) talk to each other. It helps AI models get the context (data, instructions, tools) they need from outside systems to give more accurate and relevant responses. Think of it as a universal adapter for AI connections.
Q: How is MCP different from OpenAI's function calling or plugins?
A: While OpenAI's tools allow models to use specific external functions, MCP is a broader, open standard. It covers not just tool use, but also providing structured data (Resources) and instruction templates (Prompts) as context. Being an open standard means it's not tied to one company's models or platform. OpenAI has even started adopting MCP in its Agents SDK.
Q: Can I use MCP with frameworks like LangChain?
A: Yes, MCP is designed to complement frameworks like LangChain or LlamaIndex. Instead of relying solely on custom connectors within these frameworks, you can use MCP as a standardized bridge to connect to various tools and data sources. There's potential for interoperability, like converting MCP tools into LangChain tools.
Q: Why was MCP created? What problem does it solve?
A: It was created because large language models often lack real-time information and connecting them to external data/tools required custom, complex integrations for each pair. MCP solves this by providing a standard way to connect, reducing development time, complexity, and cost, and enabling better interoperability between different AI models and tools.
Q: Is MCP secure? What are the main risks?
A: Security is a major consideration. While MCP includes principles like user consent and control, risks exist. These include potential server compromises leading to token theft, indirect prompt injection attacks, excessive permissions, context data leakage, session hijacking, and vulnerabilities in server implementations. Implementing robust security measures like OAuth 2.1, TLS, strict permissions, and monitoring is crucial.
Q: Who is behind MCP?
A: MCP was initially developed and open-sourced by Anthropic. However, it's an open standard with active contributions from the community, including companies like Microsoft and VMware Tanzu who maintain official SDKs.



