
Facebook Ads MCP Server
The Facebook Ads MCP Server offers robust Facebook Ads integration, featuring account listing, detailed retrieval of campaigns, ad sets, ads, and creatives, along with performance insights and change history logs.
What is Facebook Ads MCP Server?
The Facebook Ads MCP Server is a powerful integration tool that allows users to connect their AI assistants directly to Facebook Ads data, enabling natural language queries for deeper insights into ad performance.
How to use Facebook Ads MCP Server?
To use the server, set up a Python environment, install the required packages, and run the server with your Facebook Access Token. Connect your AI client to the MCP configuration to start querying your ads data.
Key features of Facebook Ads MCP Server?
- AI-powered analysis of Facebook Ads data using natural language.
- Access to detailed information on campaigns, ad sets, ads, creatives, and performance insights.
- Ability to track changes and view history logs of ad performance.
- Easy setup with standard Python requirements.
Use cases of Facebook Ads MCP Server?
- Analyzing campaign performance metrics like ROAS and CTR.
- Fetching detailed insights based on custom date ranges and demographic breakdowns.
- Auditing changes made to ad sets and campaigns over time.
FAQ from Facebook Ads MCP Server?
- Can I use this server with any AI assistant?
Yes! The server is designed to work with various AI assistants like Cursor and Claude.
- What are the prerequisites for using the server?
You need Python 3.10+ and a Facebook Access Token with
ads_read
permission.
- Is there a limit to the queries I can make?
The server can handle a large number of queries, but performance may vary based on the complexity of the requests.
Unlock Deeper Facebook Ads Insights: Powered by AI & MCP
Stop Clicking, Start Asking. Connect your AI assistant (Cursor, Claude, etc.) directly to your Facebook Ads data with this powerful MCP Server.
Instantly get answers like:
- "Show me my top 5 campaigns by ROAS last month?"
- "Compare CTR for ad sets A vs. B over the last 7 days."
- "What was the total spend breakdown by age and gender for campaign 'Summer Sale'?"
- "Who paused ad set 'Ad Set - Leads Q3' yesterday?"
Why You Need This:
- AI-Powered Analysis: Query your ads data using natural language via your AI assistant.
- Deep Data Access: Go beyond basics – campaigns, ad sets, ads, creatives, insights, history.
- Granular Insights: Fetch performance with custom dates, breakdowns (age, platform, etc.), filters & attribution.
- Track Changes: See who changed what and when (
get_activities_...
). - Easy Setup: Standard Python, quick to deploy.
Quick Start Guide:
- Prerequisites: Python 3.10+, Facebook Access Token (
ads_read
permission). - Setup:
(Optional)
Create Python virtual environment (python3 -m venv venv && source venv/bin/activate
)- Install:
pip install -r requirements.txt
- Prepare Server:
python server.py --fb-token YOUR_FACEBOOK_ACCESS_TOKEN
- Connect AI Client: Add to MCP config (adjust paths):
{ "mcpServers": { "fb-ads-mcp-server": { "command": "/path/to/venv/bin/python", // Or just "python" "args": [ "/path/to/server.py", "--fb-token", "YOUR_TOKEN" ] } } }
- Restart your AI client.
Example Interactions:
This server gives your AI tools to talk to the Facebook Ads API. Ask questions like:
- Get Objects:
- "Get details for campaign
1234567890
using fields: name, objective, effective_status." - "Fetch ad creative
2384xxxxxxxxx
and show its image_url and body."
- "Get details for campaign
- List Objects:
- "List all ads in ad set
6123xxxxxxxxx
with effective_status ACTIVE." - "Show me all campaigns in account
act_987654321
."
- "List all ads in ad set
- Analyze Performance:
- "What was the spend, impressions, and clicks for account
act_987654321
last_30d?" - "Get insights for ad
6789xxxxxxxxx
broken down by publisher_platform for the last 7 days." - "Fetch campaign insights for
1234567890
with time_increment monthly for the last year."
- "What was the spend, impressions, and clicks for account
- Audit History:
- "Show me the activity log for ad set
4455667788
using time_range since 2024-01-15 until 2024-01-16." - "What changes happened in account
act_987654321
today?"
- "Show me the activity log for ad set
- (Behind the Scenes) Paginate: If results are large, the AI can use
fetch_pagination_url
to get the next page automatically or upon request.
(See readme.md
or server.py
docstrings for the full list of tools and their detailed parameters!)