Google Ads MCP Server

Google Ads MCP Server

Provides read-only access to Google Ads account data including campaigns, ad groups, keywords, and performance reports. Enables querying via GAQL through an MCP interface.

Category
访问服务器

README

Google Ads MCP Server

A Model Context Protocol server that gives an LLM (Claude, Copilot, …) read-only access to Google Ads account data — campaigns, ad groups, keywords, search terms, segmented performance reports, bidding, budgets, conversions, Performance Max assets, labels, change history, impression share, plus an ad-hoc GAQL escape hatch.

It is a thin wrapper over Google Ads' GAQL search_stream API. Every tool takes a customer_id per request, so one running server can query any account the authenticated credentials can reach.

Two ways to run

Local (stdio) Remote (HTTP + OAuth)
Who it's for An individual on their own machine A team sharing one hosted instance
Auth to Google Ads Your own refresh-token credentials Each user signs in with their own Google account; their token is forwarded to the Ads API, so they only see accounts they personally can access
The server holds Your full credentials Only the developer token + the OAuth client
Clients Claude Desktop, VS Code/Copilot, any stdio MCP client Claude.ai web connector, Claude Desktop/Code
Setup This README, below docs/REMOTE_DEPLOY.md

Most people want Local. Start there.

What it does

41 read-only tools, grouped:

  • Accounts (5) — account discovery, metadata, conversion actions, labels
  • Reporting (24) — campaigns, ad groups, keywords, search terms, geo / device / demographic segments, Performance Max assets
  • Diagnostics (9) — Quality Score, ad extensions, bid strategies, budget pacing, change history, negative keywords, impression share
  • Query (2) — raw GAQL SELECT + a structured GAQL builder
  • Metadata (1) — selectable / filterable / sortable fields per GAQL resource

Full catalog with per-tool descriptions: docs/TOOLS.md.


Prerequisites

  • uv — Python package/runtime manager.
  • A Google Cloud project with the Google Ads API enabled.
  • A Google Ads developer token (how to get one).
  • An OAuth 2.0 client in that project (Desktop or Web type) — used to mint your refresh token.

This project ships no credentials and no hosted service. You bring your own Google Cloud project, OAuth client, and developer token.


Local setup (stdio)

1. Clone and install

git clone https://github.com/VidenGrowth/public-google-ads-mcp google-ads-mcp
cd google-ads-mcp
uv sync

2. Configure credentials

cp .env.example .env
# edit .env

Fill in (see .env.example for the full list):

  • GOOGLE_ADS_DEVELOPER_TOKEN
  • GOOGLE_ADS_CLIENT_ID, GOOGLE_ADS_CLIENT_SECRET
  • GOOGLE_ADS_REFRESH_TOKEN (generate it in the next step)
  • GOOGLE_ADS_LOGIN_CUSTOMER_ID (optional — only when operating through a manager/MCC account; digits, no dashes)

The target customer_id is not in .env; the agent passes it per request.

3. Generate a refresh token

uv run auth/generate_refresh_token.py -c client_secret.json

Sign in with a Google account that can access the Ads accounts you want, then paste the printed token into .env as GOOGLE_ADS_REFRESH_TOKEN. Full walkthrough (incl. a Windows helper): auth/README.md.

4. Test locally

uv run python scripts/smoke_test.py

Expected: ✓ server wired up — 41 tools registered, followed by get_accessible_accounts returning your accounts. If credentials are missing you'll get a clear <error>{"error":"Google Ads client not configured. …"}</error> instead — fix .env and re-run.

Run the test suite anytime with:

uv run --with pytest pytest tests/ -q

5. Connect a client

Claude Desktop (claude_desktop_config.json — macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\):

{
  "mcpServers": {
    "google-ads": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/google-ads-mcp", "run", "google-ads-mcp"]
    }
  }
}

Restart Claude Desktop fully (quit from the tray/menu, not just close the window).

Then enable Chat > MCP in settings, run MCP: Start Server from the Command


Example prompts

Once connected, try (replace the ID with one of your accounts):

  • "Show me all campaigns for customer 1234567890"
  • "Find wasted spend in search terms for customer 1234567890"
  • "Which keywords have quality scores below 5 for customer 1234567890?"
  • "Compare device and geographic performance for customer 1234567890 over the last 30 days"
  • "Show the age + gender breakdown for customer 1234567890"
  • "Is customer 1234567890 on pace to spend its budget this month?"

Parameter conventions (date ranges, ID/name filters, status filters, sorting) are documented in docs/TOOLS_DESIGN.md.


Remote deploy (teams)

To host one shared instance where each teammate signs in with their own Google account — no per-user install, and everyone only sees the Ads accounts they can access — deploy the HTTP transport with Google OAuth. The server authenticates users via an OAuth proxy (one-click connect from Claude.ai, no pasted secrets) and forwards each user's token to the Ads API.

Full guide: docs/REMOTE_DEPLOY.md.


How authentication works

  • Local (stdio): the server uses your refresh-token credentials. There is no MCP-layer auth — the server runs on your machine under your control.
  • Remote (HTTP): the server uses FastMCP's Google OAuth proxy. Each request carries a per-user Google token (with the adwords scope) that is forwarded to the Google Ads API, so authorization is whatever that user's Google account can do. The server stores no user credentials — only the operator's developer token and the OAuth client_id/secret.

Architecture

See docs/PROJECT_MAP.md for a directory tour and request flow, and docs/TOOLS_DESIGN.md for the design conventions every tool follows.

License

MIT.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选