Skip to main content

Adiffy Meta Ads MCP Server — Model Context Protocol server for Meta Ads API

Project description

Adiffy Meta Ads MCP Server

Model Context Protocol (MCP) server for Meta Ads API

Provides 29+ tools for managing Meta (Facebook/Instagram) advertising campaigns through any MCP-compatible client.

Features

  • Account Management — List ad accounts, get account details
  • Campaign Operations — Create, read, update campaigns
  • Ad Set Management — Manage targeting, budgets, schedules
  • Ad Management — Create/edit ads with creatives
  • Insights & Reporting — Performance metrics with breakdowns
  • Targeting — Interest search, audience estimation, demographics
  • Creative Management — Preview ad creatives and images
  • Budget Schedules — Automated budget management
  • Ads Library — Search Meta's Ad Library

Quick Start

Prerequisites

  • Python 3.10+
  • Meta App credentials (META_APP_ID, META_APP_SECRET)
  • Meta API access token (META_ACCESS_TOKEN)

Environment Variables

# Required
export META_APP_ID="your_meta_app_id"
export META_APP_SECRET="your_meta_app_secret"
export META_ACCESS_TOKEN="your_access_token"

# Optional
export META_ADS_ENABLE_REPORTS="1"          # Enable report generation
export META_ADS_DISABLE_CALLBACK_SERVER="1" # Disable local OAuth server
export META_ADS_DISABLE_LOGIN_LINK="1"      # Disable login link tool

Installation

# Install with pip
pip install -e .

# Or with uv
uv pip install -e .

Running

# Default: stdio transport (for MCP clients like Claude Desktop)
adiffy-meta-ads-mcp

# HTTP transport (for web integrations)
adiffy-meta-ads-mcp --transport streamable-http --port 8080

# Login only
adiffy-meta-ads-mcp --login

Docker

docker build -t adiffy-meta-ads-mcp .
docker run -e META_APP_ID="..." -e META_APP_SECRET="..." -e META_ACCESS_TOKEN="..." adiffy-meta-ads-mcp

MCP Client Configuration

Add to your MCP client config (e.g., mcp_config.json):

{
  "meta-ads": {
    "command": "adiffy-meta-ads-mcp",
    "env": {
      "META_APP_ID": "your_app_id",
      "META_APP_SECRET": "your_app_secret",
      "META_ACCESS_TOKEN": "your_token"
    }
  }
}

Available Tools

Tool Description
get_ad_accounts List all accessible ad accounts
get_account_info Get details for a specific account
get_campaigns List campaigns with filtering
get_campaign_details Get campaign details and metrics
create_campaign Create a new campaign
get_adsets List ad sets with filtering
get_adset_details Get ad set details
update_adset Update ad set settings
get_ads List ads with filtering
get_ad_details Get ad details
get_ad_creatives Get creative details for ads
get_creative_details Get specific creative details
get_ad_image Download ad creative images
update_ad Update ad settings
get_insights Get performance insights
search_interests Search for targeting interests
get_interest_suggestions Get interest suggestions
estimate_audience_size Estimate target audience size
search_behaviors Search targeting behaviors
search_demographics Search demographics
search_geo_locations Search geographic locations
create_budget_schedule Create budget schedules
get_login_link Start OAuth authentication
search OpenAI deep research search
fetch OpenAI deep research fetch

Authentication

The server supports two authentication modes:

  1. Direct Token (recommended for production): Set META_ACCESS_TOKEN environment variable
  2. Local OAuth (for development): Uses a local callback server to handle the Meta OAuth flow

License

MIT License — see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adiffy_meta_ads_mcp-1.0.0.tar.gz (229.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adiffy_meta_ads_mcp-1.0.0-py3-none-any.whl (78.5 kB view details)

Uploaded Python 3

File details

Details for the file adiffy_meta_ads_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: adiffy_meta_ads_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 229.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for adiffy_meta_ads_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c6e58cda6aff656a70bc94c3e6a8ad4d43e6ebc4eaf9e962fc00c10bb85c8cac
MD5 5ce14494d2beee1f1c821d03cb92878b
BLAKE2b-256 d658f13b7cd2b2ab519d97b4b3f08db231c57a27fd62496b71894f4cad322490

See more details on using hashes here.

File details

Details for the file adiffy_meta_ads_mcp-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for adiffy_meta_ads_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9abb3faa0b4dd706bf087886ce3a31a917b5bb1c606c24523c9a39eeffc38854
MD5 d539065eafb756b5441697e96f5eb83f
BLAKE2b-256 14c7940c1c09cbf6e4bdceaaeddcf915820bda50094d3ba98b26dd435857bd06

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page