by gomarble-ai
Provides programmatic access to Meta Ads data and management capabilities through an MCP server, enabling seamless integration with MCP‑compatible clients.
The server acts as a bridge between Meta (Facebook) Ads and Model Context Protocol (MCP) clients, exposing a comprehensive set of tools that read, list, and analyze ad accounts, campaigns, ad sets, ads, creatives, insights, and activity logs.
pip install -r requirements.txt
.python server.py --fb-token YOUR_META_ACCESS_TOKEN
{
"mcpServers": {
"fb-ads-mcp-server": {
"command": "python",
"args": ["/path/to/server.py", "--fb-token", "YOUR_META_ACCESS_TOKEN"]
}
}
}
Restart the client after updating the configuration.fetch_pagination_url
utility to follow Graph API pagination links.--fb-token
value in the MCP client configuration.This project provides an MCP server acting as an interface to the Meta Ads, enabling programmatic access to Meta 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 Meta 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 Meta Access Token: Secure a Meta User Access Token with the necessary permissions (e.g., ads_read
). You can generate this through the Meta Developer portal. Follow this link.
To integrate this server with an MCP-compatible client, add a configuration(Claude) similar to the following. Replace YOUR_META_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_META_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_META_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_META_ACCESS_TOKEN
This MCP server provides tools for interacting with META 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 Meta 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.
{ "mcpServers": { "facebook-ads-mcp-server": { "command": "python", "args": [ "server.py", "--fb-token", "<YOUR_META_ACCESS_TOKEN>" ], "env": {} } } }
Explore related MCPs that share similar capabilities and solve comparable challenges
by lharries
Enables searching, reading, and sending personal WhatsApp messages and media through a Model Context Protocol (MCP) server, storing all data locally in SQLite and exposing controlled tools for LLMs like Claude.
by iFurySt
Provides authenticated access to XiaoHongShu (RedNote) notes, supporting keyword search, note retrieval by URL, and cookie persistence via a Model Context Protocol server.
by korotovsky
Provides a powerful Model Context Protocol interface for Slack workspaces, enabling message retrieval, search, and optional posting via Stdio or SSE transports without requiring bot permissions.
by ZubeidHendricks
Provides a standardized interface for interacting with YouTube content, enabling video retrieval, transcript access, channel and playlist management, and advanced analytics through the Model Context Protocol.
by InditexTech
Provides Microsoft Teams integration via the Model Context Protocol, enabling reading, creating, replying to messages and mentioning members.
by chigwell
Provides a full‑featured Telegram integration for MCP‑compatible clients, enabling programmatic access to chats, messages, contacts, profile management, and group administration.
by EnesCinr
Interact with Twitter to post tweets and search tweets programmatically via an MCP server.
by chaindead
Manages Telegram dialogs, messages, drafts, and read statuses via the Model Context Protocol, enabling AI assistants to query and interact with Telegram accounts.
by carterlasalle
Securely interfaces with the macOS Messages database via MCP, enabling LLMs to query, analyze, filter, and send iMessage or SMS communications with built‑in phone number validation, attachment handling, and group chat support.