Facebook Ads

v1.0.0Marketing & SEOstable

Connects AI assistants to Facebook's Ads API to enable natural language queries for campaign data, insights, and performance metrics. It allows users to manage ad accounts and retrieve detailed analytics like impressions, clicks, and spend through MC

facebook-ads-mcp-servermcpai-integration
Share:
326
Stars
0
Downloads
0
Weekly
0/5

What is Facebook Ads?

Facebook Ads is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to connects ai assistants to facebook's ads api to enable natural language queries for campaign data, insights, and performance metrics. it allows users to manage ad accounts and retrieve detailed analyt...

Connects AI assistants to Facebook's Ads API to enable natural language queries for campaign data, insights, and performance metrics. It allows users to manage ad accounts and retrieve detailed analytics like impressions, clicks, and spend through MC

This server falls under the Marketing & SEO category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Connects AI assistants to Facebook's Ads API to enable natur

Use Cases

Query Facebook Ad campaigns.
Retrieve ad performance metrics.
Analyze campaign insights.
gomarble-ai

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx facebook-ads-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Facebook Ads

The Facebook Ads MCP Server connects AI assistants to Meta's Ads API through fourteen structured tools that cover ad account management, campaign and ad set retrieval, individual ad and creative lookup, performance insights at every level of the campaign hierarchy, and activity history. Authenticated via a Meta User Access Token with ads_read permission, it allows natural language queries like 'show me last week's spend by campaign' or 'which ad creatives had the highest CTR this month' without writing any API code. Marketing analysts and growth teams use it to speed up reporting, monitor campaign performance in real time, and let AI identify optimization opportunities across their Facebook ad accounts.

Prerequisites

  • Python 3.8 or higher with pip
  • A Meta (Facebook) developer account with an app that has the ads_read permission
  • A Meta User Access Token with ads_read scope — generate one at https://developers.facebook.com/tools/explorer/
  • An MCP-compatible client such as Claude Desktop
1

Clone the repository

Download the Facebook Ads MCP Server source code from GitHub.

git clone https://github.com/gomarble-ai/facebook-ads-mcp-server.git
cd facebook-ads-mcp-server
2

Create a virtual environment and install dependencies

Isolate the server's Python dependencies in a virtual environment before installing from requirements.txt.

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
3

Obtain a Meta User Access Token

Go to https://developers.facebook.com/tools/explorer/, select your app, add the ads_read permission, and generate a token. Copy the token — it will be passed as a command-line argument. The token is stored locally only and is not sent anywhere except the Meta API.

4

Test the server manually

Run the server directly with your token to confirm it starts without errors before wiring it to Claude Desktop.

python server.py --fb-token YOUR_META_ACCESS_TOKEN
5

Add the server to Claude Desktop configuration

Edit claude_desktop_config.json to launch the server via the virtual environment's Python binary, passing your token as an argument. Use the absolute paths to the Python binary and server.py.

{
  "mcpServers": {
    "facebook-ads": {
      "command": "/path/to/facebook-ads-mcp-server/venv/bin/python",
      "args": [
        "/path/to/facebook-ads-mcp-server/server.py",
        "--fb-token",
        "YOUR_META_ACCESS_TOKEN"
      ]
    }
  }
}

Facebook Ads Examples

Client configuration

Claude Desktop configuration using the local virtual environment to run the Facebook Ads MCP Server with a Meta access token.

{
  "mcpServers": {
    "facebook-ads": {
      "command": "/Users/yourname/facebook-ads-mcp-server/venv/bin/python",
      "args": [
        "/Users/yourname/facebook-ads-mcp-server/server.py",
        "--fb-token",
        "EAAxxxxxxxxxxxxxxxxx"
      ]
    }
  }
}

Prompts to try

Example prompts using the Facebook Ads MCP Server's campaign and insight tools.

- "List all my Facebook ad accounts and show their spend limits."
- "Get all campaigns in ad account act_123456789 and show their status and budget."
- "Show me last week's performance insights for campaign ID 987654321 — impressions, clicks, and CPM."
- "Which ad creative had the highest click-through rate in my top campaign this month?"
- "Get the activity log for ad account act_123456789 from the past 7 days."

Troubleshooting Facebook Ads

Error: Invalid OAuth access token — permissions missing

Regenerate your token in the Meta Graph API Explorer and explicitly add the ads_read permission before generating. Long-lived tokens expire — generate a new one if the existing token is older than 60 days.

list_ad_accounts returns an empty list

Ensure the Facebook account associated with your token has access to at least one ad account. Business Manager admins can grant access at business.facebook.com. The token must belong to a user who is listed as an admin or advertiser on the ad account.

Server starts but get_campaign_insights returns no data for a date range

Facebook Ads insights may have a processing delay of up to 48 hours. Try a date range ending two days before today. Also confirm the campaign was active during the specified period using get_campaigns_by_adaccount first.

Frequently Asked Questions about Facebook Ads

What is Facebook Ads?

Facebook Ads is a Model Context Protocol (MCP) server that connects ai assistants to facebook's ads api to enable natural language queries for campaign data, insights, and performance metrics. it allows users to manage ad accounts and retrieve detailed analytics like impressions, clicks, and spend through mc It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Facebook Ads?

Follow the installation instructions on the Facebook Ads GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Facebook Ads?

Facebook Ads works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Facebook Ads free to use?

Yes, Facebook Ads is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Marketing & SEO MCP Servers

Explore all marketing & seo servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "facebook-ads-mcp-server": { "command": "npx", "args": ["-y", "facebook-ads-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Facebook Ads?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides