facebook-ads-mcp-server

by @gomarble-ai

Facebook Ads MCP Server

Inspect Meta and Facebook Ads accounts, campaigns, ad sets, creatives, performance insights, and change-history logs from Claude Desktop or Cursor over local stdio. Written in Python 3.10+ under MIT by GoMarble AI, facebook-ads-mcp-server authenticates with a Meta User Access Token or GoMarble's local installer.

Data & Analytics370pythonMIT

Server facts

facebook-ads-mcp-server

GitHub stars

370

Last commit

Aug 5, 2026

Runtime

python

License

MIT

Tech

Runtime
python
Transports
stdio
Remote access
No
Authentication
Meta User Access Token (--fb-token, e.g. ads_read) or GoMarble local installer

Activity

GitHub stars
370
Last commit
Data as of

Tags

  • Data Analysis
  • facebook ads
  • mcp server

Overview

Performance marketers and growth analysts building a `facebook ads mcp` workflow can query Meta Ads Manager objects directly from Cursor or Claude Desktop using `gomarble-ai/facebook-ads-mcp-server` (Python 3.10+, MIT license, built on `mcp >=1.6.0` and `requests >=2.32.3`). Setup supports either manual Python installation—creating a virtual environment, running `pip install -r requirements.txt`, generating a Meta User Access Token with scopes such as `ads_read`, and pointing `mcpServers` at `python /path/to/server.py --fb-token YOUR_META_ACCESS_TOKEN` over `stdio`—or downloading GoMarble's local installer from `gomarble.ai/mcp`, which automates local configuration and can optionally mint a token via GoMarble's server while saving it only on your machine.

Its read-focused toolset covers full Meta Ads hierarchy traversal and reporting: listing linked accounts (`list_ad_accounts`), fetching individual accounts, campaigns, ad sets, ads, and creatives by ID, enumerating collections per account/campaign/ad set, pulling account, campaign, ad-set, and ad insights (`get_adaccount_insights`, `get_campaign_insights`, `get_adset_insights`, `get_ad_insights`), following paginated insights cursors (`fetch_pagination_url`), and auditing change logs (`get_activities_by_adaccount`, `get_activities_by_adset`). Most tools accept filtering, field selection, date range, limit, and pagination arguments documented in `server.py`.

Install & configure

Requirements

  • Python 3.10+ and packages from `requirements.txt` (`mcp >=1.6.0`, `requests >=2.32.3`)
  • Meta User Access Token with `ads_read` (or required Meta Ads permissions), passed via `--fb-token` (or minted locally via the GoMarble installer at `gomarble.ai/mcp`)
  • Local MCP client such as Claude Desktop or Cursor configured for `stdio` execution
Documented launch / install command
pip install -r requirements.txt

Clone the repository, install dependencies with `pip install -r requirements.txt` (ideally inside a virtual environment), and configure `mcpServers` in Claude Desktop or Cursor to run `python /path/to/server.py --fb-token YOUR_META_ACCESS_TOKEN`. Restart the client after saving, or use the local installer at `gomarble.ai/mcp`.

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Desktop configuration
{
  "mcpServers": {
    "fb-ads-mcp-server": {
      "command": "python",
      "args": [
        "/path/to/your/fb-ads-mcp-server/server.py",
        "--fb-token",
        "YOUR_META_ACCESS_TOKEN"
      ]
    }
  }
}

Read the Claude Desktop setup guide

Config file · Project: .cursor/mcp.json

User: ~/.cursor/mcp.json

The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.

Cursor configuration
{
  "mcpServers": {
    "fb-ads-mcp-server": {
      "command": "python",
      "args": [
        "/path/to/your/fb-ads-mcp-server/server.py",
        "--fb-token",
        "YOUR_META_ACCESS_TOKEN"
      ]
    }
  }
}

Read the Cursor setup guide

Config file · Workspace: .vscode/mcp.json

For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.

VS Code configuration
{
  "servers": {
    "fb-ads-mcp-server": {
      "type": "stdio",
      "command": "python",
      "args": [
        "/path/to/your/fb-ads-mcp-server/server.py",
        "--fb-token",
        "YOUR_META_ACCESS_TOKEN"
      ]
    }
  }
}

Read the VS Code setup guide

Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json

Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.

Windsurf configuration
{
  "mcpServers": {
    "fb-ads-mcp-server": {
      "command": "python",
      "args": [
        "/path/to/your/fb-ads-mcp-server/server.py",
        "--fb-token",
        "YOUR_META_ACCESS_TOKEN"
      ]
    }
  }
}

Read the Windsurf setup guide

Config file · Project scope: .mcp.json at the repository root

The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Code configuration
{
  "mcpServers": {
    "fb-ads-mcp-server": {
      "type": "stdio",
      "command": "python",
      "args": [
        "/path/to/your/fb-ads-mcp-server/server.py",
        "--fb-token",
        "YOUR_META_ACCESS_TOKEN"
      ]
    }
  }
}

Read the Claude Code setup guide

Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.

Tools

Source: repository README. Tool descriptions are a documented snapshot, not a live capability check.

ToolWhat it does
list_ad_accountsList Meta ad accounts accessible under the configured access token.
get_details_of_ad_accountFetch detailed metadata and configuration for a specified Meta ad account.
get_campaign_by_idRetrieve metadata and settings for a single Meta Ads campaign by ID.
get_adset_by_idRetrieve targeting, budget, and status details for a specific ad set by ID.
get_ad_by_idFetch full object details for a single Meta ad by ID.
get_ad_creative_by_idInspect creative assets and specifications for an individual ad creative ID.
get_adsets_by_idsBatch-retrieve details for multiple ad sets given a list of ad set IDs.
get_campaigns_by_adaccountList campaigns belonging to a target Meta ad account with optional filtering and fields.
get_adsets_by_adaccountList all ad sets under a specified Meta ad account.
get_ads_by_adaccountList ads inside a target Meta ad account.
get_adsets_by_campaignList ad sets organized under a specific Meta Ads campaign.
get_ads_by_campaignRetrieve all ads running inside a given campaign.
get_ads_by_adsetRetrieve ads assigned to a specific ad set.
get_ad_creatives_by_ad_idFetch creative definitions linked to a specific ad ID.
get_adaccount_insightsPull performance insights and metrics at the Meta ad account level.
get_campaign_insightsPull campaign-level performance metrics with date range, field, and filter options.
get_adset_insightsPull ad-set-level performance insights for spend and conversion analysis.
get_ad_insightsPull individual ad performance insights for creative evaluation.
fetch_pagination_urlFollow a Meta Graph API pagination cursor URL returned by insights or collection tools.
get_activities_by_adaccountRetrieve the historical activity and change log for a Meta ad account (paired with get_activities_by_adset for ad-set logs).

Use cases

  • Pull account, campaign, ad-set, and ad performance insights into Claude Desktop to diagnose spend, fatigue, and ROAS shifts.
  • Traverse Meta Ads hierarchies from `list_ad_accounts` down to individual ad creatives via `get_ad_creatives_by_ad_id`.
  • Audit recent budget, targeting, or status edits across an account or ad set using `get_activities_by_adaccount` and `get_activities_by_adset`.
  • Page cleanly through large Meta Ads insight responses with `fetch_pagination_url` without writing custom Graph API scripts.

Strengths

  • Covers 20+ documented tools spanning Meta Ads hierarchy reads, multi-level performance insights, pagination, and change-history auditing.
  • Runs locally over `stdio` with minimal Python dependencies (`mcp` and `requests`) under an MIT license.
  • Offers both direct manual Meta Developer token configuration (`--fb-token`) and an optional local GoMarble installer that avoids manual portal setup.

Limitations

  • Runs locally over `stdio` only—there is no hosted remote MCP URL documented for browser-only connectors.
  • Manual Meta User Access Tokens expire periodically and require regenerating and updating your MCP client configuration.
  • Documented tools focus on reading accounts, creatives, insights, and activity logs rather than mutating campaigns or budgets.

facebook-ads-mcp-server setup notes

  • facebook-ads-mcp-server's stdio example needs a client that launches local processes.

Frequently asked questions

Install Python 3.10+ dependencies via `pip install -r requirements.txt`, obtain a Meta User Access Token with `ads_read` permission, and register `fb-ads-mcp-server` under `mcpServers` executing `python /path/to/server.py --fb-token YOUR_META_ACCESS_TOKEN` over `stdio`. Restart Claude Desktop or Cursor afterward; on Windows you may need to point `command` at your virtual environment's Python binary or adjust with `cmd /k`.

Related MCP servers