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
8.8K downloads
137 stars

The Meta Ads MCP server provides a standardized interface that allows AI models to interact with Meta's advertising platforms, enabling access to campaign data, creative assets, and performance insights for Facebook and Instagram ads.

Installation Options

Remote MCP Setup (Recommended)

For Claude Pro/Max Users

  1. Navigate to claude.ai/settings/integrations
  2. Click "Add Integration" and enter:
    • Name: "Pipeboard Meta Ads" (or your preferred name)
    • Integration URL: https://mcp.pipeboard.co/meta-ads-mcp
  3. Click "Connect" and follow the prompts to:
    • Login to Pipeboard
    • Connect your Facebook Ads account

For Cursor Users

Add this to your ~/.cursor/mcp.json file:

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

For Other MCP Clients

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

Local Installation (Technical Users)

# Install via uvx (recommended)
uvx meta-ads-mcp

# Set your Pipeboard token
export PIPEBOARD_API_TOKEN=your_pipeboard_token

Using Meta Ads MCP

Available Tools

The server provides numerous tools for interacting with Meta Ads. Here are some key ones:

Account Management

  • Get Ad Accounts: mcp_meta_ads_get_ad_accounts

    Inputs: user_id (or "me"), limit (default: 10)
    Returns: List of accessible ad accounts
    
  • Get Account Info: mcp_meta_ads_get_account_info

    Inputs: account_id (format: act_XXXXXXXXX)
    Returns: Detailed account information
    

Campaign Management

  • Get Campaigns: mcp_meta_ads_get_campaigns

    Inputs: account_id, limit (default: 10), status_filter (optional)
    Returns: List of campaigns
    
  • Create Campaign: mcp_meta_ads_create_campaign

    Inputs: account_id, name, objective, status, budget parameters
    Returns: New campaign details
    
  • Get Campaign Details: mcp_meta_ads_get_campaign_details

    Inputs: campaign_id
    Returns: Detailed campaign information
    

Ad Set Management

  • Get Ad Sets: mcp_meta_ads_get_adsets

    Inputs: account_id, limit, campaign_id (optional)
    Returns: List of ad sets
    
  • Create Ad Set: mcp_meta_ads_create_adset

    Inputs: account_id, campaign_id, name, targeting, budget parameters
    Returns: New ad set details
    

Ad Management

  • Get Ads: mcp_meta_ads_get_ads

    Inputs: account_id, limit, campaign_id/adset_id (optional filters)
    Returns: List of ads
    
  • Create Ad: mcp_meta_ads_create_ad

    Inputs: account_id, name, adset_id, creative_id
    Returns: New ad details
    
  • Get Ad Image: mcp_meta_ads_get_ad_image

    Inputs: ad_id
    Returns: Visual representation of the ad image
    

Performance Analysis

  • Get Insights: mcp_meta_ads_get_insights
    Inputs: object_id, time_range, breakdown, level
    Returns: Performance metrics
    

Example Usage Scenarios

Analyzing Campaign Performance

  1. Get a list of your ad accounts:

    Use mcp_meta_ads_get_ad_accounts with user_id="me"
    
  2. View campaigns for a specific account:

    Use mcp_meta_ads_get_campaigns with account_id="act_XXXXXXXXX"
    
  3. Analyze performance metrics:

    Use mcp_meta_ads_get_insights with object_id="<campaign_id>" and level="campaign"
    

Creating a New Ad Campaign

  1. Create a new campaign:

    Use mcp_meta_ads_create_campaign with account_id, name, objective, etc.
    
  2. Create an ad set within the campaign:

    Use mcp_meta_ads_create_adset with campaign_id, targeting parameters
    
  3. Upload an image for your ad:

    Use mcp_meta_ads_upload_ad_image with account_id and image_path
    
  4. Create an ad creative:

    Use mcp_meta_ads_create_ad_creative with image_hash and messaging
    
  5. Create the ad:

    Use mcp_meta_ads_create_ad with adset_id and creative_id
    

Troubleshooting

If you encounter issues with your Meta Ads MCP connection:

  1. Verify authentication by trying mcp_meta_ads_get_ad_accounts
  2. Use mcp_meta_ads_get_login_link to get a fresh authentication link
  3. For image download issues, run mcp_meta_ads_debug_image_download

For the simplest experience without technical setup, use the Remote MCP instead of local installation.

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