Provides comprehensive tools for managing Google Ads campaigns, ad groups, ads, keywords, audiences, and extensions, with support for custom GAQL queries, performance analytics across multiple levels (account, campaign, ad group, ad, keyword), and multi-channel campaigns (Search, Display, YouTube, Shopping, Performance Max).
Google Ads MCP Server
Comprehensive Model Context Protocol (MCP) server for Google Ads API integration with Claude. Supports campaigns, ad groups, ads, keywords, audiences, extensions, shopping, and performance analytics.
This implementation follows Anthropic's token-efficiency recommendations by exposing a unified call_tool interface instead of individual tool definitions. This reduces token usage by ~98.7% compared to traditional tool approaches.
Supported Features
š Resource Management - List and query campaigns, ad groups, ads, keywords, extensions, audiences, labels, and bidding strategies
š Custom Queries - Execute GAQL (Google Ads Query Language) queries with pagination support
š Performance Analytics - Get detailed performance metrics at any level (account, campaign, ad group, ad, keyword)
š GAQL Help - Built-in reference for GAQL syntax, fields, filters, and best practices
šÆ Multiple Output Formats - JSON, CSV, and table formats for query results
šļø Shopping Support - Query product groups and shopping campaign data
š± Multi-Channel - Search, Display, YouTube, Shopping, and Performance Max campaigns
How It Works
Instead of listing all tool definitions upfront:
Claude writes code to call tools dynamically:
Setup
1. Install Dependencies
2. Configure Credentials
Create a .env file (copy from .env.example) with your Google Ads API credentials:
Important: Never commit credentials to git. Use environment variables or .env files with proper .gitignore rules.
3. Add to Claude Desktop
Edit ~/.config/claude/claude_desktop_config.json:
Available Operations
š List Resources
list_accounts() - List accessible customer accounts
list_campaigns(customer_id) - List all campaigns with budget info
list_ad_groups(customer_id, campaign_id?) - List ad groups (optionally filtered by campaign)
list_ads(customer_id, ad_group_id?) - List ads (optionally filtered by ad group)
list_keywords(customer_id, ad_group_id?) - List keywords with quality scores
list_extensions(customer_id) - List sitelinks, callouts, structured snippets, etc.
list_audiences(customer_id) - List all audiences (remarketing, custom intent, affinity)
list_labels(customer_id) - List custom labels
list_bidding_strategies(customer_id) - List available bidding strategies
š Query Data
execute_gaql(query, customer_id?, output_format?, auto_paginate?, max_pages?)
Execute custom GAQL queries with full pagination support.
Output Formats: json, csv, table
š Performance Analytics
get_performance(level, customer_id?, date_range?, days?, metrics?, segments?, filters?, output_format?)
Get detailed performance metrics at any level with flexible filtering and segmentation.
Levels: account, campaign, ad_group, ad, keyword
Date ranges: LAST_7_DAYS, LAST_30_DAYS, THIS_MONTH, LAST_MONTH, LAST_QUARTER, LAST_YEAR
Common metrics: impressions, clicks, conversions, cost_micros, ctr, conversion_rate, quality_score
Common segments: date, device, geo_target_country, age_range, gender, day_of_week
ā Help & Discovery
gaql_help(topic?, search?)
Get GAQL syntax help and examples.
Topics: overview, resources, metrics, segments, filters, best_practices
search_tools(query?)
Search for available resources and operations.
Usage Examples
Find campaigns with low CTR
Analyze keyword quality
Shopping campaign analysis
Display network targeting analysis
Error Handling
The server includes proper error handling and logging. Errors are caught and returned as structured responses to Claude.
Token Efficiency
This server implements Anthropic's code execution approach for MCP:
Approach | Token Usage | Latency |
Traditional tools | ~150,000 | Slower (many round-trips) |
Code execution | ~2,000 | Faster (batch processing) |
Savings | 98.7% reduction | ~75% faster |
By using a unified interface and letting Claude write code:
Tools are discovered on-demand, not loaded upfront
Data is filtered and transformed in the execution environment
Large datasets can be processed without bloating context
Complex workflows execute in fewer steps
See Anthropic's engineering blog for details.
Security
Credentials are loaded from environment variables, never hardcoded
Sensitive data is not logged
Always use HTTPS for API communications (handled by Google Ads SDK)
This server cannot be installed