Meta Ads API MCP server

Provides a bridge to Facebook's Marketing API for analyzing ad campaigns, reviewing creatives, and monitoring metrics through secure OAuth authentication
Back to servers
Setup instructions
Provider
Yves Junqueira
Release date
Apr 12, 2025
Language
Python
Package
Stats
41.6K downloads
334 stars

The Meta Ads MCP server is a tool that lets you analyze, manage, and optimize Meta advertising campaigns (Facebook, Instagram, etc.) through an AI interface. It provides a way for language models to retrieve performance data, visualize ad creatives, and offer strategic insights for your Meta ads.

Getting Started with Remote MCP

The recommended way to use Meta Ads MCP is through the remote server, which requires no technical setup on your part.

For Claude Pro/Max Users

  1. Go to claude.ai/settings/integrations (requires Claude Pro or Max)
  2. Click "Add Integration" and enter:
    • Name: "Pipeboard Meta Ads" (or any name you prefer)
    • Integration URL: https://mcp.pipeboard.co/meta-ads-mcp
  3. Click "Connect" next to the integration and follow the prompts to:
    • Login to Pipeboard
    • Connect your Facebook Ads account

For Cursor Users

Add the following to your ~/.cursor/mcp.json. Once you enable the remote MCP, click on "Needs login" to finish the login process.

{
  "mcpServers": {
    "meta-ads-remote": {
      "url": "https://mcp.pipeboard.co/meta-ads-mcp"
    }
  }
}

For Other MCP Clients

Use the Remote MCP URL: https://mcp.pipeboard.co/meta-ads-mcp

Advanced: Direct Token Authentication

For direct token-based authentication without the interactive flow, append your Pipeboard token to the URL:

https://mcp.pipeboard.co/meta-ads-mcp?token=YOUR_PIPEBOARD_TOKEN

Get your token at pipeboard.co/api-tokens.

Available Tools

Meta Ads MCP provides numerous tools for interacting with your Meta ad accounts. Here are some of the key functions:

Account Management

  • Get Ad Accounts: Retrieve ad accounts accessible to you
  • Get Account Info: Obtain detailed information about a specific ad account
  • Get Account Pages: List pages associated with a Meta Ads account

Campaign Management

  • Get Campaigns: List campaigns for a Meta Ads account
  • Get Campaign Details: View detailed information about a specific campaign
  • Create Campaign: Create a new ad campaign

Ad Set Management

  • Get Ad Sets: List ad sets in your account
  • Get Ad Set Details: View detailed information about a specific ad set
  • Create/Update Ad Set: Create or modify ad sets with targeting options

Ad Management

  • Get Ads: List ads in your account
  • Get Ad Details: View detailed information about a specific ad
  • Create Ad: Create a new ad with an existing creative

Creative Management

  • Get Ad Creatives: Retrieve creative details for ads
  • Create Ad Creative: Create new ad creatives
  • Upload Ad Image: Upload images to use in your ads

Performance Analysis

  • Get Insights: Retrieve performance data for campaigns, ad sets, or ads
  • Get Ad Image: Visualize ad images for analysis

Targeting Tools

  • Search Interests: Find interest targeting options
  • Get Interest Suggestions: Get suggested interests based on existing ones
  • Validate Interests: Check if interest names/IDs are valid
  • Search Behaviors: Get behavior targeting options
  • Search Demographics: Find demographic targeting options
  • Search Geo Locations: Search for geographic targeting locations

Usage Examples

Basic Account Information

To get information about your ad accounts:

# Get your accessible ad accounts
accounts = mcp_meta_ads_get_ad_accounts(user_id="me", limit=10)

# Get detailed information about a specific account
account_details = mcp_meta_ads_get_account_info(account_id="act_XXXXXXXXX")

Campaign Analysis

To analyze campaign performance:

# Get your campaigns
campaigns = mcp_meta_ads_get_campaigns(account_id="act_XXXXXXXXX", limit=10)

# Get detailed insights for a specific campaign
insights = mcp_meta_ads_get_insights(
    object_id="23851234567890", 
    level="campaign",
    time_range="maximum"
)

Creating a New Campaign

To create a new ad campaign:

# Create a new awareness campaign
campaign = mcp_meta_ads_create_campaign(
    account_id="act_XXXXXXXXX",
    name="2025 - Bedroom Furniture - Awareness",
    objective="OUTCOME_AWARENESS",
    status="PAUSED",
    daily_budget=10000,  # $100.00 (in cents)
    bid_strategy="LOWEST_COST_WITHOUT_CAP"
)

Targeting Research

To find targeting options for your ads:

# Search for interests related to travel
travel_interests = mcp_meta_ads_search_interests(query="travel", limit=25)

# Find demographic targeting options
demographics = mcp_meta_ads_search_demographics(demographic_class="income", limit=20)

# Search for geographic locations
locations = mcp_meta_ads_search_geo_locations(
    query="New York", 
    location_types=["city", "region"]
)

Troubleshooting

If you encounter issues with Meta Ads MCP:

  1. Check Authentication: Ensure you've properly connected to your Meta Ads account
  2. Verify Permissions: Confirm you have the necessary permissions to access the Meta Ads accounts
  3. Try Remote MCP: If you're having technical difficulties with local installation, use the remote MCP at pipeboard.co

For further assistance, you can:

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "meta-ads-remote" '{"command":"npx","args":["mcp-remote","https://mcp.pipeboard.co/meta-ads-mcp"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "meta-ads-remote": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.pipeboard.co/meta-ads-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "meta-ads-remote": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.pipeboard.co/meta-ads-mcp"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later