Skip to main content
This page walks you through connecting your AI assistant to AdAdvisor’s MCP server. Pick your client below and follow the instructions.

Prerequisites

Before you start, make sure you have:
  1. An AdAdvisor account with at least one connected Meta ad account. Sign up here if you haven’t already.
  2. An MCP-compatible AI client installed (see the tabs below for supported clients).
  3. An API key (optional). OAuth is the default and recommended auth method. If you prefer API key auth, create one in Settings > MCP Server before starting. See Managing API Keys for details.

MCP server URL

All clients connect to the same server:
https://api.adadvisor.ai/mcp

Authentication

AdAdvisor supports two authentication methods:
  • OAuth (recommended): Your client opens a browser window where you log in to AdAdvisor. The token is issued and refreshed automatically. No key management needed.
  • API Key: Pass a key in the Authorization header. Useful for headless setups, CI/CD pipelines, or clients that don’t support OAuth.
Both methods grant the same level of access. See What is the MCP Server? for more details on how auth works.

Client setup

Claude Code runs in the terminal and supports both OAuth and API key authentication.Option 1: OAuth (recommended)Run this command to add the server globally (available in all projects):
claude mcp add adadvisor \
  --transport http \
  --scope user \
  https://api.adadvisor.ai/mcp
The next time you start a conversation and a tool from AdAdvisor is used, Claude Code will open your browser so you can log in. After that, you’re all set.To add the server for only the current project, omit --scope user:
claude mcp add adadvisor \
  --transport http \
  https://api.adadvisor.ai/mcp
You can verify the server is connected by running:
claude mcp list
Option 2: API KeyIf you prefer using an API key, run:
claude mcp add adadvisor \
  --transport http \
  https://api.adadvisor.ai/mcp \
  -- --header "Authorization: Bearer YOUR_API_KEY"
Or add it to your .mcp.json file in your project root:
.mcp.json
{
  "mcpServers": {
    "adadvisor": {
      "type": "http",
      "url": "https://api.adadvisor.ai/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Verifying the connection

After adding the server, try asking your AI assistant something about your ad data. For example:
What campaigns are currently running in my ad account?
Show me my top performing ad sets by ROAS this month.
What's my average CPC across all active campaigns?
If everything is set up correctly, the assistant will connect to AdAdvisor, pull your data, and return results grounded in your actual campaign performance.

Troubleshooting

Authentication errors (401 Unauthorized)

If using API key auth:
  • Verify the key hasn’t been revoked or expired in Settings > MCP Server
  • Make sure the Authorization header format is exactly Bearer YOUR_API_KEY (with a space after “Bearer”)
  • Create a new key if needed. See Managing API Keys
If using OAuth:
  • OAuth sessions can expire. Re-authenticate by triggering a new connection from your client:
    • Claude Code: Remove and re-add the server with claude mcp remove adadvisor then re-run the add command
    • Cursor: Open Command Palette > Cursor: Clear All MCP Tokens, then restart
    • VS Code: Open Command Palette > Authentication: Remove Dynamic Authentication Providers, then restart
    • Other clients: Remove the server entry from your config, restart the client, and re-add it

Server not appearing or tools not loading

  • Double-check the URL is exactly https://api.adadvisor.ai/mcp (no trailing slash, no typos)
  • Restart your client after editing the config file. Most clients don’t hot-reload MCP config changes.
  • Make sure you’re editing the correct config file for your client (project-level vs global)
  • For Cursor and VS Code, check that the JSON is valid. A missing comma or bracket will silently fail.

No data returned

  • Verify your Meta ad account is connected in AdAdvisor and the initial data sync has completed. Check Settings > Connected Accounts.
  • Make sure the business you’re querying has active campaigns with data in the date range you’re asking about.

Connection timeout

  • If you’re behind a corporate firewall or VPN, make sure outbound HTTPS connections to api.adadvisor.ai aren’t blocked.
  • Try the mcp-remote proxy method (see the “Other clients” tab above) if your client has trouble with direct HTTP connections.

Security best practices

  • Use OAuth when possible. It’s more secure than static API keys and handles token rotation automatically.
  • One API key per client. If a key is compromised, you only need to revoke and replace that one without affecting other tools.
  • Set expiration dates on API keys for shared machines or temporary setups.
  • Don’t commit keys to git. Use environment variables or your client’s secure input mechanism (like VS Code’s promptString input) instead of hardcoding keys in config files.

Finding the setup instructions in AdAdvisor

You can also find these instructions directly in the app. Go to Settings > MCP Server and scroll down to the “Quick Start” section. Select your client from the dropdown and the instructions (with code blocks you can copy) will appear.
MCP quick start
Last modified on March 30, 2026