Get the FREE Ultimate OpenClaw Setup Guide →

meta

MCP Server for connecting to the Meta Marketing API

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio brijr-meta-mcp npx -y meta-ads-mcp \
  --env META_ACCESS_TOKEN="your_access_token_here"

How to use

The Meta Marketing API MCP Server provides a full-featured interface to manage Facebook/Instagram advertising data via the Meta Marketing API. It supports campaign management, analytics, audience targeting, and creative optimization, enabling AI assistants and tools to create, update, and monitor campaigns, pull performance metrics, manage audiences, and evaluate creative effectiveness. With this MCP server, you can perform lifecycle operations such as creating campaigns and ad sets, setting budgets and schedules, analyzing performance with customizable date ranges, exporting data, and applying attribution tracking. It also includes enterprise-grade features like OAuth 2.0 authentication, automatic rate limiting with exponential backoff, pagination, robust error handling, and multi-account support. To use it with Claude Desktop or Cursor, configure the MCP server in your Claude/Cursor settings and provide a Meta access token (and optional app secret if needed). The server exposes standard MCP endpoints through the configured npm package, enabling command-based or web-based clients to interact with Meta Marketing API resources via MCP requests.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Access token with ads_read and ads_management permissions from Meta for your app (and app secret if required)

Step-by-step installation:

  1. Install the MCP server globally
npm install -g meta-ads-mcp
  1. Obtain or prepare your Meta access token and (optionally) app secret
  • Generate an access token with the required permissions from the Meta Developer Console
  • If your setup requires appsecret_proof, plan to provide META_APP_SECRET in the environment
  1. Configure the MCP server for your Claude Desktop or Cursor integration Create or edit the Claude/Cursor MCP configuration with an entry similar to:
{
  "mcpServers": {
    "meta-ads": {
      "command": "npx",
      "args": ["-y", "meta-ads-mcp"],
      "env": {
        "META_ACCESS_TOKEN": "your_access_token_here"
      }
    }
  }
}
  1. Verify the setup and health
npm run health-check

Optional: If you are developing locally or testing a build, you can run the MCP server directly:

npx -y meta-ads-mcp

Additional notes

Tips and common issues:

  • If you see a message requiring appsecret_proof, add META_APP_SECRET to the MCP environment.
  • For token refresh workflows, consider enabling OAuth (META_AUTO_REFRESH) and providing relevant app credentials in the config.
  • When using Claude Desktop, ensure the claude_desktop_config.json file is correctly updated and that Claude is restarted after changes.
  • If you encounter 'Command not found' errors, ensure Node.js/npm/npx are installed and accessible in your PATH.
  • For web deployment (Vercel) or remote MCP usage, follow the corresponding docs in the README for remote configuration and token-based access.

Related MCP Servers

Sponsor this space

Reach thousands of developers