Provides programmatic access to Facebook/Meta Ads data and management features, including retrieving ad accounts, campaigns, ad sets, ads, creatives, performance insights, and change history across the Meta advertising platform.
Provides programmatic access to Meta Ads data and management features, including retrieving ad accounts, campaigns, ad sets, ads, creatives, performance insights, and change history across the Meta advertising platform.
Facebook/Meta Ads MCP Server
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.
Easy One-Click Setup
For a simpler setup experience, we offer ready-to-use installers:
π Download installer - https://adsinsight.ai/mcp
Join our community for help and updates
π Slack Community - AI in Ads
Try Google ads mcp server also
π Google Ads MCP - Google Ads MCP
What It Does
Installs and configures the MCP server locally
Automatically handles environment setup
Prompts for Meta token authentication during the process which is optional
If Meta access token is not provided then connect to AdsInsight's server to create the token on your behalf
Important Disclaimer
This setup does not require you to manually obtain a Meta Developer Access Token.
Instead, it connects securely to AdsInsight's server to create the token on your behalf. AdsInsight does not store your token β it is saved locally on your machine for use with the MCP server.
Setup
Prerequisites
Python 3.10+
Dependencies listed in
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.txtObtain 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.
Usage with MCP Clients (e.g., Cursor, Claude Desktop)
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.
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
Debugging the Server
Execute server.py, providing the access token via the --fb-token argument.
Available MCP Tools
This MCP server provides tools for interacting with META Ads objects and data:
Tool Name | Description |
Account & Object Read | |
| Lists ad accounts linked to the token. |
| Retrieves details for a specific ad account. |
| Retrieves details for a specific campaign. |
| Retrieves details for a specific ad set. |
| Retrieves details for a specific ad. |
| Retrieves details for a specific ad creative. |
| Retrieves details for multiple ad sets by their IDs. |
Fetching Collections | |
| Retrieves campaigns within an ad account. |
| Retrieves ad sets within an ad account. |
| Retrieves ads within an ad account. |
| Retrieves ad sets within a campaign. |
| Retrieves ads within a campaign. |
| Retrieves ads within an ad set. |
| Retrieves creatives associated with an ad. |
Insights & Performance Data | |
| Retrieves performance insights for an ad account. |
| Retrieves performance insights for a campaign. |
| Retrieves performance insights for an ad set. |
| Retrieves performance insights for an ad. |
| Fetches data from a pagination URL (e.g., from insights). |
Activity/Change History | |
| Retrieves change history for an ad account. |
| Retrieves change history for an ad set. |
(Note: Most tools support additional parameters like
(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.)
Dependencies
License
This project is licensed under the MIT License.
Installing via Smithery
To install Facebook Ads Server for Claude Desktop automatically via Smithery: