by gomarble-ai
Facebook Ads MCP Server is an interface that provides programmatic access to Facebook Ads data and management features. It allows users to automate interaction with their Facebook advertising campaigns and integrate ad data into other systems.
Facebook Ads MCP Server is a project that provides an MCP (Model Context Protocol) server acting as an interface to Facebook Ads. It enables programmatic access to Facebook Ads data and management features, allowing users to interact with their Facebook advertising campaigns and data through an automated system.
There are several ways to use the Facebook Ads MCP Server:
For a simplified setup, ready-to-use installers are available. You can download the installer from https://gomarble.ai/mcp. This method automatically handles environment setup and prompts for Facebook token authentication.
requirements.txt
.python3 -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt
ads_read
) through the Facebook Developer portal. A guide is available at https://elfsight.com/blog/how-to-get-facebook-access-token/.To integrate with an MCP-compatible client, add a configuration similar to the following, replacing YOUR_FACEBOOK_ACCESS_TOKEN
with your actual token and adjusting the path to server.py
:
{
"mcpServers": {
"fb-ads-mcp-server": {
"command": "python",
"args": [
"/path/to/your/fb-ads-mcp-server/server.py",
"--fb-token",
"YOUR_FACEBOOK_ACCESS_TOKEN"
]
}
}
}
Restart the MCP Client app after making the update.
Execute server.py
, providing the access token via the --fb-token
argument:
python server.py --fb-token YOUR_FACEBOOK_ACCESS_TOKEN
To install Facebook Ads Server for Claude Desktop automatically via Smithery, use the following command:
npx -y @smithery/cli install @gomarble-ai/facebook-ads-mcp-server --client claude
Does this setup require me to manually obtain a Facebook Developer Access Token? No, this setup does not require you to manually obtain a Facebook Developer Access Token. It can connect securely to GoMarble's server to create the token on your behalf.
Does GoMarble store my Facebook access token? No, GoMarble does not store your token. It is saved locally on your machine for use with the MCP server.
What happens if my Facebook access token expires? If your Facebook access token expires, you'll need to generate a new one and update the configuration file of the MCP Client with the new token to continue using the tools.
What are the prerequisites for setting up the server manually?
You need Python 3.10+ and the dependencies listed in requirements.txt
.
What kind of data can I retrieve using this server? You can retrieve details about ad accounts, campaigns, ad sets, ads, ad creatives, performance insights, and activity/change history.
This project provides an MCP server acting as an interface to the Facebook Ads, enabling programmatic access to Facebook Ads data and management features.
Your browser does not support the video tag.
For a simpler setup experience, we offer ready-to-use installers:
👉 Download installer - https://gomarble.ai/mcp
👉 Slack Community - AI in Ads
👉 Google Ads MCP - Google Ads MCP
This setup does not require you to manually obtain a Facebook Developer Access Token.
Instead, it connects securely to GoMarble's server to create the token on your behalf. GoMarble does not store your token — it is saved locally on your machine for use with the MCP server.
requirements.txt
(Optional but Recommended) Create and Activate a Virtual Environment:
python3 -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
Using a virtual environment helps manage project dependencies cleanly[Source].
Install Dependencies:
pip install -r requirements.txt
Obtain Facebook Access Token: Secure a Facebook User Access Token with the necessary permissions (e.g., ads_read
). You can generate this through the Facebook Developer portal. Follow this link.
To integrate this server with an MCP-compatible client, add a configuration(Claude) similar to the following. Replace YOUR_FACEBOOK_ACCESS_TOKEN
with your actual token and adjust the path to server.py
if necessary.
{
"mcpServers": {
"fb-ads-mcp-server": {
"command": "python",
"args": [
"/path/to/your/fb-ads-mcp-server/server.py",
"--fb-token",
"YOUR_FACEBOOK_ACCESS_TOKEN"
]
// If using a virtual environment, you might need to specify the python executable within the venv:
// "command": "/path/to/your/fb-ads-mcp-server/venv/bin/python",
// "args": [
// "/path/to/your/fb-ads-mcp-server/server.py",
// "--fb-token",
// "YOUR_FACEBOOK_ACCESS_TOKEN"
// ]
}
}
}
Restart the MCP Client app after making the update in the configuration.
(Note: On Windows, you might need to adjust the command structure or use cmd /k
depending on your setup.)
Execute server.py
, providing the access token via the --fb-token
argument.
python server.py --fb-token YOUR_FACEBOOK_ACCESS_TOKEN
This MCP server provides tools for interacting with Facebook Ads objects and data:
Tool Name | Description |
---|---|
Account & Object Read | |
list_ad_accounts |
Lists ad accounts linked to the token. |
get_details_of_ad_account |
Retrieves details for a specific ad account. |
get_campaign_by_id |
Retrieves details for a specific campaign. |
get_adset_by_id |
Retrieves details for a specific ad set. |
get_ad_by_id |
Retrieves details for a specific ad. |
get_ad_creative_by_id |
Retrieves details for a specific ad creative. |
get_adsets_by_ids |
Retrieves details for multiple ad sets by their IDs. |
Fetching Collections | |
get_campaigns_by_adaccount |
Retrieves campaigns within an ad account. |
get_adsets_by_adaccount |
Retrieves ad sets within an ad account. |
get_ads_by_adaccount |
Retrieves ads within an ad account. |
get_adsets_by_campaign |
Retrieves ad sets within a campaign. |
get_ads_by_campaign |
Retrieves ads within a campaign. |
get_ads_by_adset |
Retrieves ads within an ad set. |
get_ad_creatives_by_ad_id |
Retrieves creatives associated with an ad. |
Insights & Performance Data | |
get_adaccount_insights |
Retrieves performance insights for an ad account. |
get_campaign_insights |
Retrieves performance insights for a campaign. |
get_adset_insights |
Retrieves performance insights for an ad set. |
get_ad_insights |
Retrieves performance insights for an ad. |
fetch_pagination_url |
Fetches data from a pagination URL (e.g., from insights). |
Activity/Change History | |
get_activities_by_adaccount |
Retrieves change history for an ad account. |
get_activities_by_adset |
Retrieves change history for an ad set. |
(Note: Most tools support additional parameters like fields
, filtering
, limit
, pagination, date ranges, etc. Refer to the detailed docstrings within server.py
for the full list and description of arguments for each tool.)
(Note: If your Facebook access token expires, you'll need to generate a new one and update the configuration file of the MCP Client with new token to continue using the tools.)
This project is licensed under the MIT License.
To install Facebook Ads Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @gomarble-ai/facebook-ads-mcp-server --client claude
Please log in to share your review and rating for this MCP.
Discover more MCP servers with similar functionality and use cases
by open-strategy-partners
A Model Context Protocol (MCP) server that empowers LLMs to use some of Open Srategy Partners' core writing and product marketing techniques.
by trypeggy
facebook-ads-library-mcp is a Model Context Protocol (MCP) server that allows users to search Facebook's public ad library. It enables analysis of advertising strategies, ad content, and competitive landscapes for companies and brands.
by fetchSERP
Provides access to all FetchSERP API endpoints for SEO analysis, keyword research, SERP retrieval, and web scraping through an MCP server.
by AudienseCo
mcp-audiense-insights is a tool that connects AI agents to the Audiense Insights platform. It enables AI agents to access and analyze marketing insights and audience data for various use cases like market research and content strategy.
by data-skunks
Provides keyword research capabilities—including People Also Ask questions, Google autocomplete suggestions, Reddit and Quora queries, and semantic keyword extraction—through a Model Context Protocol (MCP) server that integrates with KeywordsPeopleUse.
by MarketplaceAdPros
amazon-ads-mcp-server is a server that facilitates interaction with Amazon Advertising data. It allows users to connect their Amazon Advertising accounts to access various advertising resources and reports, enabling automated ad management, custom reporting, and integration with AI/ML models.
by universal-mcp
Braze is a Universal MCP (Model Context Protocol) server that provides a standardized interface for interacting with Braze's tools and services through a unified API. It is designed for managing customer engagement, user profiles, and messaging campaigns.
by netdata
Real-time, per‑second infrastructure monitoring platform that provides instant insights, auto‑discovery, edge‑based machine‑learning anomaly detection, and lightweight visualizations without requiring complex configuration.
by zed-industries
Provides real-time collaborative editing powered by Rust, enabling developers to edit code instantly across machines with a responsive, GPU-accelerated UI.