Google Ads MCP server

Integrates with Google Ads API to enable direct access and management of advertising campaigns, performance analysis, and optimization within conversations.
Back to servers
Setup instructions
Provider
cohnen
Release date
Mar 20, 2025
Language
Go
Stats
310 stars

The Google Ads MCP server is a powerful integration tool that connects Google Ads with Claude AI, allowing you to analyze advertising data through natural language conversations. It gives you access to campaign information, performance metrics, keyword analytics, and ad management capabilities through simple chat interactions.

Installation

Set Up Google Ads API Access

Before using this tool, you need to create API credentials to allow Claude to access your Google Ads data. Choose between:

Option A: OAuth 2.0 Client ID (User Authentication)

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Google Ads API
  4. Go to "Credentials" → "Create Credentials" → "OAuth Client ID"
  5. Choose "Desktop Application" as the application type
  6. Download the OAuth client configuration file (client_secret.json)
  7. Create a Google Ads API Developer token (see below)

Option B: Service Account (Server-to-Server Authentication)

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Google Ads API
  4. Go to "Credentials" → "Create Credentials" → "Service Account"
  5. Download the service account key file (JSON)
  6. Grant the service account access to your Google Ads accounts
  7. Create a Google Ads API Developer token (see below)

Getting a Developer Token

  1. Sign in to your Google Ads account at https://ads.google.com
  2. Click on Tools & Settings (wrench icon) in the top navigation
  3. Under "Setup", click "API Center"
  4. Accept the Terms of Service if prompted
  5. Click "Apply for token"
  6. Fill out the application form with details about how you plan to use the API
  7. Submit the application and wait for approval (usually 1-3 business days)

Install Required Software

  1. Install Python (version 3.11 or newer)
  2. Install Node.js
  3. Install Claude Desktop

Download and Set Up the Google Ads MCP

  1. Download the tool:

    • Click the green "Code" button on the GitHub page
    • Select "Download ZIP"
    • Unzip to a convenient location
  2. Open Terminal/Command Prompt and install dependencies:

# Navigate to the folder
cd path/to/mcp-google-ads-main

# Create a virtual environment
python -m venv .venv

# Activate the virtual environment
# On Mac/Linux:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt
  1. Configure environment variables:
    • Copy .env.example to .env
    • Edit the .env file with your credentials:
# Authentication Type: "oauth" or "service_account"
GOOGLE_ADS_AUTH_TYPE=oauth

# Path to your credentials file
GOOGLE_ADS_CREDENTIALS_PATH=/path/to/your/credentials.json

# Your Google Ads Developer Token
GOOGLE_ADS_DEVELOPER_TOKEN=your_developer_token_here

# Optional: Manager Account ID (if applicable)
GOOGLE_ADS_LOGIN_CUSTOMER_ID=your_manager_account_id

Connect Claude to Google Ads

  1. Edit the Claude Desktop configuration file:
# For Mac users:
nano ~/Library/Application\ Support/Claude/claude_desktop_config.json

# For Windows users:
notepad %APPDATA%\Claude\claude_desktop_config.json
  1. Add the following configuration:
{
  "mcpServers": {
    "googleAdsServer": {
      "command": "/FULL/PATH/TO/mcp-google-ads-main/.venv/bin/python",
      "args": ["/FULL/PATH/TO/mcp-google-ads-main/google_ads_server.py"],
      "env": {
        "GOOGLE_ADS_AUTH_TYPE": "oauth",
        "GOOGLE_ADS_CREDENTIALS_PATH": "/FULL/PATH/TO/mcp-google-ads-main/credentials.json",
        "GOOGLE_ADS_DEVELOPER_TOKEN": "YOUR_DEVELOPER_TOKEN_HERE",
        "GOOGLE_ADS_LOGIN_CUSTOMER_ID": "YOUR_MANAGER_ACCOUNT_ID_HERE"
      }
    }
  }
}
  1. Save the file and restart Claude Desktop

Using the Google Ads MCP

Once connected, you can ask Claude to analyze your advertising data. Available tools include:

Available Tools

Tool Description Required Parameters
list_accounts Shows all your Google Ads accounts None
execute_gaql_query Runs a Google Ads Query Language query Account ID, GAQL query
get_campaign_performance Shows campaign metrics with performance data Account ID, time period
get_ad_performance Detailed analysis of ad creative performance Account ID, time period
run_gaql Runs any GAQL query with formatting options Account ID, query, format

Example Queries

You can run powerful GAQL queries with the run_gaql tool. Here are some examples:

Basic campaign metrics

SELECT 
    campaign.name, 
    metrics.clicks, 
    metrics.impressions 
FROM campaign 
WHERE segments.date DURING LAST_7_DAYS

Ad group performance

SELECT 
    ad_group.name, 
    metrics.conversions, 
    metrics.cost_micros 
FROM ad_group 
WHERE metrics.clicks > 100

Keyword analysis

SELECT 
    keyword.text, 
    metrics.average_position, 
    metrics.ctr 
FROM keyword_view 
ORDER BY metrics.impressions DESC

Sample Prompts

Here are some effective prompts to use with Claude:

  • "List all my Google Ads accounts and tell me which ones have the highest spend this month."
  • "Show me the top 10 campaigns for account 123-456-7890 in the last 30 days, highlight any with ROAS below 2."
  • "Do a comprehensive analysis of which ad copy elements are driving the best CTR in my search campaigns."
  • "Find my top 20 converting keywords, check their quality scores, and create a report highlighting opportunities for scaling."

Claude can also create visualizations of your data when asked, helping you better understand performance trends, campaign comparisons, and optimization opportunities.

Troubleshooting

If you encounter issues:

Python Command Not Found

On macOS, create an alias:

sudo ln -s $(which python3) /usr/local/bin/python

Configuration Issues

  • Ensure all file paths are correct and use full paths
  • Verify your service account has access to your Google Ads accounts
  • Check that your Developer Token is valid
  • Restart Claude Desktop after making changes

Testing Your Setup

Run the included test scripts to verify your connection:

python test_google_ads_mcp.py
python test_token_refresh.py

If all tests complete successfully, your setup is working correctly and ready to use with Claude.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "googleAdsServer" '{"command":"/FULL/PATH/TO/mcp-google-ads-main/.venv/bin/python","args":["/FULL/PATH/TO/mcp-google-ads-main/google_ads_server.py"],"env":{"GOOGLE_ADS_CREDENTIALS_PATH":"/FULL/PATH/TO/mcp-google-ads-main/service_account_credentials.json","GOOGLE_ADS_DEVELOPER_TOKEN":"YOUR_DEVELOPER_TOKEN_HERE","GOOGLE_ADS_LOGIN_CUSTOMER_ID":"YOUR_MANAGER_ACCOUNT_ID_HERE"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

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.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "googleAdsServer": {
            "command": "/FULL/PATH/TO/mcp-google-ads-main/.venv/bin/python",
            "args": [
                "/FULL/PATH/TO/mcp-google-ads-main/google_ads_server.py"
            ],
            "env": {
                "GOOGLE_ADS_CREDENTIALS_PATH": "/FULL/PATH/TO/mcp-google-ads-main/service_account_credentials.json",
                "GOOGLE_ADS_DEVELOPER_TOKEN": "YOUR_DEVELOPER_TOKEN_HERE",
                "GOOGLE_ADS_LOGIN_CUSTOMER_ID": "YOUR_MANAGER_ACCOUNT_ID_HERE"
            }
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "googleAdsServer": {
            "command": "/FULL/PATH/TO/mcp-google-ads-main/.venv/bin/python",
            "args": [
                "/FULL/PATH/TO/mcp-google-ads-main/google_ads_server.py"
            ],
            "env": {
                "GOOGLE_ADS_CREDENTIALS_PATH": "/FULL/PATH/TO/mcp-google-ads-main/service_account_credentials.json",
                "GOOGLE_ADS_DEVELOPER_TOKEN": "YOUR_DEVELOPER_TOKEN_HERE",
                "GOOGLE_ADS_LOGIN_CUSTOMER_ID": "YOUR_MANAGER_ACCOUNT_ID_HERE"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later