Facebook Ads Library

Get any answer from the Facebook Ads Library, conduct deep research including messaging, creative testing and comparisons in seconds.

{{ message }}

trypeggy / facebook-ads-library-mcp Public

  • Notifications
  • Fork2
  • Star 83

MCP Server for Facebook ADs Library - Get instant answers from FB's ad library

trypeggy.ai/

MIT license

83 stars2 forksBranches Tags Activity

Star

Notifications

main

BranchesTags

Go to file

Code

NameNameLast commit messageLast commit date
14 Commits
srcsrc
.gitignore.gitignore
DockerfileDockerfile
LICENSELICENSE
readme.mdreadme.md
requirements.txtrequirements.txt
smithery.yamlsmithery.yaml
View all files

Repository files navigation

Facebook Ads Library MCP Server

This is a Model Context Protocol (MCP) server for the Facebook Ads Library.

With this you can search Facebook's public ads library for any company or brand, see what they're currently running and analyze their advertising. You can analyse ad images/text, get video links, compare companies' strategies, and get insights into what's working in their campaigns.

Here's an example of what you can do when it's connected to Claude.

MCP.demo.mp4

To get updates on this and other projects we work on enter your email here


Example Prompts

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.

Don't want to deal with code? Try our no-code version


Installation

Installing via Smithery

To install Facebook Ads Library for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @trypeggy/facebook-ads-library-mcp --client claude

Prerequisites

  • Python 3.12+
  • Anthropic Claude Desktop app (or Cursor)
  • Pip (Python package manager), install with python -m pip install
  • An access token for Scrape Creators

Steps

  1. Clone this repository
    git clone https://github.com/trypeggy/facebook-ads-library-mcp.git
    cd facebook-ads-library-mcp
  2. Obtain an API token from Scrape Creators
    Sign up here
  3. Connect to the MCP server
    Copy the below json with the appropriate {{PATH}} values and {{API KEY}}:
    {
    "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}}"
    ]
    }
    }
    }
    For Claude Desktop:
    Save this as claude_desktop_config.json in your Claude Desktop configuration directory at:
~/Library/Application Support/Claude/claude_desktop_config.json  

For Cursor:
Save this as mcp.json in your Cursor configuration directory at:

~/.cursor/mcp.json  
  1. Restart Claude Desktop / Cursor
    Open Claude Desktop and you should now see the Facebook Ads Library as an available integration.
    Or restart Cursor.

Technical Details

  1. Claude sends requests to the Python MCP server
  2. The MCP server queries the ScrapeCreator API through tools
  3. Data flows back through the chain to Claude

Available MCP Tools

This MCP server provides tools for interacting with Facebook Ads library objects:

Tool NameDescription
get_meta_platform_idReturns platform ID given one or many brand names
get_meta_adsRetrieves ads for a specific page (platform ID)

Troubleshooting

For additional Claude Desktop integration troubleshooting, see the MCP documentation. The documentation includes helpful tips for checking logs and resolving common issues.


Feedback

Your feedback will be massively appreciated. Please tell us which features on that list you like to see next or request entirely new ones.


License

This project is licensed under the MIT License.

License Python smithery badge

About

trypeggy.ai/

github python api open-source marketing facebook ai analytics marketing-automation mcp python3 facebook-api marketing-analytics llm mcp-server

Readme

MIT license

Activity

Custom properties

83 stars

1 watching

2 forks

Report repository

Releases

No releases published

Packages

No packages published

Contributors3

Languages

  • Python 93.3%
  • Dockerfile 6.7%

Related Servers