Token导航 LogoToken导航TokenDH.com
Google Ads MCP Rw logo
运维云端stdio官方级别未说明来源级核验

Google Ads MCP Rw

MCP Server

一个具有读写功能的Google Ads模型上下文协议服务器,允许用户管理广告活动、广告组和关键词等。

工具数

12

提示词数

0

GitHub Stars

2

资源数

0
广告管理PythonClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

MaxGhenis

提供方

MaxGhenis

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install google-ads-mcp

详细介绍

谷歌广告MCP服务器

一种用于Google广告的模型上下文协议(MCP)服务器 读写功能与谷歌官方的只读MCP服务器不同,这款服务器允许您实际管理您的广告系列。

特性

读取操作

  • list_accounts -列出所有可访问的Google Ads帐户
  • execute_query -对广告系列、广告组、关键字、指标等运行GAQL查询。

写入操作

  • create_campaign -创建新活动(为安全起见,默认暂停)
  • create_ad_group -在广告系列中创建广告组
  • add_keywords -将关键字添加到广告组
  • add_negative_keywords -添加负面关键字(活动或广告组级别)
  • create_responsive_search_ad -创建带有标题/描述的注册系统管理人
  • pause_campaign / enable_campaign -切换活动状态
  • pause_ad_group / enable_ad_group -切换广告组状态
  • update_ad_group_bid -更新CPC投标

安全功能

  • 干运行模式 -支持所有写入操作 dry_run=True 在不执行的情况下进行验证
  • 安全默认值 -新活动已创建暂停
  • 清晰的反馈 -所有操作都返回成功状态和错误消息

安装

使用紫外线(推荐)

# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install the package
uv pip install google-ads-mcp

# Or install from source
git clone https://github.com/maxghenis/google-ads-mcp-rw
cd google-ads-mcp
uv pip install -e .

使用pip

pip install google-ads-mcp

配置

1.创建Google Ads API凭据

  1. 谷歌广告API中心
  2. 创建开发人员令牌(或使用现有令牌)
  3. 在Google Cloud控制台中设置OAuth2凭据
  4. 生成刷新令牌

2.创建google-ads.yaml

创建一个 google-ads.yaml 使用您的凭据文件:

developer_token: YOUR_DEVELOPER_TOKEN
client_id: YOUR_CLIENT_ID.apps.googleusercontent.com
client_secret: YOUR_CLIENT_SECRET
refresh_token: YOUR_REFRESH_TOKEN
# MCC account ID if using multiple accounts (digits only, no dashes)
login_customer_id: "1234567890"
use_proto_plus: true

google-ads.yaml.示例 对于模板。

3.设置配置路径(可选)

默认情况下,服务器会查找 google-ads.yaml 在当前目录中。您可以指定自定义位置:

export GOOGLE_ADS_CONFIG_PATH=/path/to/your/google-ads.yaml

使用Claude Desktop

添加到您的Claude桌面配置(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):

{
  "mcpServers": {
    "google-ads": {
      "command": "uv",
      "args": ["run", "--with", "google-ads-mcp", "google-ads-mcp"],
      "env": {
        "GOOGLE_ADS_CONFIG_PATH": "/path/to/your/google-ads.yaml"
      }
    }
  }
}

或者,如果全局安装:

{
  "mcpServers": {
    "google-ads": {
      "command": "google-ads-mcp",
      "env": {
        "GOOGLE_ADS_CONFIG_PATH": "/path/to/your/google-ads.yaml"
      }
    }
  }
}

示例工作流

列出您的帐户

Use list_accounts to show me all my Google Ads accounts

查询活动绩效

Run this GAQL query for customer ID 1234567890:
SELECT campaign.name, metrics.clicks, metrics.impressions, metrics.cost_micros
FROM campaign
WHERE segments.date DURING LAST_7_DAYS
ORDER BY metrics.clicks DESC

使用广告组、关键字和广告创建新的活动

Create a new search campaign called "Q1 Promo" with a $20/day budget,
then add an ad group "Product Keywords" with keywords like "buy widgets",
"widget sale", "best widgets", and create a responsive search ad with
these headlines: "Buy Widgets Now", "50% Off Widgets", "Free Shipping"
and descriptions: "Shop our huge selection of widgets. Free shipping on orders over $50.",
"Premium quality widgets at the best prices. Order today!"
Final URL: https://example.com/widgets

添加负面关键字

Add these negative keywords to campaign 19638300165:
- "free"
- "cheap"
- "diy"
- "tutorial"

暂停表现不佳的广告组

First, show me all ad groups in campaign 19638300165 with their metrics.
Then pause any ad groups with CTR below 1%.

api参考

预算和投标价值

所有货币价值使用 微型 (货币单位的1/1000000):

  • 1,000,000 micros = $1.00
  • 2,500,000 micros = $2.50
  • 10,000,000 micros = $10.00

匹配类型

关键字支持三种匹配类型:

  • 宽广的 -显示相关搜索(默认)
  • 怎么翻译 -显示查询何时包含短语
  • 精确 -仅显示完全匹配的查询

客户ID

客户ID只能是数字,不能是破折号:

  • 对的: 1234567890
  • 不正确: 123-456-7890

发展

# Clone the repo
git clone https://github.com/maxghenis/google-ads-mcp-rw
cd google-ads-mcp

# Install dev dependencies
uv pip install -e ".[dev]"

# Run tests
pytest

# Format code
black src tests
ruff check --fix src tests

许可证

MIT许可证-请参阅 许可证 了解详情。

贡献

欢迎投稿!请打开问题或PR。

相关项目

目录标签

目录标签

广告管理PythonClaude本地部署GoogleAdsAPI营销自动化读写操作

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

12

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP