Meta Ads MCP server provides a standardized interface for AI models to interact with Meta Ads API, allowing Large Language Models (LLMs) to retrieve performance data, analyze ad campaigns, and deliver strategic insights for Facebook, Instagram, and other Meta advertising platforms.
You can run meta-ads-mcp directly without installation using uvx:
# Run with Meta authentication
uvx meta-ads-mcp --app-id YOUR_META_ADS_APP_ID
To install the package:
uv pip install meta-ads-mcp
If you're working with the repository:
# From the repository root
uv pip install -e .
Alternatively, install using pip:
pip install meta-ads-mcp
After installation, run it with:
# Run with Meta authentication
python -m meta_ads_mcp --app-id YOUR_META_ADS_APP_ID
Before using the MCP server:
http://localhost:8888/callback
For Claude Desktop, add to your claude_desktop_config.json
:
"mcpServers": {
"meta-ads": {
"command": "uvx",
"args": ["meta-ads-mcp", "--app-id", "YOUR_META_ADS_APP_ID"]
}
}
For Cursor, add to ~/.cursor/mcp.json
with the same format.
Meta Ads MCP uses OAuth 2.0 authentication flow:
Logs are stored at:
~/Library/Application Support/meta-ads-mcp/meta_ads_debug.log
%APPDATA%\meta-ads-mcp\meta_ads_debug.log
~/.config/meta-ads-mcp/meta_ads_debug.log
If you see (#200) Provide valid app ID
, check:
export META_APP_ID=your_app_id
# or
meta-ads-mcp --app-id your_app_id
For Meta API errors:
# Using environment variable
export META_APP_ID=your_app_id
uvx meta-ads-mcp
# Or using command line argument
uvx meta-ads-mcp --app-id=your_app_id
META_APP_ID
as an environment variableexport META_ACCESS_TOKEN=your_access_token
uvx meta-ads-mcp
python test_meta_ads_auth.py --app-id YOUR_APP_ID
Force a new authentication:
python test_meta_ads_auth.py --app-id YOUR_APP_ID --force-login
With an LLM interface (like Claude):
mcp_meta_ads_get_login_link
mcp_meta_ads_get_ad_accounts
mcp_meta_ads_get_account_info
import meta_ads_mcp
print(meta_ads_mcp.__version__)
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.