Skip to main content
Glama

Facebook Ads Library MCP Server

by trypeggy

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.

https://github.com/user-attachments/assets/a47aa689-e89d-4d4b-9df7-6eb3a81937ee

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

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 CreatorsSign up here
  3. Connect to the MCP serverCopy 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
  4. Restart Claude Desktop / CursorOpen 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

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Enables searching and analyzing Facebook's public ads library to see what companies are currently running, including ad images/text, video links, and campaign insights.

  1. Example Prompts
    1. Installation
      1. Prerequisites
      2. Steps
    2. Technical Details
      1. Available MCP Tools
    3. Troubleshooting
      1. Feedback
        1. License

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            Enables searching for Airbnb listings and retrieving detailed accommodation information with direct links to Airbnb pages.
            Last updated -
            2
            JavaScript
            MIT License
          • -
            security
            F
            license
            -
            quality
            Enables searching for AI agents by keywords or categories, allowing users to discover tools like coding agents, GUI agents, or industry-specific assistants across marketplaces.
            Last updated -
            23
            Python
            • Apple
          • -
            security
            A
            license
            -
            quality
            MCP server acting as an interface to the Facebook Ads, enabling programmatic access to Facebook Ads data and management features.
            Last updated -
            54
            Python
            MIT License
            • Apple
            • Linux
          • A
            security
            A
            license
            A
            quality
            Enables interaction with the French business search API from data.gouv.fr, allowing users to search for French companies by text or geographical criteria and access essential business information.
            Last updated -
            2
            307
            4
            TypeScript
            MIT License

          View all related MCP servers

          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/trypeggy/facebook-ads-library-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server