MCP Server Setup Guide
Step-by-step guide to configure the AdsMAA MCP server with Claude Desktop, Claude Code, or Cursor.
Intermediate10 min readUpdated 2026-03-31
Follow this guide to connect AdsMAA's MCP server to your preferred AI tool.
Prerequisites
Before starting, make sure you have:
- An AdsMAA account with at least one connected Meta ad account
- Node.js 18+ installed on your machine
- Access to the AdsMAA MCP remote URL: output
https://mcp.adsmaa.com/mcp
Step 1: Generate API Key
- Log into AdsMAA and navigate to MCP Server (in sidebar under AI Tools) or Settings > Developer
- Click Generate to create a new API key
- Name it "MCP Server" and ensure +output
campaignspermissions are enabledoutputanalytics - Copy the key immediately — it will not be shown again
Step 2a: Claude Desktop Setup
Add the following to your Claude Desktop config file:
Use this configuration for all clients (Claude.ai, Claude Desktop, Claude Code, Cursor):
json{ "mcpServers": { "adsmaa": { "url": "https://mcp.adsmaa.com/mcp", "headers": { "X-API-Key": "your_api_key_here" } } } }
Replace
output
your_api_key_hereWhere to add the config:
- Claude.ai: Settings > MCP Servers > Add server > paste URL and API key
- Claude Desktop: (macOS) oroutput
~/Library/Application Support/Claude/claude_desktop_config.json(Windows)output%APPDATA%\Claude\claude_desktop_config.json - Claude Code: output
~/.claude/settings.json - Cursor: Settings > MCP Servers > Add new server
Step 3: Verify Connection
After restarting your AI client:
- You should see adsmaa listed in the MCP tools
- Try these test prompts:
- "List my Meta integrations"
- "Show campaign statistics for the last 30 days"
- "Run an audit on my ad account"
- "What campaigns need attention?"
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
output | Yes* | — | API key from AdsMAA dashboard |
output | Yes* | — | Alternative: JWT access token |
output | No | output | AdsMAA backend URL |
output | No | output | Max requests per window |
output | No | output | Rate limit window (ms) |
*One of
output
ADSMAA_API_KEYoutput
ADSMAA_AUTH_TOKENTroubleshooting
"Authentication failed" error
- Verify your API key is correct and not expired
- Check that the key has andoutput
campaignspermissionsoutputanalytics - Ensure points to the correct backendoutput
ADSMAA_BASE_URL
"Backend request timed out"
- Verify the AdsMAA backend is running at the specified URL
- Check network connectivity between your machine and the backend
- For local development, ensure output
ADSMAA_BASE_URL=http://localhost:3000
No tools showing up
- Restart your AI client after adding the config
- Check that the MCP server was built: output
cd meta-ads-mcp-server && npm run build - Verify Node.js 18+ is installed: output
node --version
"Integration not found" on live tools
- Run first to get valid integration IDsoutput
meta_list_integrations - Ensure the integration status is "connected"
- If disconnected, reconnect via the AdsMAA Integrations page
Key Takeaways
- 1Generate an API key from AdsMAA Settings or the MCP Server page
- 2Add the MCP config to your AI client's settings file
- 3Restart the AI client to activate the connection
- 4Test with a simple prompt like "List my campaigns"
Frequently Asked Questions
Can I use both JWT and API key auth?
You can use either, but not both at the same time. API key auth (ADSMAA_API_KEY) is recommended for MCP servers since API keys don't expire as quickly as JWT tokens.
Do I need to rebuild the MCP server after updates?
Yes, after pulling updates run: cd meta-ads-mcp-server && npm run build. Then restart your AI client.
Was this article helpful?