Facebook/Meta Ads MCP Server

Facebook/Meta Ads MCP Server

MCP server interface for secure, programmatic Meta Ads data and management.

183
Stars
47
Forks
183
Watchers
1
Issues
Enables seamless integration between Model Context Protocol (MCP) clients and Meta (Facebook) Ads API, providing tools for programmatic data access and campaign management. Simplifies local installation with automated environment setup and optional secure authentication, eliminating the need for manual token retrieval. Designed for use with popular MCP clients such as Claude Desktop, offering plug-and-play connectivity. Data and tokens remain local for privacy and security.

Key Features

Local MCP server installation for Meta Ads integration
Programmatic access to Meta Ads data
Automated environment and dependency setup
Optional secure authentication via GoMarble's server
Supports MCP clients like Claude Desktop
Environment isolation with virtual environments
No manual token retrieval required
Sensitive tokens remain stored locally
Cross-platform Python support (3.10+)
Tools for Meta Ads campaign and data management

Use Cases

Automating Meta Ads campaign data retrieval
Securely managing Facebook advertising credentials
Integrating Meta Ads insights into business intelligence tools
Enhancing AI assistants with contextual Meta Ads data
Enabling marketing analytics workflows for agencies
Streamlining reporting for digital marketers
Building dashboards that visualize ad performance
Facilitating hands-free Meta Ads campaign management
Syncing ad data with CRM systems
Supporting A/B testing and campaign optimization workflows

README

Facebook/Meta Ads MCP Server

Trust Score smithery badge

This project provides an MCP server acting as an interface to the Meta Ads, enabling programmatic access to Meta Ads data and management features.

Your browser does not support the video tag.

Easy One-Click Setup

For a simpler setup experience, we offer ready-to-use installers:

👉 Download installer - https://gomarble.ai/mcp

Join our community for help and updates

👉 Slack Community - AI in Ads

Try Google ads mcp server also

👉 Google Ads MCP - Google Ads MCP

What It Does

  • Installs and configures the MCP server locally
  • Automatically handles environment setup
  • Prompts for Meta token authentication during the process which is optional
  • If Meta access token is not provided then connect to GoMarble's server to create the token on your behalf

Important Disclaimer

This setup does not require you to manually obtain a Meta Developer Access Token.

Instead, it connects securely to GoMarble's server to create the token on your behalf. GoMarble does not store your token — it is saved locally on your machine for use with the MCP server.


Setup

Prerequisites

  • Python 3.10+
  • Dependencies listed in requirements.txt
  1. (Optional but Recommended) Create and Activate a Virtual Environment:

    bash
    python3 -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    

    Using a virtual environment helps manage project dependencies cleanly[Source].

  2. Install Dependencies:

    bash
    pip install -r requirements.txt
    
  3. Obtain Meta Access Token: Secure a Meta User Access Token with the necessary permissions (e.g., ads_read). You can generate this through the Meta Developer portal. Follow this link.

Usage with MCP Clients (e.g., Cursor, Claude Desktop)

To integrate this server with an MCP-compatible client, add a configuration(Claude) similar to the following. Replace YOUR_META_ACCESS_TOKEN with your actual token and adjust the path to server.py if necessary.

json
{
  "mcpServers": {
    "fb-ads-mcp-server": {
      "command": "python",
      "args": [
        "/path/to/your/fb-ads-mcp-server/server.py",
        "--fb-token",
        "YOUR_META_ACCESS_TOKEN"
      ]
      // If using a virtual environment, you might need to specify the python executable within the venv:
      // "command": "/path/to/your/fb-ads-mcp-server/venv/bin/python",
      // "args": [
      //   "/path/to/your/fb-ads-mcp-server/server.py",
      //   "--fb-token",
      //   "YOUR_META_ACCESS_TOKEN"
      // ]
    }
  }
}

Restart the MCP Client app after making the update in the configuration.

(Note: On Windows, you might need to adjust the command structure or use cmd /k depending on your setup.)

Debugging the Server

Execute server.py, providing the access token via the --fb-token argument.

bash
python server.py --fb-token YOUR_META_ACCESS_TOKEN

Available MCP Tools

This MCP server provides tools for interacting with META Ads objects and data:

Tool Name Description
Account & Object Read
list_ad_accounts Lists ad accounts linked to the token.
get_details_of_ad_account Retrieves details for a specific ad account.
get_campaign_by_id Retrieves details for a specific campaign.
get_adset_by_id Retrieves details for a specific ad set.
get_ad_by_id Retrieves details for a specific ad.
get_ad_creative_by_id Retrieves details for a specific ad creative.
get_adsets_by_ids Retrieves details for multiple ad sets by their IDs.
Fetching Collections
get_campaigns_by_adaccount Retrieves campaigns within an ad account.
get_adsets_by_adaccount Retrieves ad sets within an ad account.
get_ads_by_adaccount Retrieves ads within an ad account.
get_adsets_by_campaign Retrieves ad sets within a campaign.
get_ads_by_campaign Retrieves ads within a campaign.
get_ads_by_adset Retrieves ads within an ad set.
get_ad_creatives_by_ad_id Retrieves creatives associated with an ad.
Insights & Performance Data
get_adaccount_insights Retrieves performance insights for an ad account.
get_campaign_insights Retrieves performance insights for a campaign.
get_adset_insights Retrieves performance insights for an ad set.
get_ad_insights Retrieves performance insights for an ad.
fetch_pagination_url Fetches data from a pagination URL (e.g., from insights).
Activity/Change History
get_activities_by_adaccount Retrieves change history for an ad account.
get_activities_by_adset Retrieves change history for an ad set.

(Note: Most tools support additional parameters like fields, filtering, limit, pagination, date ranges, etc. Refer to the detailed docstrings within server.py for the full list and description of arguments for each tool.)

(Note: If your Meta access token expires, you'll need to generate a new one and update the configuration file of the MCP Client with new token to continue using the tools.)

Dependencies

License

This project is licensed under the MIT License.


Installing via Smithery

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

bash
npx -y @smithery/cli install @gomarble-ai/facebook-ads-mcp-server --client claude

Star History

Star History Chart

Repository Owner

gomarble-ai
gomarble-ai

Organization

Repository Details

Language Python
Default Branch main
Size 123,014 KB
Contributors 5
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Python
99.55%
Dockerfile
0.45%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Meta Ads MCP

    Meta Ads MCP

    AI-powered Meta Ads campaign analysis and management via MCP

    Meta Ads MCP is a Model Context Protocol (MCP) server for managing, analyzing, and optimizing Meta advertising campaigns. It enables AI interfaces, such as LLMs, to retrieve ad performance data, visualize creatives, and provide strategic insights across Facebook, Instagram, and related platforms. The solution supports integration with platforms like Claude and Cursor, leveraging Meta's public APIs to deliver actionable insights and campaign management capabilities. Authentication options include interactive login and token-based flows for various MCP clients.

    • 342
    • MCP
    • pipeboard-co/meta-ads-mcp
  • Google Ads MCP Server

    Google Ads MCP Server

    Seamlessly connect Google Ads API to MCP clients with automatic authentication and querying.

    Google Ads MCP Server is a FastMCP-powered Model Context Protocol server designed to integrate Google Ads API with MCP clients such as Claude Desktop. It provides automatic OAuth 2.0 authentication, smart token management, GAQL query execution, and keyword research tools. The server enables users to manage accounts, run advanced queries, and generate keyword ideas while maintaining secure local token storage. Optimized for one-click setup, it offers robust features for advertisers and developers looking to leverage Google Ads data with MCP-compatible tools.

    • 76
    • MCP
    • gomarble-ai/google-ads-mcp-server
  • Tripadvisor MCP Server

    Tripadvisor MCP Server

    Standardized MCP access to Tripadvisor travel data for AI assistants

    Tripadvisor MCP Server provides Model Context Protocol (MCP) compliant access to Tripadvisor's Content API, enabling AI assistants to search, retrieve, and present travel-related information in a standardized way. It features endpoints for searching locations, accessing detailed information, reviews, and photos, as well as secure API key authentication. The project supports Docker containerization and interactive tools for customizable AI integration.

    • 47
    • MCP
    • pab1it0/tripadvisor-mcp
  • Dappier MCP Server

    Dappier MCP Server

    Real-time web search and premium data access for AI agents via Model Context Protocol.

    Dappier MCP Server enables fast, real-time web search and access to premium data sources, including news, financial markets, sports, and weather, for AI agents using the Model Context Protocol (MCP). It integrates seamlessly with tools like Claude Desktop and Cursor, allowing users to enhance their AI workflows with up-to-date, trusted information. Simple installation and configuration are provided for multiple platforms, leveraging API keys for secure access. The solution supports deployment via Smithery and direct installation with 'uv', facilitating rapid setup for developers.

    • 35
    • MCP
    • DappierAI/dappier-mcp
  • amazon-ads-mcp-server

    amazon-ads-mcp-server

    Stream Amazon Advertising data into MCP-compatible AI clients.

    amazon-ads-mcp-server enables seamless integration of Amazon Advertising data—including campaigns, keywords, reports, and more—into any Model Context Protocol (MCP) compatible client. It provides both local and HTTP-based MCP server implementations for usage across desktops and platforms such as Claude Desktop and LibreChat. With support for plain English querying of reports and enhanced features like recommendations and experiments (with subscription), the tool facilitates streamlined access and interaction with Amazon Ads data for model-based workflows.

    • 18
    • MCP
    • MarketplaceAdPros/amazon-ads-mcp-server
  • Stape MCP Server

    Stape MCP Server

    An MCP server implementation for integrating Stape with AI model context protocols.

    Stape MCP Server provides an implementation of the Model Context Protocol server tailored for the Stape platform. It enables secure and standardized access to model context capabilities, allowing integration with tools such as Claude Desktop and Cursor AI. Users can easily configure and authenticate MCP connections using provided configuration samples, while managing context and credentials securely. The server is open source and maintained by the Stape Team under the Apache 2.0 license.

    • 4
    • MCP
    • stape-io/stape-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results