google-ads-mcp

MCP数据服务

提供方 ameydabhade

数据服务 stdio · 本地进程 OAuth 授权 社区 / 第三方 Claude DesktopClaudeZed
查看接入方式

A Model Context Protocol (MCP) server for Google Ads API integration that allows AI assistants to interact with Google Ads data through standardized MCP tools.

一句话选型结论

按资料字段整理

google-ads-mcp 属于数据服务类 MCP 服务器,stdio · 本地进程,OAuth 授权,可直接接入 Claude Desktop、Claude、Zed,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类数据服务 传输方式stdio · 本地进程 鉴权OAuth 授权 部署方式本地部署
GitHub 星标 1 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

数据服务
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

Local Deployment Ad Management API Integration TypeScript AI Assistant Data Analytics Marketing Automation

支持客户端

适用场景

Local DeploymentAd ManagementAPI Integration

安装与配置

stdio · 本地进程 OAuth 授权
客户端在本机拉起子进程,数据不出本机
node /path/to/mcp-google-ads/dist/index.js

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 node,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
数据库查询

用自然语言查库、取数,不用手写 SQL。

数据同步与清洗

把多来源数据拉到一处做整理。

报表取数

按口径快速拉出统计结果。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、Zed,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在数据服务场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
google-ads-mcp当前 未标注 stdio · 本地进程 本地部署 有 2026-08-07
Memory 9d25f64e 9 未标注 未标注 无 2026-05-17
Getzep MCP 9 stdio · 本地进程 本地部署 有 2026-05-17
anything-llm 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Prisma MCP Server 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Astr Bot 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

数据服务
字段来自项目仓库与公开索引,中文说明由本站标注
提供方ameydabhade上游标注的维护方 ameydabhade
分类数据服务本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · node本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-08-07上游最后核验时间

详细介绍

16.4 KB
来自项目仓库与上游目录的原文,未做删改

MCP Google Ads Server

A Model Context Protocol (MCP) server for Google Ads API integration. This server allows AI assistants like Claude to interact with Google Ads data through standardized MCP tools.

Features

  • Campaign Management: Retrieve campaigns with performance metrics
  • Ad Groups & Keywords: Fetch ad groups, keywords, and search terms
  • Performance Analytics: Geographic, demographic, and time-based performance data
  • Account Management: List accounts, get customer details
  • Asset Management: Access ads, creatives, and assets
  • Write Operations: Create and update budgets, campaigns, ad groups, keywords and ads — opt-in, with dry-run and spend caps
  • Dual Transport: Supports both HTTP and stdio modes

Quick Start```bash

Clone the repository

git clone https://github.com/ameydabhade/google-ads-mcp.git
cd google-ads-mcp

Install dependencies

npm install

Configure credentials

cp .env.example .env

Edit .env with your Google Ads API credentials

Build and start

npm run build
npm run start:server


## Prerequisites

Before using this MCP server, you need:

1. **Google Cloud Project** with Google Ads API enabled
2. **OAuth 2.0 Credentials** (Client ID and Secret)
3. **Google Ads Developer Token** (Test or Production)
4. **Google Ads Account** to query

## Setup Guide

### Step 1: Create Google Cloud Project

1. Go to Google Cloud Console
2. Create a new project or select an existing one
3. Enable the **Google Ads API**:
   - Navigate to "APIs & Services" > "Library"
   - Search for "Google Ads API"
   - Click "Enable"

### Step 2: Create OAuth 2.0 Credentials

1. Go to "APIs & Services" > "Credentials"
2. Click "Create Credentials" > "OAuth 2.0 Client IDs"
3. Select "Web application" as the application type
4. Under "Authorized redirect URIs", add `http://localhost:8085`
   (this is where the helper script in Step 4 receives the authorization code)
5. Note your **Client ID** and **Client Secret**

### Step 3: Get Developer Token

1. Sign in to Google Ads
2. Go to "Tools & Settings" > "API Center"
3. If you don't have a developer token, apply for one
4. For testing, use the "Test Account" developer token
5. For production, apply for Basic or Standard access

### Step 4: Generate Refresh Token

A developer token on its own is **not** enough to call the Google Ads API — every
request also needs an OAuth token, even for a single-user setup. This is a
one-time step: you generate one refresh token, put it in `.env`, and reuse it
indefinitely.

Put your client ID and secret in `.env` first, then run:```bash
npm run oauth:generate

The script opens your browser, captures the authorization code on
http://localhost:8085, exchanges it, and prints the refresh token to paste
into .env. If port 8085 is taken, set OAUTH_HELPER_PORT to a free port (and
add the matching redirect URI in the Google Cloud console).

Doing it manually

  1. Build an authorization URL (the redirect URI must match one registered on
    your OAuth client):```
    https://accounts.google.com/o/oauth2/v2/auth?client_id=YOUR_CLIENT_ID&redirect_uri=http://localhost:8085&scope=https://www.googleapis.com/auth/adwords&response_type=code&access_type=offline&prompt=consent

2. Visit it and authorize access
3. Copy the `code` query parameter off the URL you land on
4. Exchange it for tokens:```bash
curl -X POST https://oauth2.googleapis.com/token \
  -d "code=YOUR_AUTH_CODE" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET" \
  -d "redirect_uri=http://localhost:8085" \
  -d "grant_type=authorization_code"
  1. Save the refresh_token from the response

access_type=offline and prompt=consent are both required — without them
Google returns an access token but no refresh token. Note that the older
out-of-band flow (urn:ietf:wg:oauth:2.0:oob) was discontinued in 2022 and no
longer works.

Step 5: Configure Environment```bash

cp .env.example .env


Edit `.env` with your credentials:```env
GOOGLE_ADS_CLIENT_ID=your_client_id.apps.googleusercontent.com
GOOGLE_ADS_CLIENT_SECRET=your_client_secret
GOOGLE_ADS_DEVELOPER_TOKEN=your_developer_token
GOOGLE_ADS_REFRESH_TOKEN=your_refresh_token
GOOGLE_ADS_CUSTOMER_ID=1234567890

Installation```bash

Install dependencies

npm install

Build the project

npm run build

Start the server (HTTP mode)

npm run start:server

Or run in development mode

npm run dev:server


## Usage

### HTTP Server Mode

The server exposes an HTTP endpoint at `http://localhost:3000/mcp` that accepts JSON-RPC requests.```bash
# Start the server
npm run start:server

# Test with curl
curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/list",
    "id": 1
  }'

Stdio Mode (Claude Desktop)

For use with Claude Desktop, add to your config:```json
{
"mcpServers": {
"google-ads": {
"command": "node",
"args": ["/path/to/mcp-google-ads/dist/index.js"],
"env": {
"GOOGLE_ADS_CLIENT_ID": "your_client_id",
"GOOGLE_ADS_CLIENT_SECRET": "your_client_secret",
"GOOGLE_ADS_DEVELOPER_TOKEN": "your_developer_token",
"GOOGLE_ADS_REFRESH_TOKEN": "your_refresh_token",
"GOOGLE_ADS_CUSTOMER_ID": "1234567890",
"GOOGLE_ADS_ENABLE_WRITES": "false"
}
}
}
}


Set `GOOGLE_ADS_ENABLE_WRITES` to `"true"` to expose the write tools — see
Write Operations.

## Available Tools

### Read Tools

| Tool | Description |
|------|-------------|
| `get_accounts` | List all accessible Google Ads accounts |
| `get_campaigns` | Get campaigns with performance metrics |
| `get_ad_groups` | Get ad groups with metrics |
| `get_keywords` | Get keywords with quality scores |
| `get_search_terms` | Get search queries that triggered ads, with the matching keyword and its criterion ID |
| `get_auction_insights` | Competitor domains in the same auctions (impression share, overlap, outranking) |
| `get_geographic_performance` | Performance by location |
| `get_audience_demographics` | Age and gender performance |
| `get_ad_schedule_performance` | Performance by day/hour |
| `get_account_summary` | Overall account metrics |
| `get_customer_details` | Account configuration |
| `get_campaign_details` | Single campaign config |
| `get_ad_group_details` | Single ad group config |
| `get_ad_details` | Ad creative details |
| `get_asset_by_id` | Asset (image/video) details |
| `get_user_list_details` | Audience list details |
| `get_conversion_action_details` | Conversion tracking config |
| `get_constants` | Reference data (geo, language, etc.) |
| `healthcheck` | Test API connectivity |

### Write Tools

> These change live campaigns and spend real money. They are **disabled by default** — see Write Operations.

| Tool | Description |
|------|-------------|
| `create_campaign_budget` | Create a campaign budget |
| `update_campaign_budget` | Change a budget's amount, name or delivery method |
| `create_campaign` | Create a campaign against an existing budget |
| `update_campaign` | Change name, status, dates, budget or bidding targets |
| `remove_campaigns` | Permanently remove campaigns |
| `create_ad_group` | Create an ad group in a campaign |
| `update_ad_group` | Change name, status or default CPC bid |
| `remove_ad_groups` | Permanently remove ad groups |
| `add_keywords` | Add positive keywords to an ad group |
| `update_keywords` | Change keyword status or bids |
| `remove_keywords` | Permanently remove keywords |
| `add_negative_keywords` | Add negative keywords at campaign or ad group level |
| `create_responsive_search_ad` | Create a responsive search ad |
| `update_ad_status` | Enable, pause or remove ads |

## Auction Insights

`get_auction_insights` returns the same competitor view as the Auction Insights
report in the Google Ads UI, via `segments.auction_insight_domain`.```json
{
  "name": "get_auction_insights",
  "arguments": {
    "date_range": { "start_date": "2026-01-01", "end_date": "2026-01-31" },
    "level": "campaign",
    "sort_by": "impression_share"
  }
}

Rows are grouped by competitor domain, averaging each metric across the
campaigns (or ad groups) the domain appeared in; appears_in keeps the
per-campaign breakdown. Metrics come back as 0-1 fractions, with the same
figures as percentages under metrics_percent.

Metric Meaning
impression_share Share of available impressions that competitor won
overlap_rate How often they appeared when you also appeared
position_above_rate How often they ranked above you when both appeared
outranking_share How often you ranked above them, or showed when they didn't
top_of_page_rate How often their ad appeared above the organic results
absolute_top_of_page_rate How often their ad was the very first ad

Constraints worth knowing: Auction Insights covers Search and Shopping
campaigns only
, and your own account shows up as one of the domains. Google
restricts which segments can be combined with auction_insight_domain, so this
tool deliberately does not segment by date.

Finding and excluding wasted spend

get_search_terms reports the keyword that matched each search term, which
pairs with the write tools:

  1. get_search_terms — find terms with cost and no conversions. Each term
    carries a keywords array with keyword_text, match_type and
    criterion_id, ranked by impressions.
  2. add_negative_keywords — exclude the bad terms, campaign- or ad-group-wide.
  3. update_keywords — or pause the matching keyword outright using the
    criterion_id from step 1.

Because the query is segmented by keyword, a single search term can be matched
by several keywords; all of them appear in keywords, while the scalar
keyword_text / match_type fields resolve to whichever drove the most
impressions.

Write Operations

Writes are opt-in. With GOOGLE_ADS_ENABLE_WRITES unset or false the write tools
are not advertised in tools/list at all, and calling one returns a
WRITE_DISABLED error.```env

Required to expose the write tools

GOOGLE_ADS_ENABLE_WRITES=true

Optional: make every write a dry run unless dry_run=false is passed

GOOGLE_ADS_WRITE_DRY_RUN_DEFAULT=false

Optional spend ceilings in micros (1 unit = 1,000,000 micros)

GOOGLE_ADS_MAX_BUDGET_MICROS=100000000
GOOGLE_ADS_MAX_BID_MICROS=10000000


Toggling `GOOGLE_ADS_ENABLE_WRITES` takes effect on the next client reconnect,
since MCP clients cache the tool list.

### Safety model

- **Off by default.** Nothing can be mutated until you opt in.
- **Dry run.** Every write tool accepts `dry_run: true`, which maps to the Google
  Ads API's `validate_only` flag: the change is validated server-side but not
  applied. Dry runs return no resource names — that is the API's behaviour, not
  an error.
- **Atomic batches.** `partial_failure` is always false, so a batch either
  applies cleanly or fails entirely. You never get half a change.
- **Paused by default.** `create_campaign`, `create_ad_group` and
  `create_responsive_search_ad` create PAUSED entities unless you explicitly ask
  for `ENABLED`, so nothing starts serving as a side effect.
- **Spend caps.** `GOOGLE_ADS_MAX_BUDGET_MICROS` / `GOOGLE_ADS_MAX_BID_MICROS`
  reject over-limit budgets and bids locally, before the API call.
- **Tool annotations.** Write tools carry `readOnlyHint: false`; the irreversible
  ones (`remove_*`, `update_ad_status`) carry `destructiveHint: true` so clients
  can prompt for confirmation.

### Amounts

Monetary fields accept either micros or currency units — pass one, not both:```json
{ "amount_micros": 50000000 }
{ "amount": 50.00 }

Examples

Pause a campaign:```json
{
"method": "tools/call",
"params": {
"name": "update_campaign",
"arguments": { "campaign_id": "123456789", "status": "PAUSED" }
}
}


Validate a budget increase without applying it:```json
{
  "method": "tools/call",
  "params": {
    "name": "update_campaign_budget",
    "arguments": { "budget_id": "987654321", "amount": 75.00, "dry_run": true }
  }
}

Build a paused search campaign end to end:```json
{ "name": "create_campaign_budget", "arguments": { "name": "Q1 Budget", "amount": 50.00 } }
{ "name": "create_campaign", "arguments": { "name": "Q1 Search", "budget_id": "<from above>",
"bidding_strategy": { "type": "TARGET_CPA", "target_cpa": 25.00 } } }
{ "name": "create_ad_group", "arguments": { "campaign_id": "<from above>", "name": "Shoes", "cpc_bid": 1.50 } }
{ "name": "add_keywords", "arguments": { "ad_group_id": "<from above>",
"keywords": [{ "text": "running shoes", "match_type": "PHRASE" }] } }
{ "name": "create_responsive_search_ad", "arguments": { "ad_group_id": "<from above>",
"final_urls": ["https://example.com"],
"headlines": ["Running Shoes", "Free Shipping", "Shop Today"],
"descriptions": ["Top brands at great prices.", "Free returns within 30 days."] } }


Add negative keywords across a whole campaign:```json
{
  &quot;name&quot;: &quot;add_negative_keywords&quot;,
  &quot;arguments&quot;: {
    &quot;campaign_id&quot;: &quot;123456789&quot;,
    &quot;keywords&quot;: [{ &quot;text&quot;: &quot;free&quot;, &quot;match_type&quot;: &quot;BROAD&quot; }]
  }
}

Write response format```json

{
"operation": "update_campaign",
"dry_run": false,
"customer_id": "1234567890",
"requested_count": 1,
"applied_count": 1,
"results": [
{ "resource_name": "customers/1234567890/campaigns/123456789", "id": "123456789" }
],
"metadata": { "timestamp": "2026-01-15T10:30:00.000Z" }
}


## Tool Input Format

All tools accept credentials in this format:```json
{
  &quot;user_credentials&quot;: {
    &quot;refresh_token&quot;: &quot;your_refresh_token&quot;,
    &quot;customer_id&quot;: &quot;1234567890&quot;
  },
  &quot;date_range&quot;: {
    &quot;start_date&quot;: &quot;2024-01-01&quot;,
    &quot;end_date&quot;: &quot;2024-01-31&quot;
  }
}

If you've set GOOGLE_ADS_REFRESH_TOKEN and GOOGLE_ADS_CUSTOMER_ID in your environment, you can omit those fields.

Example Queries

Get all campaigns for last 30 days```json

{
"method": "tools/call",
"params": {
"name": "get_campaigns",
"arguments": {
"date_range": {
"start_date": "2024-12-01",
"end_date": "2024-12-31"
}
}
}
}


### Get search terms with pagination```json
{
  &quot;method&quot;: &quot;tools/call&quot;,
  &quot;params&quot;: {
    &quot;name&quot;: &quot;get_search_terms&quot;,
    &quot;arguments&quot;: {
      &quot;date_range&quot;: {
        &quot;start_date&quot;: &quot;2024-12-01&quot;,
        &quot;end_date&quot;: &quot;2024-12-31&quot;
      },
      &quot;paging&quot;: {
        &quot;limit&quot;: 100,
        &quot;offset&quot;: 0
      }
    }
  }
}

Docker Support```bash

Build the image

docker build -t mcp-google-ads .

Run with environment variables

docker run -p 3000:3000 \
-e GOOGLE_ADS_CLIENT_ID=your_client_id \
-e GOOGLE_ADS_CLIENT_SECRET=your_client_secret \
-e GOOGLE_ADS_DEVELOPER_TOKEN=your_developer_token \
-e GOOGLE_ADS_REFRESH_TOKEN=your_refresh_token \
mcp-google-ads


## Development```bash
# Run in development mode with hot reload
npm run dev:server

# Run tests
npm test

# Lint and format
npm run lint

Troubleshooting

"Invalid Customer ID"

  • Ensure the customer ID is 10 digits with no dashes
  • Verify you have access to the account

"Permission Denied"

  • Check that the OAuth user has access to the Google Ads account
  • Ensure the developer token is approved for the account level

"Authentication Failed"

  • Regenerate your refresh token
  • Verify client ID and secret are correct

"Developer Token Not Approved"

  • For production, apply for Basic or Standard access
  • Test accounts don't count against quotas

"Write operations are disabled" / write tools missing

  • Set GOOGLE_ADS_ENABLE_WRITES=true in the server's environment
  • Restart the server and reconnect the MCP client — clients cache tools/list

A dry run returned no resource names

  • Expected. validate_only requests are not applied, so the API returns no
    resource names and applied_count is 0. Re-run with dry_run: false to apply.

"exceeds the configured GOOGLE_ADS_MAX_BUDGET_MICROS cap"

  • The requested budget or bid is above your local ceiling. Raise or unset
    GOOGLE_ADS_MAX_BUDGET_MICROS / GOOGLE_ADS_MAX_BID_MICROS.
  • Remember these are micros: 100 units/day is 100000000.

API Rate Limits

Google Ads API has rate limits:
- 10,000 requests per day (Basic)
- 15,000 requests per day (Standard)

The server includes automatic retry logic for transient errors.

Related Projects

  • Model Context Protocol - The protocol specification
  • MCP Servers - Official MCP servers
  • Google Ads API - Google Ads API documentation

License

MIT

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Support

  • Open an issue for bug reports or feature requests
  • Star the repo if you find it useful!

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
google-ads-mcp 怎么安装?

在客户端按下面的安装命令接入:node /path/to/mcp-google-ads/dist/index.js。装完在客户端配置里引用同一个包或端点。

google-ads-mcp 怎么在 Claude Desktop、Claude、Zed 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

google-ads-mcp 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

google-ads-mcp 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

google-ads-mcp 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、Zed;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

google-ads-mcp 能提供哪些能力?

资料显示能力标签包括 Local Deployment、Ad Management、API Integration、TypeScript、AI Assistant、Data Analytics。具体工具清单以官方文档为准。

google-ads-mcp 需要什么运行环境?

运行时为 node;属于本地进程,需要在本机装好运行环境。

google-ads-mcp 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-08-07。