Google Ads Mcp

io.github.davidmosiah由 GitHub 帳號 davidmosiah 發布v0.1.3更新於 Oct 24, 2026

Unofficial Google Ads MCP for campaigns, keywords, budgets, and gated mutations.

已驗證STDIO僅桌面資料與分析商業與電商

概覽

AI 產生的概覽

非官方本機 MCP 伺服器,讓助理讀取與分析 Google Ads 帳戶,並在明確啟用後暫停或恢復廣告活動與關鍵字。

可以做什麼
檢視帳戶、廣告活動、廣告群組、關鍵字與成效指標,並透過診斷工具查看連線狀態、能力清單與隱私稽核。執行工作流程輔助工具,例如每日成效報告與唯讀的浪費排查,依花費且無轉換排序關鍵字。管理共用的 Delx 設定與導引流程。處理 OAuth:取得授權連結、交換授權碼、撤銷存取。啟用寫入後,暫停或恢復關鍵字與廣告活動、設定關鍵字出價與廣告活動預算。
適用情境
適合讓助理回答 Google Ads 成效問題、產生每日或浪費報告,或在聊天用戶端內進行經審閱的小幅帳戶調整,例如暫停某個關鍵字或調整預算。
執行需求
透過 npx(Node.js)以 stdio 在本機執行,可選僅限本機回環的 HTTP 模式。需要 Google Ads 開發人員權杖以及 Google OAuth 用戶端 ID 與密鑰,並需執行一次設定精靈完成 OAuth 授權。多帳戶存取需要經理(MCC)客戶 ID。需要連線至 Google Ads API 的網路。
安裝前請注意
非官方產品,與 Google 無關聯。寫入工具預設關閉;啟用 GOOGLE_ADS_ALLOW_MUTATIONS 後助理可變更真實廣告花費、出價、預算與廣告活動狀態,且每次變更還需明確的使用者意圖。請審閱每項變更。開發人員權杖與用戶端密鑰儲存在本機設定檔,OAuth 權杖儲存在本機權杖檔。raw 隱私模式會回傳完整客戶 ID 與原始資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Google Ads Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

google-ads-mcp-unofficial

[CI] [npm] [npm downloads] [MIT] [MCP]

Unofficial Model Context Protocol server that lets AI agents read, analyze, and (gated) act on a Google Ads account — pause keywords, set bids, adjust budgets — without leaving your stack.

Unofficial. Not affiliated with Google. This is a local-first MCP server that speaks the Google Ads REST API directly. It does NOT include automated financial-account changes beyond what the Google Ads API allows. Always review proposed changes before enabling GOOGLE_ADS_ALLOW_MUTATIONS.


HTTP (v2 stateless)

Default is stdio. Optional Streamable HTTP — no session id, JSON responses, loopback only:

bash
npx -y google-ads-mcp-unofficial --http# GET  http://127.0.0.1:3000/health# POST http://127.0.0.1:3000/mcp   (sessionless)

Env: GOOGLE_ADS_MCP_HOST, GOOGLE_ADS_MCP_PORT, GOOGLE_ADS_MCP_TRANSPORT=http.

Quick start (30 seconds)

bash
npx -y google-ads-mcp-unofficial setup

The setup wizard collects your developer token + OAuth client, writes ~/.google-ads-mcp/config.json (chmod 600), then walks you through the OAuth dance via a local callback at http://127.0.0.1:3000/callback.

Verify:

bash
npx -y google-ads-mcp-unofficial doctor

Then add it to your agent (Claude Desktop, Cursor, Hermes, OpenClaw, Codex — see examples below).


What it does

22 tools across 6 categories.

CategoryCountExamples
Meta / diagnostic5google_ads_connection_status, google_ads_capabilities, google_ads_agent_manifest, google_ads_data_inventory, google_ads_privacy_audit
Shared Delx profile3google_ads_profile_get, google_ads_profile_update, google_ads_onboarding
Auth3google_ads_get_auth_url, google_ads_exchange_code, google_ads_revoke_access
Reads (always safe)8google_ads_list_accounts, google_ads_list_campaigns, google_ads_get_campaign, google_ads_list_ad_groups, google_ads_list_keywords, google_ads_get_account_performance, google_ads_get_campaign_performance, google_ads_get_keyword_performance
Workflow2google_ads_daily_report, google_ads_find_waste
Mutations (gated)6google_ads_pause_keyword, google_ads_resume_keyword, google_ads_set_keyword_bid_micros, google_ads_set_campaign_budget_micros, google_ads_pause_campaign, google_ads_resume_campaign

Full tool reference: see AGENTS.md.


Setup wizard

bash
npx -y google-ads-mcp-unofficial setup [--allow-mutations] [--client hermes|claude|cursor|...]

What it does:

  1. Prompts for: developer token, OAuth client id/secret, optional login_customer_id (MCC), redirect URI, privacy mode.
  2. Writes ~/.google-ads-mcp/config.json with chmod 600.
  3. Writes an MCP client config (e.g. merges into claude_desktop_config.json on macOS; writes a Hermes block and skill file for --client hermes).
  4. Runs the OAuth dance (unless --no-auth) by opening Google's consent screen and listening on 127.0.0.1:3000.

Mutations are off by default. --allow-mutations enables write tools. ASK THE USER before turning this on — it lets agents change campaigns, bids, budgets, and pause/resume keywords.


Auth model

This MCP requires two credentials:

  1. Google Ads Developer Token — from your MCC (Manager) account at https://ads.google.com/aw/apicenter. New tokens start in "Test account access" mode and need approval for production traffic.
  2. Google OAuth 2.0 Client — a "Desktop" or "Web" client created in Google Cloud Console. The single OAuth scope used is https://www.googleapis.com/auth/adwords.

⚠️ Refresh token gotcha: Google only returns a refresh_token on first consent or after you revoke the prior grant at https://myaccount.google.com/permissions. Our auth flow uses prompt=consent to maximize the chance Google returns one — but if your code-exchange response is missing refresh_token, the tool will tell you to revoke and retry.

VariablePurposeStored whereSecret?
GOOGLE_ADS_DEVELOPER_TOKENApproved developer token~/.google-ads-mcp/config.json or envyes
GOOGLE_ADS_CLIENT_IDOAuth client idlocal or envno
GOOGLE_ADS_CLIENT_SECRETOAuth client secretlocal or envyes
GOOGLE_ADS_LOGIN_CUSTOMER_IDMCC id (no dashes)local or envno
GOOGLE_ADS_REDIRECT_URIOAuth callbacklocal or env (default http://127.0.0.1:3000/callback)no
GOOGLE_ADS_PRIVACY_MODEsummary | structured | rawlocal or env (default structured)no
GOOGLE_ADS_ALLOW_MUTATIONSEnable write toolslocal or env (default false)no
GOOGLE_ADS_TOKEN_PATHOverride token storagelocal or env (default ~/.google-ads-mcp/tokens.json)no
GOOGLE_ADS_CACHEEnable SQLite cachelocal or env (default off)no
GOOGLE_ADS_CACHE_PATHOverride cache pathlocal or envno
GOOGLE_ADS_NO_RETRYDisable retry middlewareenv (default off)no

Privacy modes

ModeWhat you getCustomer id
summaryid + name + status fields onlypartial-redacted (123-***-7890)
structured (default)flat normalized rows with metricspartial-redacted
rawfull upstream Google Ads REST payloadfull

Pass privacy_mode per call to override the default per response.

Redaction matrix:

Fieldsummarystructuredraw
developer_tokenn/an/an/a (never returned)
access_token, refresh_token, client_secret[REDACTED] in all errors[REDACTED][REDACTED]
email addresses in error messages[REDACTED][REDACTED][REDACTED]
customer_id123-***-7890123-***-7890full
metrics (clicks, cost, etc.)droppedincludedincluded

⚠️ Mutation gating — read this

Default: mutations are DISABLED. Six tools are gated:

  • google_ads_pause_keyword / google_ads_resume_keyword
  • google_ads_set_keyword_bid_micros
  • google_ads_set_campaign_budget_micros
  • google_ads_pause_campaign / google_ads_resume_campaign

If an agent calls any of them without GOOGLE_ADS_ALLOW_MUTATIONS enabled, it gets:

Error: Write tools are disabled. To enable: re-run `google-ads-mcp-server setup --allow-mutations`or enable GOOGLE_ADS_ALLOW_MUTATIONS. ASK THE USER BEFORE TURNING THIS ON — it lets agentschange campaigns, bids, budgets, and pause/resume keywords.

Even with the env enabled, every mutation requires explicit_user_intent: true in the per-call arguments. And every mutation is logged to stderr with the resource name:

[google-ads-mcp] MUTATION pause_keyword {"resource_name":"customers/1234567890/adGroupCriteria/999~111222333"}

Read SECURITY.md for the threat model.


Agent client examples

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

json
{  "mcpServers": {    "google-ads": {      "command": "npx",      "args": ["-y", "google-ads-mcp-unofficial"]    }  }}

Then restart Claude Desktop.

Cursor / Windsurf

~/.cursor/mcp.json (or your IDE equivalent):

json
{  "mcpServers": {    "google-ads": {      "command": "npx",      "args": ["-y", "[email protected]"]    }  }}

Hermes

yaml
# ~/.hermes/config.yamlmcp_servers:  google-ads:    command: npx    args:      - -y      - [email protected]    timeout: 120    connect_timeout: 60    sampling:      enabled: false

Then /reload-mcp (do NOT restart the gateway for normal data access).

OpenClaw

~/.openclaw/mcp.servers.json:

json
{  "google-ads": {    "command": "npx",    "args": ["-y", "[email protected]"]  }}

Codex / TOML clients

See examples/codex.toml for the equivalent TOML block.


Workflow examples

1. Daily performance pulse

jsonc
// Agent asks: "How did my Google Ads do yesterday?"{  "name": "google_ads_daily_report",  "arguments": {    "customer_id": "1234567890",    "cpc_alert_threshold": 0.15  }}

Returns markdown with yesterday + 7d + 30d aggregates. If yesterday's CPC exceeds 0.15, the output gets an ALERT banner.

2. Identify waste (read-only)

jsonc
{  "name": "google_ads_find_waste",  "arguments": {    "customer_id": "1234567890",    "date_range": "LAST_30_DAYS",    "min_clicks": 5,    "min_cost_micros": 200000,    "zero_conversions_only": true  }}

Returns a ranked list of keywords matching "spent ≥ $0.20 with ≥5 clicks and 0 conversions" — but never pauses them.

3. Pause a single keyword (mutation, gated)

After the user confirms:

jsonc
{  "name": "google_ads_pause_keyword",  "arguments": {    "customer_id": "1234567890",    "ad_group_id": "999",    "criterion_id": "111222333",    "explicit_user_intent": true  }}

Troubleshooting

SymptomAction
Missing required Google Ads environment variablesRun setup or set the env vars listed in the error.
Google did not return a refresh_tokenRevoke at https://myaccount.google.com/permissions then re-run auth.
PERMISSION_DENIED on a readConfirm GOOGLE_ADS_LOGIN_CUSTOMER_ID matches the MCC that owns the target customer (no dashes).
Write tools are disabledExpected. Ask the user before enabling GOOGLE_ADS_ALLOW_MUTATIONS.
Hermes tools missing after config edit/reload-mcp or hermes mcp test google-ads. Do NOT restart the gateway.
Token file insecure perms warningchmod 600 ~/.google-ads-mcp/tokens.json

Support


Disclaimer

Unofficial integration. Not affiliated with Google. This MCP does not include automated financial-account changes beyond what the Google Ads REST API allows. Always review proposed changes before enabling GOOGLE_ADS_ALLOW_MUTATIONS. The author is not responsible for budget overruns, paused campaigns, or any other consequences of automated changes to your Google Ads account.

MIT-licensed.

Skill or MCP

Same package, two doors. MCP registers tools on stdio/HTTP. The skill can drive the same tools through the CLI when the client has no MCP:

bash
npx -y google-ads-mcp-unofficial call google_ads_connection_status --json '{}'

Copy skill/SKILL.md into your agent skills dir.

來源:README.md,提交 e415988

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分