# meta-ads

Connects the Meta Marketing API to an AI coding agent for Facebook and Instagram campaigns, audiences, creatives, insights, and catalogs.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 91
- Author: mikusnuz
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/mikusnuz/meta-ads-mcp
- Updated: 2026-10-19
- HTML: https://affpapa.org/en/nevibecode/mcp/meta-ads

## What it does

meta-ads connects Claude Code to Meta Marketing API v26.0. The server exposes 134 tools for campaigns, ad sets, ads, audiences, creatives, insights, and catalogs. An agent can create campaign assets, upload images, inspect account performance, or search public ads in the Facebook Ad Library.

It also supports asynchronous reports for larger date ranges, controlled tests between ad sets, and automated rules for pausing underperforming ads. Audience and catalog workflows are included. The setup needs Node.js 20 or later in the MCP host’s `npx` environment, a Meta Marketing API access token, and a numeric ad account ID without the `act_` prefix. Without Node.js 20, the server will not start.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `META_ADS_ACCESS_TOKEN`, `META_AD_ACCOUNT_ID`, `META_APP_ID`, `META_APP_SECRET`, `META_BUSINESS_ID`, `META_PIXEL_ID` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env META_ADS_ACCESS_TOKEN=<META_ADS_ACCESS_TOKEN> --env META_AD_ACCOUNT_ID=<META_AD_ACCOUNT_ID> --env META_APP_ID=<META_APP_ID> --env META_APP_SECRET=<META_APP_SECRET> --env META_BUSINESS_ID=<META_BUSINESS_ID> --transport stdio meta-ads -- npx -y @mikusnuz/meta-ads-mcp
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Codex

**Platform CLI**
```bash
codex mcp add meta-ads --env META_ADS_ACCESS_TOKEN=<META_ADS_ACCESS_TOKEN> --env META_AD_ACCOUNT_ID=<META_AD_ACCOUNT_ID> --env META_APP_ID=<META_APP_ID> --env META_APP_SECRET=<META_APP_SECRET> --env META_BUSINESS_ID=<META_BUSINESS_ID> -- npx -y @mikusnuz/meta-ads-mcp
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "meta-ads": {
            "command": "npx",
            "args": [
                "-y",
                "@mikusnuz/meta-ads-mcp"
            ],
            "env": {
                "META_ADS_ACCESS_TOKEN": "<META_ADS_ACCESS_TOKEN>",
                "META_AD_ACCOUNT_ID": "<META_AD_ACCOUNT_ID>",
                "META_APP_ID": "<META_APP_ID>",
                "META_APP_SECRET": "<META_APP_SECRET>",
                "META_BUSINESS_ID": "<META_BUSINESS_ID>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "meta-ads": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@mikusnuz/meta-ads-mcp"
            ],
            "env": {
                "META_ADS_ACCESS_TOKEN": "<META_ADS_ACCESS_TOKEN>",
                "META_AD_ACCOUNT_ID": "<META_AD_ACCOUNT_ID>",
                "META_APP_ID": "<META_APP_ID>",
                "META_APP_SECRET": "<META_APP_SECRET>",
                "META_BUSINESS_ID": "<META_BUSINESS_ID>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e META_ADS_ACCESS_TOKEN=<META_ADS_ACCESS_TOKEN> -e META_AD_ACCOUNT_ID=<META_AD_ACCOUNT_ID> -e META_APP_ID=<META_APP_ID> -e META_APP_SECRET=<META_APP_SECRET> -e META_BUSINESS_ID=<META_BUSINESS_ID> meta-ads npx -y @mikusnuz/meta-ads-mcp
```
Replace <…> with your own values. 1 more environment variable is in the server README

## When to use it
- create a Facebook campaign with ad sets and ads
- check account or campaign performance for a date range
- pause campaigns whose ROAS falls below a threshold
- run an A/B test between two ad creatives
- build a customer audience and a lookalike audience

## Example prompts
- Create a Facebook campaign, ad set, and ad with a suitable creative.
- Check today’s campaign performance and identify ads with low ROAS.
- Search the Facebook Ad Library for public ads from a competitor.

## Similar
- [KonQuest Meta Ads MCP](https://affpapa.org/en/nevibecode/mcp/konquest-meta-ads-mcp.md) — MCP server · ★ 44
- [ads-meta](https://affpapa.org/en/nevibecode/skills/ads-meta.md) — skill · 4800 installs
- [meta-ads-strategy](https://affpapa.org/en/nevibecode/skills/meta-ads-strategy.md) — skill · 506 installs
- [meta-ads-creative](https://affpapa.org/en/nevibecode/skills/meta-ads-creative.md) — skill · ★ 4064
- [Meta Ads MCP Server](https://affpapa.org/en/nevibecode/mcp/meta-ads-mcp-server.md) — MCP server · ★ 8
- [Ads Manager by AdKit: Google Ads, Meta Ads, TikTok Ads, LinkedIn Ads](https://affpapa.org/en/nevibecode/mcp/ads-manager-by-adkit-google-ads-meta-ads-tiktok-ads-linkedin-ads.md) — MCP server · ★ 18

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
