Listen to this Post

Introduction:
The advertising industry is witnessing a fundamental shift as AI agents gain the ability to interact directly with ad platforms through natural language. The Model Context Protocol (MCP), introduced by Anthropic in November 2024, standardizes how AI applications connect to external tools and data sources—essentially creating a “USB-C port for AI” that replaces fragmented custom integrations with a single, universal interface. When applied to Google Ads, this means marketers can now ask plain-English questions about campaign performance and receive instant, data-driven answers without navigating complex UIs or exporting spreadsheets.
Learning Objectives:
- Understand how the Model Context Protocol (MCP) enables AI-to-ad-platform communication and the security implications of AI agents with write access to advertising budgets
- Master the setup and configuration of Google Ads MCP servers across Claude Desktop and Claude Code environments
- Learn to deploy, customize, and troubleshoot AI skills for campaign diagnostics, wasted spend audits, budget optimization, and full account analysis
- Understanding the MCP Architecture: How AI Talks to Google Ads
The Model Context Protocol establishes a standardized communication layer between AI applications (MCP hosts like Claude Desktop) and external services. The architecture follows a clear hierarchy: User ↔ MCP Host ↔ MCP Client ↔ MCP Server(s) ↔ Tools/Data/APIs. MCP servers are lightweight programs that expose tools, resources, and prompts via the protocol, using either `stdio` (local) or HTTP/SSE (remote) transports.
For Google Ads integration, the MCP server acts as a bridge between Claude and the Google Ads API. When you ask Claude a question about your campaigns, the MCP server translates your natural language request into a GAQL (Google Ads Query Language) query, executes it against the API, and returns structured results. The official Google Ads MCP server, maintained by Google, provides tools like `search` (for running GAQL queries), `get_resource_metadata` (for understanding data structure), and `list_accessible_customers` (for account discovery).
What makes this approach powerful is the “skills” concept—pre-built instruction sets that tell Claude exactly how to analyze specific aspects of your account. The system described in the post includes 21 skills across five categories: analysis, optimization, creative, diagnostics, and strategy. These skills eliminate the need for manual data extraction, spreadsheet manipulation, and UI navigation.
- Setting Up Your Google Ads MCP Server: A Step-by-Step Guide
Step 1: Obtain Google Ads API Credentials
Before connecting Claude to your Google Ads account, you need API credentials. Google Ads API requires:
– A developer token obtained from the Google Ads API Center (accessible via Tools & Settings > API Center in your Google Ads manager account)
– OAuth 2.0 client credentials (client ID and client secret) from the Google Cloud Console
– Multi-factor authentication (MFA) enabled on your Google account—the Google Ads API requires 2SV for all users generating new OAuth refresh tokens
Store these credentials securely. Google explicitly advises treating OAuth app credentials like passwords and using secrets managers such as Google Cloud Secret Manager rather than committing credentials to code repositories.
Step 2: Choose and Install an MCP Server
Several MCP server implementations are available:
Option A: Official Google Ads MCP Server (Python)
Install via pipx pipx install google-ads-mcp
The official server includes comprehensive tooling and uses a `tools_config.yaml` file to selectively enable or disable individual tools.
Option B: Rust-based Implementation with Safety Guardrails
git clone https://github.com/FGRibreau/mcp-google-ads.git cd mcp-google-ads cargo build --release
This implementation offers 44 tools with a two-step safety layer for all write operations—every mutation returns a preview, and nothing executes until you confirm.
Option C: Unified Ads MCP Server (Google + Facebook Ads)
npm install -g media-buyer-plugin
A FastMCP-powered server supporting both Google Ads and Facebook Ads with automatic OAuth 2.0 authentication and token refresh.
Step 3: Configure Claude Desktop
For Claude Desktop, add the MCP server to your configuration file:
– macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
– Windows: `%APPDATA%\Claude\claude_desktop_config.json`
{
"mcpServers": {
"google-ads": {
"command": "/path/to/mcp-google-ads",
"env": {
"GOOGLE_ADS_DEVELOPER_TOKEN": "your_dev_token",
"GOOGLE_ADS_CLIENT_ID": "your_client_id",
"GOOGLE_ADS_CLIENT_SECRET": "your_client_secret",
"GOOGLE_ADS_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}
Step 4: Authenticate and Test
Run the OAuth flow to generate a refresh token:
./scripts/generate_token.sh ~/.mcp-google-ads/credentials.json
Then restart Claude Desktop. You should now be able to ask questions like “List all my Google Ads accounts” or “Show me campaign performance for account 1234567890”.
- Deploying the 21 Skills: From Diagnostics to Full Account Audits
The skills system operates on a simple principle: each skill is a structured instruction set that tells Claude exactly what data to pull, how to analyze it, and what format to return results in. Here’s how the most frequently used skills work:
Campaign Diagnostics: When ROAS drops on a Wednesday, Claude queries the Google Ads API for performance data segmented by day, identifies the specific campaigns or ad groups causing the decline, and correlates the drop with recent changes—all within 30 seconds.
Wasted Spend Audit: The skill executes a GAQL query filtering search terms with spend exceeding $20 and zero conversions, groups results by campaign, and outputs a formatted negative keyword list ready for copy-paste into the Google Ads interface.
Budget Optimizer: Claude simulates budget reallocation scenarios using your actual historical performance data, calculating projected outcomes based on conversion rates, average CPC, and historical trends—bypassing Google’s generic forecast models.
Quality Score Deep Dive: The skill retrieves Quality Score components (expected CTR, ad relevance, landing page experience) for every keyword, ranks them by spend, and prioritizes fixes for the highest-impact keywords first.
Auction Insights Monitor: Claude pulls competitive data week-over-week, flagging new entrants, shifts in impression share, and positions where you’re losing ground to competitors.
PMax Breakdown: The skill surfaces otherwise hidden Performance Max data including asset group ROAS, worst-performing assets, and the search categories actually driving spend—information Google typically aggregates within opaque PMax reporting.
Full Account Audit: Claude reviews your entire account structure—budget allocation, bid strategies, keyword coverage, conversion tracking—and generates a comprehensive audit report that would typically cost $2,000+ from a senior PPC consultant.
- Security Considerations: Protecting Your Ad Spend and Data
MCP introduces unique security challenges that extend beyond traditional API integrations. Unlike traditional APIs where developers control every call, MCP lets LLMs decide which tools to invoke, when, and with what parameters. Key risks include:
- Confused Deputy Problem: The MCP server executes actions with its own privileges, not necessarily the requesting user’s permissions
- Tool Poisoning: Malicious instructions hidden in tool descriptions or return values that manipulate LLM behavior
- Excessive Permissions: MCP servers requesting broad OAuth scopes (full access vs. read-only)
- Data Exfiltration: Attackers using prompt injection to encode sensitive data into seemingly normal tool calls
Security Best Practices:
- Principle of Least Privilege: Grant each MCP server the minimum permissions necessary. Use read-only OAuth scopes for audit work and restrict write operations to specific campaigns.
-
Two-Step Safety for Write Operations: Implement a preview-before-execution workflow for all mutations. The Rust-based MCP server enforces this with budget caps, bid limits, and audit logging.
-
Secure Credential Storage: Never transmit tokens in plaintext; always store encrypted tokens at rest. Use environment variables or secrets managers rather than hardcoding credentials.
-
Local Execution: MCP servers run locally—no data leaves your machine except the API calls each server makes to its target ad platform.
-
Tool Configuration: Use `tools_config.yaml` to selectively disable dangerous tools or restrict write operations.
5. Advanced GAQL Query Patterns for Power Users
While the skills handle common use cases, power users can leverage GAQL directly for custom analysis. Here are essential query patterns:
Campaign Performance Breakdown:
SELECT campaign.name, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.conversions FROM campaign WHERE segments.date DURING LAST_30_DAYS
Keyword Analysis with Quality Score:
SELECT ad_group_criterion.keyword.text, metrics.impressions, metrics.clicks, metrics.cost_micros, ad_group_criterion.quality_score, ad_group_criterion.quality_info.expected_ctr, ad_group_criterion.quality_info.ad_relevance, ad_group_criterion.quality_info.landing_page FROM keyword_view WHERE segments.date DURING LAST_7_DAYS ORDER BY metrics.cost_micros DESC
Search Term Analysis for Negative Keywords:
SELECT campaign.name, ad_group.name, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.conversions, segments.search_term FROM search_term_view WHERE metrics.conversions = 0 AND metrics.cost_micros > 20000000
Auction Insights:
SELECT campaign.name, segments.date, auction_insights.domain, auction_insights.impression_share, auction_insights.overlap_rate, auction_insights.position_above_rate FROM auction_insight_view WHERE segments.date DURING LAST_7_DAYS
6. Troubleshooting Common MCP Issues
Authentication Errors: If you encounter “Request is missing required authentication credential” errors, verify your OAuth refresh token is valid and not expired. Google Ads API requires MFA for all users, and API calls will fail with `TWO_STEP_VERIFICATION_NOT_ENROLLED` if 2SV isn’t enabled.
Tool Description Size Issues: Some MCP clients experience truncation errors when the `search` tool description exceeds size limits. Disable specific tools in `tools_config.yaml` if you encounter this issue.
Account Access Issues: Use a client account customer ID (not your MCC/manager ID) for campaign and performance reads. Ensure your manager account has administrative ownership over sub-accounts.
Configuration Validation: The server validates configuration files strictly. If an explicitly requested configuration file is missing or invalid, the server raises an error and fails to start.
7. The Future of AI-Powered Advertising Management
The integration of AI assistants with ad platforms through MCP represents more than just a convenience upgrade—it’s a fundamental shift in how marketing work gets done. The ability to query live advertising data through natural language eliminates the friction that has traditionally separated data analysis from decision-making.
However, this power comes with responsibility. As AI agents gain the ability to not just analyze but also execute changes to live campaigns, the security implications become critical. Organizations implementing these systems must establish clear governance frameworks, including approval workflows for budget changes, audit trails for all AI-initiated actions, and regular security reviews of MCP server configurations.
What Undercode Say:
- Democratization of Data Analysis: The skills system effectively turns every marketer into a data analyst, eliminating the need for specialized SQL or API knowledge to extract actionable insights from Google Ads data.
- Security Cannot Be an Afterthought: While the convenience is compelling, organizations must implement robust security controls—least privilege access, two-step safety for writes, and proper credential management—before deploying these systems at scale.
- The Skills Economy is Emerging: Just as app stores revolutionized mobile, skill repositories are becoming the distribution mechanism for AI capabilities. The 21 skills described represent a template for how domain expertise can be packaged and shared in the AI era.
Prediction:
- +1 Acceleration of Marketing Automation: AI-powered ad management will become the default within 24 months, with agencies differentiating themselves through custom skill development rather than manual reporting.
- +1 New Job Categories Emerge: “AI Skills Engineer for Marketing” will become a recognized role, combining PPC expertise with prompt engineering and MCP server configuration.
- -1 Increased Budget Risk: As more organizations grant AI agents write access to ad accounts, the potential for catastrophic budget errors increases exponentially without proper guardrails.
- -1 Security Fragmentation: The rapid proliferation of MCP servers and skills will create a fragmented security landscape, with inconsistent implementations exposing sensitive advertising data.
- +1 Vendor Consolidation: Google will likely build native MCP capabilities into the Google Ads UI, reducing reliance on third-party servers while maintaining the natural language interface paradigm.
▶️ Related Video (78% Match):
🎯Let’s Practice For Free:
🎓 Live Courses & Certifications:
Join Undercode Academy for Verified Certifications
🚀 Request a Custom Project:
Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands
IT/Security Reporter URL:
Reported By: Built 21 – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅


