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
Provider
cohnen
Release date
Mar 20, 2025
Language
Go
Stats
58 stars

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

Installation

Set Up Google Ads API Access

Before using this tool, you need to create API credentials:

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

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

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 needed
  5. Click "Apply for token"
  6. Fill out the application form
  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:

    git clone https://github.com/ixigo/mcp-google-ads.git
    

    Or download the ZIP file from the GitHub repository.

  2. Navigate to the folder:

    cd mcp-google-ads-main
    
  3. Create and activate a virtual environment:

    # Using uv (recommended):
    pip install uv
    uv venv .venv
    
    # OR using standard Python:
    python -m venv .venv
    
    # Activate on Mac/Linux:
    source .venv/bin/activate
    
    # Activate on Windows:
    .venv\Scripts\activate
    
  4. Install dependencies:

    # Using uv:
    uv pip install -r requirements.txt
    
    # OR using standard pip:
    pip install -r requirements.txt
    

Configure Environment

  1. Create an environment file:

    cp .env.example .env
    
  2. Edit the .env file with your actual configuration values:

    # 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 configuration file:

    # For Mac users:
    nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
    
    # For Windows users:
    notepad %APPDATA%\Claude\claude_desktop_config.json
    
  2. 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"
          }
        }
      }
    }
    
  3. Save the file and restart Claude Desktop

Usage

The Google Ads MCP provides several tools that you can use by asking Claude:

Available Tools

Tool Name What It Does What You Need to Provide
list_accounts Shows all your Google Ads accounts Nothing - just ask!
execute_gaql_query Runs a Google Ads Query Language query Your account ID and a GAQL query
get_campaign_performance Shows campaign metrics Your account ID and time period
get_ad_performance Analyzes ad creative performance Your account ID and time period
run_gaql Runs any arbitrary GAQL query Your account ID, query, and format (table, JSON, or CSV)

Example Prompts

  • "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."
  • "Do a comprehensive analysis of which ad copy elements are driving the best CTR in my search campaigns."
  • "Run this query: SELECT campaign.name, metrics.clicks FROM campaign WHERE metrics.impressions > 1000"

Example GAQL Queries

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

Troubleshooting

Python Command Not Found

On macOS, create a Python alias:

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

Testing Your Setup

Test your Google Ads API connection:

# Make sure your virtual environment is activated
python test_google_ads_mcp.py

Test authentication and token refresh:

python test_token_refresh.py

If you encounter issues:

  1. Verify all file paths in configurations are correct
  2. Check that your service account has access to your Google Ads accounts
  3. Verify your Developer Token is valid
  4. Restart Claude Desktop after making configuration changes

How to add this MCP server to 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 > 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"
            ]
        }
    }
}

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

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