google-ads-mcp

google-ads-mcp

An MCP server for the Google Ads API, providing 29 tools for campaign management, reporting, and optimization.

Category
访问服务器

README

googleadsagent-mcp

An MCP (Model Context Protocol) server + standalone agent SDK for the Google Ads API.
Built by googleadsagent.ai · MIT License

English | Français | Español | 中文 | Nederlands | Русский | 한국어


Install

# From PyPI (once published)
pip install googleadsagent-mcp

# From GitHub right now
pip install git+https://github.com/itallstartedwithaidea/google-ads-mcp.git

# With uv
uv add googleadsagent-mcp

# From source
git clone https://github.com/itallstartedwithaidea/google-ads-mcp.git && cd google-ads-mcp && pip install -e .

Works with every MCP client

Client Transport Config
Claude Code stdio .mcp.json in project root (included)
Claude Desktop stdio claude_desktop_config.example.json
Cursor / Windsurf stdio Settings → MCP → python -m ads_mcp.server
OpenAI Agents SDK stdio MCPServerStdio(command="python", args=["-m", "ads_mcp.server"])
LangChain stdio langchain-mcp-adapters
Remote / Cloud HTTP SSE python -m ads_mcp.server --http

Quick Start

# 1. Copy and fill credentials
cp .env.example .env

# 2. Validate environment
python scripts/validate.py

# 3a. Run as MCP server (stdio — Claude Desktop/Cursor/Claude Code)
python -m ads_mcp.server

# 3b. Run as MCP server (HTTP — remote agents)
python -m ads_mcp.server --http

# 3c. Run as standalone agent CLI
python scripts/cli.py
python scripts/cli.py --single "Show campaign performance for account 1234567890"

Claude Code

Place .mcp.json in your project root (already included):

{
  "mcpServers": {
    "google-ads": {
      "type": "stdio",
      "command": "python",
      "args": ["-m", "ads_mcp.server"],
      "env": {
        "GOOGLE_ADS_CREDENTIALS": "${GOOGLE_ADS_CREDENTIALS}",
        "GOOGLE_ADS_LOGIN_CUSTOMER_ID": "${GOOGLE_ADS_LOGIN_CUSTOMER_ID}"
      }
    }
  }
}

Claude Code auto-discovers .mcp.json. CLAUDE.md is written specifically for Claude Code to orient itself — it reads this first on every session.


Gemini CLI

Add to your project's .gemini/settings.json:

{
  "mcpServers": {
    "google-ads": {
      "command": "python",
      "args": ["-m", "ads_mcp.server"],
      "env": {
        "GOOGLE_ADS_CREDENTIALS": "/path/to/google-ads.yaml",
        "GOOGLE_ADS_LOGIN_CUSTOMER_ID": "1234567890"
      }
    }
  }
}

For the full Gemini CLI setup with Google Ads slash commands and agent skills, see gemini-cli-googleadsagent.

Remote option — if you deploy the buddy-agent on Cloudflare Workers, you can skip local credentials entirely and connect via SSE:

{
  "mcpServers": {
    "buddy-google-ads": {
      "url": "https://your-buddy-agent.workers.dev/sse"
    }
  }
}

OpenAI Agents SDK

from agents.mcp import MCPServerStdio
import os

server = MCPServerStdio(
    command="python",
    args=["-m", "ads_mcp.server"],
    env={
        "GOOGLE_ADS_CREDENTIALS": os.environ["GOOGLE_ADS_CREDENTIALS"],
        "GOOGLE_ADS_LOGIN_CUSTOMER_ID": os.environ.get("GOOGLE_ADS_LOGIN_CUSTOMER_ID", ""),
    }
)
# All 29 Google Ads tools automatically available

Tool Reference

Read Tools

list_accessible_customers · list_accounts · execute_gaql · get_campaign_performance get_keyword_performance · get_search_terms · get_ad_performance · get_account_budget_summary generate_keyword_ideas

Audit Tools

get_auction_insights · get_change_history · get_device_performance · get_geo_performance get_recommendations · get_pmax_performance · get_impression_share

Write Tools (dry-run by default — requires confirm=True)

update_campaign_budget · update_campaign_status · update_ad_group_status · update_keyword_bid add_keywords · add_negative_keywords · remove_negative_keyword · create_campaign create_ad_group · switch_bidding_strategy · generic_mutate

Doc Tools

get_gaql_reference · get_workflow_guide


Credentials

# Option 1: google-ads.yaml path (recommended)
GOOGLE_ADS_CREDENTIALS=/path/to/google-ads.yaml
GOOGLE_ADS_LOGIN_CUSTOMER_ID=123-456-7890

# Option 2: individual env vars
GOOGLE_ADS_DEVELOPER_TOKEN=...
GOOGLE_ADS_CLIENT_ID=...
GOOGLE_ADS_CLIENT_SECRET=...
GOOGLE_ADS_REFRESH_TOKEN=...
GOOGLE_ADS_LOGIN_CUSTOMER_ID=123-456-7890

Full credential setup guide: google-ads-api-agent README → Step 1A


v23 Service Coverage

Google Ads API v23 has 70+ services. Current status:

  • 29 tools implemented — core reporting, audit, write operations, doc references
  • 🔧 42 services planned — full roadmap in docs/SERVICES.md
  • ~20 out of scope — platform admin, deprecated, LSA-specific

Attribution

Google LLC (Apache 2.0)

google-ads Python client library — Copyright 2023 Google LLC
https://github.com/googleads/google-ads-python
All API calls in this package use the google-ads pip package published by Google. The v23 service definitions, proto types, and gRPC clients are Google's work.

googleads/google-ads-mcp — https://github.com/googleads/google-ads-mcp
Patterns: MCP singleton, search_stream + field_mask.paths

google-marketing-solutions/google_ads_mcp — https://github.com/google-marketing-solutions/google_ads_mcp
Patterns: doc-serving MCP tools, remote OAuth, omit_unselected_resource_names

Community (MIT)

cohnen/mcp-google-ads — https://github.com/cohnen/mcp-google-ads
Patterns: format_value proto serialization helper

gomarble-ai/google-ads-mcp-server — https://github.com/gomarble-ai/google-ads-mcp-server
Patterns: dual transport (stdio + HTTP), KeywordPlanIdeaService

itallstartedwithaidea/google-ads-api-agent — https://github.com/itallstartedwithaidea/google-ads-api-agent
Patterns: auction insights, change history, campaign creator, bidding strategy manager, negative keywords, geo targeting, PMax reporting, Filter-First Architecture

Full per-feature attribution table: docs/SERVICES.md


Related


License

MIT — see LICENSE
google-ads dependency: Apache 2.0, Copyright 2023 Google LLC
FastMCP: Apache 2.0


googleadsagent.ai · Google Ads API Docs · MCP Spec

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选