A tool that connects Google Ads with Claude AI, allowing you to analyze your advertising data through natural language conversations. This integration gives you access to campaign information, performance metrics, keyword analytics, and ad management—all through simple chat with Claude.
Account Management
Campaign Analytics & Reporting
Keyword & Ad Performance
Budget & Bid Management
flowchart TB
User(User) -->|Interacts with| Claude
Claude(Claude AI Assistant) -->|Makes requests to| MCP[Google Ads MCP Server]
User -->|Can also use| Cursor[Cursor AI Code Editor]
Cursor -->|Makes requests to| MCP
subgraph "MCP Server"
FastMCP[FastMCP Server]
Tools[Available Tools]
Auth[Authentication]
FastMCP -->|Exposes| Tools
FastMCP -->|Uses| Auth
end
subgraph "Google Ads Tools"
ListAccounts[list_accounts]
ExecuteGAQL[execute_gaql_query]
CampaignPerf[get_campaign_performance]
AdPerf[get_ad_performance]
RunGAQL[run_gaql]
end
Tools -->|Includes| ListAccounts
Tools -->|Includes| ExecuteGAQL
Tools -->|Includes| CampaignPerf
Tools -->|Includes| AdPerf
Tools -->|Includes| RunGAQL
subgraph "Authentication"
OAuth[OAuth 2.0 Client ID]
ServiceAccount[Service Account]
Credentials[Google Ads API Credentials]
OAuth -->|Provides| Credentials
ServiceAccount -->|Provides| Credentials
end
MCP -->|Communicates with| GoogleAdsAPI[Google Ads API]
GoogleAdsAPI -->|Returns| AdData[Advertising Data]
AdData -->|Analyzed by| Claude
AdData -->|Visualized by| Claude
AdData -->|Can be used by| Cursor
Credentials -->|Authorizes| GoogleAdsAPI
subgraph "Configuration"
EnvVars[Environment Variables]
ConfigFiles[Configuration Files]
EnvVars -->|Configures| MCP
ConfigFiles -->|Configures| Claude
ConfigFiles -->|Configures| Cursor
end
Here's what you can ask Claude to do once you've set up this integration:
What You Can Ask For | What It Does | What You'll 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 with performance data | Your account ID and time period |
get_ad_performance | Detailed analysis of your ad creative performance | Your account ID and time period |
run_gaql | Runs any arbitrary GAQL query with formatting options | Your account ID, query, and format (table, JSON, or CSV) |
The run_gaql
tool is especially powerful as it allows you to run any custom Google Ads Query Language (GAQL) query. Here are some example queries you can use:
SELECT
campaign.name,
metrics.clicks,
metrics.impressions
FROM campaign
WHERE segments.date DURING LAST_7DAYS
SELECT
ad_group.name,
metrics.conversions,
metrics.cost_micros
FROM ad_group
WHERE metrics.clicks > 100
SELECT
keyword.text,
metrics.average_position,
metrics.ctr
FROM keyword_view
ORDER BY metrics.impressions DESC
For a complete list of all available tools and their detailed descriptions, ask Claude to "list tools" after setup.
Before using this tool, you'll need to create API credentials that allow Claude to access your Google Ads data. You can choose between two authentication methods:
Best for individual users or desktop applications:
Better for automated systems or managing multiple accounts:
The application now includes robust token refresh handling:
Choose OAuth 2.0 Client ID if:
Choose Service Account if:
Note: Initially, you'll get a test Developer Token that has some limitations. Once you've tested your implementation, you can apply for a production token that removes these restrictions.
The GOOGLE_ADS_LOGIN_CUSTOMER_ID
is optional and is primarily used when:
The Login Customer ID should be your Manager Account ID (format: XXX-XXX-XXXX) if:
You can skip this setting if:
To find your Manager Account ID:
🎬 Watch this beginner-friendly tutorial on Youtube: COMING SOON
You'll need to install these tools on your computer:
Make sure both Python and Node.js are properly installed and available in your system path before proceeding.
You need to download this tool to your computer. The easiest way is:
Alternatively, if you're familiar with Git:
git clone https://github.com/ixigo/mcp-google-ads.git
Open your computer's Terminal (Mac) or Command Prompt (Windows):
Navigate to the folder where you unzipped the files:
# Example (replace with your actual path):
cd ~/Documents/mcp-google-ads-main
Create a virtual environment (this keeps the project dependencies isolated):
# Using uv (recommended):
uv venv .venv
# If uv is not installed, install it first:
pip install uv
# Then create the virtual environment:
uv venv .venv
# OR using standard Python:
python -m venv .venv
Note: If you get a "pip not found" error when trying to install uv, see the "If you get 'pip not found' error" section below.
Activate the virtual environment:
# On Mac/Linux:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate
Install the required dependencies:
# Using uv:
uv pip install -r requirements.txt
# OR using standard pip:
pip install -r requirements.txt
# If you encounter any issues with the MCP package, install it separately:
pip install mcp
If you get "pip not found" error:
# First ensure pip is installed and updated:
python3 -m ensurepip --upgrade
python3 -m pip install --upgrade pip
# Then try installing the requirements again:
python3 -m pip install -r requirements.txt
# Or to install uv:
python3 -m pip install uv
When you see (.venv)
at the beginning of your command prompt, it means the virtual environment is active and the dependencies will be installed there without affecting your system Python installation.
The Google Ads MCP now supports environment file configuration for easier setup.
Copy the .env.example
file to .env
in your project directory:
cp .env.example .env
Edit the .env
file with your actual configuration values:
# Edit the .env file with your favorite text editor
# For Mac:
nano .env
# For Windows:
notepad .env
Set the following values in your .env
file:
# Authentication Type: "oauth" or "service_account"
GOOGLE_ADS_AUTH_TYPE=oauth
# Path to your credentials file (OAuth client secret or service account key)
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
Save the file.
The application will automatically load these values from the .env
file when it starts.
You can also set environment variables directly in your system or in the configuration files for Claude or Cursor:
{
"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"
}
}
}
}
{
"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"
}
}
}
}
# For Mac users:
nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
# For Windows users:
notepad %APPDATA%\Claude\claude_desktop_config.json
Add the following text (this tells Claude how to connect to Google Ads):
{
"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"
}
}
}
}
Important: Replace all paths and values with the actual information for your account:
google_ads_server.py
file inside the folder you unzippedExamples:
/Users/ernesto/Documents/mcp-google-ads/.venv/bin/python
/Users/ernesto/Documents/mcp-google-ads/google_ads_server.py
C:\\Users\\ernesto\\Documents\\mcp-google-ads\\.venv\\Scripts\\python.exe
C:\\Users\\ernesto\\Documents\\mcp-google-ads\\google_ads_server.py
Save the file:
Restart Claude Desktop
When Claude opens, you should now see Google Ads tools available in the tools section
Cursor is an AI-powered code editor that can be enhanced with MCP tools. You can integrate this Google Ads MCP tool with Cursor to analyze advertising data directly within your coding environment.
If you haven't already, download and install Cursor
Create a Cursor MCP configuration file:
For project-specific configuration:
Create a .cursor/mcp.json
file in your project directory.
For global configuration (available in all projects):
Create a ~/.cursor/mcp.json
file in your home directory.
Add the following configuration to your MCP config 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"
}
}
}
}
Important: Replace all paths and values with the actual information for your account, just like in the Claude Desktop configuration.
Restart Cursor or reload the workspace to apply the new configuration.
The Google Ads MCP will now appear in Cursor's "Available Tools" section and can be used by Cursor's AI agent when needed.
When working in Cursor, you can ask the AI agent to use the Google Ads tools directly. For example:
Cursor will prompt you to approve the tool usage (unless you've enabled Yolo mode) and then display the results directly in the chat interface.
When using the Google Ads MCP with Cursor, you can:
This integration is particularly valuable for developers working on marketing automation, analytics dashboards, or e-commerce applications where ad performance directly impacts code decisions.
Now you can ask Claude questions about your Google Ads data! Claude can not only retrieve the data but also analyze it, explain trends, and create visualizations to help you understand your advertising performance better.
Here are some powerful prompts you can use with each tool:
Tool Name | Sample Prompt |
---|---|
list_accounts | "List all my Google Ads accounts and tell me which ones have the highest spend this month." |
execute_gaql_query | "Execute this query for account 123-456-7890: SELECT campaign.name, metrics.clicks FROM campaign WHERE metrics.impressions > 1000" |
get_campaign_performance | "Show me the top 10 campaigns for account 123-456-7890 in the last 30 days, highlight any with ROAS below 2, and suggest optimization strategies." |
get_ad_performance | "Do a comprehensive analysis of which ad copy elements are driving the best CTR in my search campaigns and give me actionable recommendations." |
run_gaql | "Run this query and format it as a CSV: SELECT ad_group.name, metrics.clicks, metrics.conversions FROM ad_group WHERE campaign.name LIKE '%Brand%'" |
You can also ask Claude to combine multiple tools and analyze the results. For example:
"Find my top 20 converting keywords, check their quality scores and impression share, and create a report highlighting opportunities for scaling."
"Analyze my account's performance trend over the last 90 days, identify my fastest-growing campaigns, and check if there are any budget limitations holding them back."
"Compare my desktop vs. mobile ad performance, visualize the differences with charts, and recommend specific campaigns that need mobile bid adjustments based on performance gaps."
"Identify campaigns where I'm spending the most on search terms that aren't in my keyword list, then suggest which ones should be added as exact match keywords."
Claude will use the Google Ads tools to fetch the data, present it in an easy-to-understand format, create visualizations when helpful, and provide actionable insights based on the results.
Claude can help you visualize your Google Ads data in various ways:
Simply ask Claude to "visualize" or "create a chart" when analyzing your data, and it will generate appropriate visualizations to help you understand the information better.
On macOS, the default Python command is often python3
rather than python
, which can cause issues with some applications including Node.js integrations.
If you encounter errors related to Python not being found, you can create an alias:
Create a Python alias (one-time setup):
# For macOS users:
sudo ln -s $(which python3) /usr/local/bin/python
# If that doesn't work, try finding your Python installation:
sudo ln -s /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 /usr/local/bin/python
Verify the alias works:
python --version
This creates a symbolic link so that when applications call python
, they'll actually use your python3
installation.
If you're having trouble connecting:
If you encounter issues related to API quotas or permissions:
If you encounter any other unexpected issues during installation or usage:
You can also consult AI assistants which can often help diagnose and resolve technical issues by suggesting specific solutions for your situation.
Remember that most issues have been encountered by others before, and there's usually a straightforward solution available.
The repository includes test files that let you verify your Google Ads API connection is working correctly before using it with Claude or Cursor.
Make sure your virtual environment is activated:
# On Mac/Linux:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate
Configure the environment variables in the test file or set them in your environment:
test_google_ads_mcp.py
in a text editorif not os.environ.get("GOOGLE_ADS_CREDENTIALS_PATH"):
Run the test:
python test_google_ads_mcp.py
The test will:
To specifically test the authentication and token refresh mechanisms:
Make sure your virtual environment is activated and your .env
file is configured.
Run the token refresh test:
python test_token_refresh.py
This test will:
The token refresh test can help confirm that both OAuth and service account credentials are properly configured before using the server with Claude or Cursor.
If all tests complete successfully, your setup is working correctly and ready to use with Claude or Cursor.
Found a bug or have an idea for improvement? We welcome your input! Open an issue or submit a pull request on GitHub, or contact Ernesto Cohnen directly at ernesto@ixigo.com.
This project is licensed under the MIT License. See the LICENSE file for details.
ixigo is India's leading travel app, helping millions of travelers find the best deals on flights, trains, buses, and hotels. For more information, visit ixigo.com.
ixigo is a technology company that builds products to help people find the best deals on flights, trains, buses, and hotels. We're a team of travel enthusiasts who are passionate about making travel more affordable and accessible to everyone.
Seamless access to top MCP servers powering the future of AI integration.