Google Ads API v20 logo

Google Ads API v20

Organization
DigitalRocket-biz

Google Ads API v20 MCP Server - Complete implementation with all v20 features including Performance Max negative keywords and enhanced reporting

PublisherDigitalRocket-biz
Repositorygoogle-ads-mcp-v20
LanguagePython
Forks
10
Stars
11
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Google Ads API v20 exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    11 stars and 10 forks from the linked repository.

Google Ads API v20 MCP Server

A comprehensive Model Context Protocol (MCP) server that provides full access to Google Ads API v20 functionality. This server enables AI assistants to perform any Google Ads operation through natural language commands.

Features

Complete API Coverage

  • Account Management: List accounts, get account info, view hierarchy
  • Campaign Management: Create, update, pause/resume campaigns with all v20 features
  • Ad Group Management: Full CRUD operations for ad groups
  • Ad Creation: Responsive search ads, expanded text ads, and more
  • Asset Management: Upload and manage images, text assets
  • Budget Management: Create and manage shared budgets
  • Keyword Management: Add keywords, negative keywords (including Performance Max campaign-level negatives)
  • Reporting & Analytics: Custom GAQL queries, performance reports, search terms
  • Advanced Features: Recommendations, change history, experiments

Intelligent Features

  • Automatic Retry Logic: Handles transient errors with exponential backoff
  • Error Documentation: Links to official Google Ads API error documentation
  • Partial Failure Handling: Continues processing when some operations fail
  • Token Auto-Refresh: Automatically refreshes OAuth tokens
  • Self-Rewriting: Can look up documentation and retry failed operations

Installation

bash
# Install with pip
pip install -e .

# Or install dependencies directly
pip install mcp google-ads pydantic httpx tenacity python-dotenv beautifulsoup4 structlog

Configuration

Environment Variables

Create a .env file or set these environment variables:

bash
# OAuth2 Authentication
GOOGLE_ADS_CLIENT_ID=your_client_id
GOOGLE_ADS_CLIENT_SECRET=your_client_secret
GOOGLE_ADS_REFRESH_TOKEN=your_refresh_token

# OR Service Account Authentication
GOOGLE_ADS_SERVICE_ACCOUNT_PATH=/path/to/service-account.json
GOOGLE_ADS_IMPERSONATED_EMAIL=user@example.com  # Optional

# Required for all auth methods
GOOGLE_ADS_DEVELOPER_TOKEN=your_developer_token
GOOGLE_ADS_LOGIN_CUSTOMER_ID=1234567890  # Manager account ID if applicable

Configuration File

Alternatively, create a config file at ~/.config/google-ads-mcp/config.json:

json
{
  "client_id": "your_client_id",
  "client_secret": "your_client_secret",
  "refresh_token": "your_refresh_token",
  "developer_token": "your_developer_token",
  "login_customer_id": "1234567890"
}

MCP Configuration

Add to your Claude Desktop config (~/.config/claude/mcp.json):

json
{
  "mcpServers": {
    "google-ads": {
      "command": "python",
      "args": ["-m", "google-ads-mcp"],
      "env": {
        "GOOGLE_ADS_DEVELOPER_TOKEN": "your_token",
        "GOOGLE_ADS_CLIENT_ID": "your_client_id",
        "GOOGLE_ADS_CLIENT_SECRET": "your_secret",
        "GOOGLE_ADS_REFRESH_TOKEN": "your_refresh_token"
      }
    }
  }
}

Usage Examples

Basic Operations

# List all accounts
Use the list_accounts tool

# Create a campaign
Use create_campaign with customer_id="1234567890", name="Summer Sale 2025", 
budget_amount=100.0, campaign_type="SEARCH"

# Get campaign performance
Use get_campaign_performance with customer_id="1234567890", date_range="LAST_30_DAYS"

Advanced Queries

# Run custom GAQL query
Use run_gaql_query with query:
SELECT campaign.name, metrics.clicks, metrics.conversions
FROM campaign
WHERE metrics.impressions > 1000
  AND segments.date DURING LAST_7_DAYS
ORDER BY metrics.clicks DESC

Performance Max Features (v20)

# Add negative keywords to Performance Max campaign
Use add_negative_keywords with customer_id="1234567890", 
campaign_id="123", keywords=["cheap", "discount", "free"]

Error Handling

The server provides detailed error information:

  • Error type and code
  • Human-readable message
  • Whether the error is retryable
  • Link to official documentation
  • Suggestions for fixing common errors

Development

Running Tests

bash
pytest tests/

Adding New Tools

  1. Add tool definition to _register_tools() in tools.py
  2. Implement the handler method
  3. Update documentation

Debugging

bash
# Run with debug logging
export LOG_LEVEL=DEBUG
python -m google-ads-mcp

Security Notes

  • Never commit credentials to version control
  • Use service accounts for production environments
  • Enable 2FA on Google Ads accounts
  • Regularly rotate refresh tokens
  • Monitor API usage and set alerts

API Version Support

This server is built for Google Ads API v20 (released June 2025) and includes:

  • Campaign-level negative keywords for Performance Max
  • Enhanced Demand Gen reporting with channel segmentation
  • Platform comparable conversions
  • All v20-specific features and improvements

License

MIT License - See LICENSE file for details

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Submit a pull request

Support

For issues and questions:

Use Google Ads API v20 MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Google Ads API v20 is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Google Ads API v20 as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Google Ads API v20 MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "google-ads-mcp-v20": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Google Ads API v20 MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Google Ads API v20 MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Google Ads API v20 to help me with this task?
Google Ads API v20
Sure. I read it.
Here is what I found using Google Ads API v20.

Frequently asked questions

What is the Google Ads API v20 MCP server used for?

Google Ads API v20 is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Google Ads API v20 MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Google Ads API v20 with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Google Ads API v20 MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Google Ads API v20 connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Google Ads API v20 MCP to TypingMind?

Google Ads API v20 runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Google Ads API v20 MCP provide in TypingMind?

Google Ads API v20 exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Google Ads API v20 MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Google Ads API v20 requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇