Manage Facebook and Instagram advertising data through the Meta Marketing API.
Meta Marketing API MCP Server
A comprehensive Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with Facebook/Instagram advertising data through the Meta Marketing API. This server provides full campaign lifecycle management, analytics, audience targeting, and creative optimization capabilities.
โก Quick Start
1) Install
npm install -g meta-ads-mcp
2) Configure (Claude Desktop / Cursor)
Create or edit your MCP config:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Minimal config:
{
"mcpServers": {
"meta-ads": {
"command": "npx",
"args": ["-y", "meta-ads-mcp"],
"env": {
"META_ACCESS_TOKEN": "your_access_token_here"
}
}
}
}
If your app requires appsecret_proof, add META_APP_SECRET:
{
"mcpServers": {
"meta-ads": {
"command": "npx",
"args": ["-y", "meta-ads-mcp"],
"env": {
"META_ACCESS_TOKEN": "your_access_token_here",
"META_APP_SECRET": "your_app_secret"
}
}
}
}
3) Restart your client
- Claude Desktop: quit and reopen
- Cursor: restart the IDE
4) Verify
npm run health-check
๐ Features
**Campaign Management**
- โ Create, update, pause, resume, and delete campaigns
- โ Support for all campaign objectives (traffic, conversions, awareness, etc.)
- โ Budget management and scheduling
- โ Ad set creation with advanced targeting
- โ Individual ad management
**Analytics & Reporting**
- ๐ Performance insights with customizable date ranges
- ๐ Multi-object performance comparison
- ๐ Data export in CSV/JSON formats
- ๐ฏ Attribution modeling and conversion tracking
- ๐ Daily performance trends analysis
**Audience Management**
- ๐ฅ Custom audience creation and management
- ๐ฏ Lookalike audience generation
- ๐ Audience size estimation
- ๐ Targeting recommendations and insights
- ๐ฅ Audience health monitoring
**Creative Management**
- ๐จ Ad creative creation and management
- ๐๏ธ Cross-platform ad previews
- ๐งช A/B testing setup and guidance
- ๐ธ Creative performance analysis
**Enterprise Features**
- ๐ Secure OAuth 2.0 authentication
- โก Automatic rate limiting with exponential backoff
- ๐ Pagination support for large datasets
- ๐ก๏ธ Comprehensive error handling
- ๐ Rich MCP resources for contextual data access
- ๐ Multi-account support
๐ฆ Installation & Setup
Option 1: Direct Installation (Recommended)
npm install -g meta-ads-mcp
Option 2: From Source
git clone https://github.com/wipsoft/meta-mcp.git
cd meta-ads-mcp
npm install
npm run build
Option 3: Automated Setup (Easiest)
# Clone the repository first
git clone https://github.com/wipsoft/meta-mcp.git
cd meta-ads-mcp
# Run the interactive setup
npm run setup
The setup script will:
- โ Check system requirements
- โ Validate your Meta access token
- โ Create Claude Desktop configuration
- โ Install dependencies
- โ Test the connection
๐ง Configuration Guide
Step 1: Get Meta Access Token
- Create a Meta App at developers.facebook.com
- Add Marketing API product
- Generate an access token with
ads_readandads_managementpermissions - If your app requires
appsecret_proof, setMETA_APP_SECRET(see below) - (Optional) Set up OAuth for automatic token refresh
Step 2: Configure Claude Desktop
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
If the file doesn't exist, create it with the following content:
Basic Configuration (Token-based):
{
"mcpServers": {
"meta-ads": {
"command": "npx",
"args": ["-y", "meta-ads-mcp"],
"env": {
"META_ACCESS_TOKEN": "your_access_token_here"
}
}
}
}
Advanced Configuration (with OAuth + appsecret_proof):
{
"mcpServers": {
"meta-ads": {
"command": "npx",
"args": ["-y", "meta-ads-mcp"],
"env": {
"META_ACCESS_TOKEN": "your_access_token_here",
"META_APP_ID": "your_app_id",
"META_APP_SECRET": "your_app_secret",
"META_AUTO_REFRESH": "true",
"META_BUSINESS_ID": "your_business_id"
}
}
}
}
Local Development Configuration:
If you've cloned the repository locally:
{
"mcpServers": {
"meta-ads": {
"command": "node",
"args": ["/absolute/path/to/meta-ads-mcp/build/index.js"],
"env": {
"META_ACCESS_TOKEN": "your_access_token_here"
}
Tools (4)
campaign_managementCreate, update, pause, resume, and delete advertising campaigns.analytics_reportingRetrieve performance insights and daily trends with customizable date ranges.audience_managementCreate and manage custom audiences, lookalike audiences, and estimate audience sizes.creative_managementManage ad creatives and set up A/B testing.Environment Variables
META_ACCESS_TOKENrequiredAccess token with ads_read and ads_management permissionsMETA_APP_SECRETApp secret for appsecret_proof validationMETA_APP_IDMeta application IDMETA_BUSINESS_IDMeta business account IDMETA_AUTO_REFRESHEnable automatic token refreshConfiguration
{"mcpServers": {"meta-ads": {"command": "npx", "args": ["-y", "meta-ads-mcp"], "env": {"META_ACCESS_TOKEN": "your_access_token_here"}}}}