Google Ads MCP Server 7e248015

MCP安全风控

提供方 EmilyThaHuman

安全风控 未标注 OAuth 授权 社区 / 第三方 Claude

一个支持OAuth 2.0认证的Google Ads集成模型上下文协议服务器,提供广告系列管理、性能指标获取和账户统计功能。

一句话选型结论

按资料字段整理

Google Ads MCP Server 7e248015 属于安全风控类 MCP 服务器,传输方式未标注,OAuth 授权,可直接接入 Claude,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类安全风控 传输方式未标注 鉴权OAuth 授权 部署方式未标注
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 3 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

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

能力标签

支持客户端

适用场景

广告管理本地部署OAuth2.0认证GoogleAdsAPITypeScript开发服务器

安装与配置

未标注 OAuth 授权
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

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

  3. 3
    写入客户端配置

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

  4. 4
    验证是否可用

    连接成功后客户端会列出约 3 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
资产与漏洞排查

盘点资产、扫漏洞、看暴露面。

日志与审计

汇总日志、查异常行为。

合规检查

按规则检查配置与权限是否合规。

选择建议

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

值得选的地方

  • 资料标注 3 个工具,职责相对集中,接入后不容易误操作。
  • 已适配 Claude,换客户端不用重新研究配置。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

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

不太适合

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

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Google Ads MCP Server 7e248015当前 3 未标注 未标注 无 2026-05-17
Cyber Strike AI 75 未标注 未标注 无 2026-05-17
mcp-for-beginners 未标注 stdio · 本地进程 本地部署 有 2026-04-13
casdoor 未标注 stdio · 本地进程 本地部署 有 2026-04-12
kubeshark 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Modelcontextprotocol C22988b0 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

安全风控
字段来自项目仓库与公开索引,中文说明由本站标注
提供方EmilyThaHuman上游标注的维护方 EmilyThaHuman
分类安全风控本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

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

Google Ads MCP Server

A Model Context Protocol (MCP) server for Google Ads integration with OAuth 2.0 authentication.

Features

  • OAuth 2.0 Authentication: Secure Google OAuth flow with automatic token refresh
  • MCP Protocol Support: Full implementation of the Model Context Protocol
  • Google Ads Operations:
  • List campaigns with filtering
  • Get campaign performance metrics
  • Get account summary and statistics
  • Session Management: Persistent sessions with automatic token refresh
  • TypeScript: Fully typed with TypeScript for better development experience
  • Google Ads API v18: Latest version of the Google Ads API

Prerequisites

  • Node.js 18+
  • Google Cloud Project with Google Ads API enabled
  • OAuth 2.0 credentials (Client ID and Client Secret)
  • Google Ads Developer Token

Setup

1. Google Cloud & Google Ads Configuration

Google Cloud Console Setup

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Google Ads API
  4. Create OAuth 2.0 credentials:
    - Application type: Web application
    - Authorized redirect URIs: http://localhost:3003/oauth/callback
  5. Copy your Client ID and Client Secret

Google Ads API Setup

  1. Go to Google Ads API Center
  2. Apply for a Developer Token (required for API access)
  3. Wait for approval (can take 24-48 hours)
  4. Once approved, copy your Developer Token

2. Installation```bash

Clone or navigate to the project directory

cd google-ads-mcp-server

Install dependencies

npm install


### 3. Configuration

Create a `.env` file in the root directory:```bash
cp env.example .env

Edit .env with your configuration:```env

Server Configuration

PORT=3003
NODE_ENV=development

Google OAuth Configuration

GOOGLE_CLIENT_ID=your_google_client_id_here
GOOGLE_CLIENT_SECRET=your_google_client_secret_here
GOOGLE_REDIRECT_URI=http://localhost:3003/oauth/callback

Google Ads API Configuration

GOOGLE_ADS_DEVELOPER_TOKEN=your_developer_token_here

Frontend URL (where to redirect after OAuth)

FRONTEND_URL=http://localhost:5173

MCP Server Configuration

MCP_SERVER_NAME=google-ads-mcp-server
MCP_SERVER_VERSION=1.0.0


## Usage

### Development Mode```bash
npm run dev

Production Mode```bash

Build

npm run build

Start

npm start


## API Endpoints

### Health Check```
GET /health

OAuth Flow

1. Initiate Authorization```

GET /oauth/authorize?userId={userId}&state={state}


Response:```json
{
  "authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth?...",
  "state": "your-state-value"
}

2. OAuth Callback (handled automatically)```

GET /oauth/callback?code={code}&state={state}


#### 3. Refresh Token```
POST /oauth/refresh
Content-Type: application/json

{
  "userId": "user123",
  "refreshToken": "refresh_token_here"
}

4. Disconnect```

POST /oauth/disconnect
Content-Type: application/json

{
"userId": "user123"
}


### MCP Endpoint```
POST /mcp
GET /mcp
DELETE /mcp

The MCP endpoint follows the Model Context Protocol specification for tool execution.

MCP Tools

1. google_ads_list_campaigns

List Google Ads campaigns with optional filtering.

Input:```json
{
"userId": "user123",
"customerId": "1234567890",
"status": "ALL",
"limit": 50
}


**Parameters:**
- `userId` (string, required): User ID for authentication
- `customerId` (string, required): Google Ads customer ID without hyphens
- `status` (enum, optional): Filter by campaign status - 'ALL', 'ENABLED', or 'PAUSED' (default: 'ALL')
- `limit` (number, optional): Maximum campaigns to return, 1-10000 (default: 50)

**Output:**```json
{
  "campaigns": [
    {
      "id": "123456789",
      "name": "Summer Campaign",
      "status": "ENABLED",
      "advertisingChannelType": "SEARCH",
      "startDate": "2024-01-01",
      "endDate": "2024-12-31",
      "budgetAmountMicros": "10000000"
    }
  ],
  "count": 1,
  "customerId": "1234567890"
}

2. google_ads_campaign_metrics

Get performance metrics for Google Ads campaigns.

Input:```json
{
"userId": "user123",
"customerId": "1234567890",
"campaignIds": ["123456789", "987654321"],
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"metrics": ["impressions", "clicks", "conversions", "cost_micros"]
}


**Parameters:**
- `userId` (string, required): User ID for authentication
- `customerId` (string, required): Google Ads customer ID without hyphens
- `campaignIds` (array, optional): List of campaign IDs to get metrics for (empty for all campaigns)
- `startDate` (string, optional): Start date in YYYY-MM-DD format (default: 30 days ago)
- `endDate` (string, optional): End date in YYYY-MM-DD format (default: today)
- `metrics` (array, optional): Metrics to retrieve (default: impressions, clicks, conversions, cost_micros)

**Available Metrics:**
- `impressions` - Number of times ads were shown
- `clicks` - Number of clicks on ads
- `conversions` - Number of conversions
- `cost_micros` - Cost in micros (divide by 1,000,000 for actual cost)
- `average_cpc` - Average cost per click
- `ctr` - Click-through rate

**Output:**```json
{
  "campaignMetrics": [
    {
      "campaignId": "123456789",
      "campaignName": "Summer Campaign",
      "impressions": 10000,
      "clicks": 500,
      "conversions": 50,
      "cost_micros": 5000000
    }
  ],
  "customerId": "1234567890",
  "dateRange": {
    "startDate": "20240101",
    "endDate": "20240131"
  }
}

3. google_ads_account_summary

Get overall account summary and performance metrics.

Input:```json
{
"userId": "user123",
"customerId": "1234567890",
"startDate": "2024-01-01",
"endDate": "2024-01-31"
}


**Parameters:**
- `userId` (string, required): User ID for authentication
- `customerId` (string, required): Google Ads customer ID without hyphens
- `startDate` (string, optional): Start date in YYYY-MM-DD format (default: 30 days ago)
- `endDate` (string, optional): End date in YYYY-MM-DD format (default: today)

**Output:**```json
{
  "summary": {
    "customerId": "1234567890",
    "accountName": "My Business Account",
    "totalCampaigns": 10,
    "activeCampaigns": 7,
    "pausedCampaigns": 3,
    "metrics": {
      "impressions": 50000,
      "clicks": 2500,
      "conversions": 250,
      "costMicros": 25000000,
      "averageCpc": 10000,
      "ctr": 0.05
    },
    "dateRange": {
      "startDate": "20240101",
      "endDate": "20240131"
    }
  }
}

Integration with ZeroTwoApi

To integrate this Google Ads MCP server with your ZeroTwoApi backend:

1. Update Frontend OAuth Configuration

In ZeroTwo/src/services/oauthProviders.js, add the Google Ads configuration:```javascript
google_ads: {
provider: "google_ads",
clientId: import.meta.env.VITE_GOOGLE_CLIENT_ID,
flowType: OAuthFlowType.REDIRECT,
scopes: [
"https://www.googleapis.com/auth/adwords",
],
authEndpoint: "http://localhost:3003/oauth/authorize",
backendExchangeEndpoint: "/api/auth/google-ads/callback",
backendRefreshEndpoint: "/api/auth/google-ads/refresh",
mcpEnabled: true,
mcpEndpoint: "http://localhost:3003/mcp",
},


### 2. Update Backend Auth Routes

The existing Google Ads auth routes in `ZeroTwoApi/routes/auth/google-ads.js` are already compatible. Just ensure the endpoints match:

- `/api/auth/google-ads/callback` - Exchange authorization code
- `/api/auth/google-ads/refresh` - Refresh access token

### 3. Update MCP Client Configuration

In `ZeroTwoApi/lib/mcp-client.js`, add Google Ads MCP support:```javascript
// For Google Ads MCP
if (integration.provider === "google_ads") {
  endpointUrl = "http://localhost:3003/mcp";

  // Use OAuth token from profile
  if (integration.oauth_token) {
    transportOptions.headers = {
      Authorization: `Bearer ${integration.oauth_token}`,
      ...integration.headers,
    };
  }
}

4. Create MCP Integration

After OAuth authentication, create an MCP integration in the database:```sql
INSERT INTO mcp_integrations (
user_id,
name,
provider,
endpoint,
mcp_type,
connection_status,
auth_type,
description
) VALUES (
'user_id_here',
'Google Ads',
'google_ads',
'http://localhost:3003/mcp',
'remote_mcp',
'connected',
'oauth',
'Google Ads integration via MCP'
);


### 5. Update Tool Definitions

In `ZeroTwoApi/lib/agents/tools/`, create or update the Google Ads tool definitions to call the MCP server:```javascript
// Example tool definition
{
  name: "google_ads_list_campaigns",
  description: "List Google Ads campaigns",
  inputSchema: {
    type: "object",
    properties: {
      customerId: {
        type: "string",
        description: "Google Ads customer ID (without hyphens)",
      },
      status: {
        type: "string",
        enum: ["ALL", "ENABLED", "PAUSED"],
        default: "ALL",
      },
    },
    required: ["customerId"],
  },
  handler: async (args) => {
    // Call MCP server
    const result = await mcpClient.callTool({
      provider: "google_ads",
      toolName: "google_ads_list_campaigns",
      arguments: {
        userId: args.userId,
        ...args,
      },
    });
    return result;
  },
}

Architecture```

┌─────────────────┐
│ Frontend │
│ (ZeroTwo) │
└────────┬────────┘
│
│ OAuth Flow
▼
┌─────────────────┐ ┌──────────────────┐
│ Google Ads │◄────►│ Google OAuth │
│ MCP Server │ │ & Ads API │
└────────┬────────┘ └──────────────────┘
│
│ MCP Protocol
▼
┌─────────────────┐
│ Backend │
│ (ZeroTwoApi) │
└─────────────────┘


## Development

### Project Structure```
google-ads-mcp-server/
├── src/
│   ├── auth/
│   │   └── oauth-manager.ts    # OAuth token management
│   ├── config/
│   │   └── index.ts            # Configuration management
│   ├── google-ads/
│   │   └── client.ts           # Google Ads API wrapper
│   ├── mcp/
│   │   ├── server.ts           # MCP server implementation
│   │   └── tools.ts            # MCP tool definitions
│   ├── types/
│   │   └── index.ts            # TypeScript type definitions
│   ├── utils/
│   │   └── logger.ts           # Logging utility
│   └── index.ts                # Entry point
├── package.json
├── tsconfig.json
├── env.example
└── README.md

Scripts

  • npm run dev - Start development server with hot reload
  • npm run build - Build TypeScript to JavaScript
  • npm start - Start production server
  • npm run lint - Run ESLint
  • npm run format - Format code with Prettier

Google Ads Customer ID

To find your Google Ads Customer ID:

  1. Sign in to your Google Ads account
  2. Click on the help icon (?) in the top right
  3. Look for your customer ID (10 digits)
  4. Use it without hyphens in API calls

Example: If your customer ID displays as 123-456-7890, use 1234567890

Security Considerations

  1. OAuth Tokens: Tokens are stored in memory. For production, use a secure database or encrypted storage.
  2. Developer Token: Keep your Google Ads Developer Token secure. Never commit it to version control.
  3. CORS: Configure CORS origins appropriately for production.
  4. HTTPS: Use HTTPS in production for secure communication.
  5. Environment Variables: Never commit .env files. Use secure secret management in production.
  6. Rate Limiting: Implement rate limiting for production deployments.

Troubleshooting

OAuth Errors

  • "Missing required environment variables": Check your .env file has all required variables
  • "Failed to exchange authorization code": Verify your redirect URI matches exactly in Google Cloud Console
  • "Token expired": The server automatically refreshes tokens if a refresh token is available

Google Ads API Errors

  • "Developer token is invalid": Verify your developer token is correct and approved
  • "Customer not found": Check that your customer ID is correct (10 digits, no hyphens)
  • "Authentication failed": Ensure the user has granted the adwords scope during OAuth

MCP Connection Issues

  • "No valid session ID": Ensure the MCP client sends proper session headers
  • "Authentication required": User needs to complete OAuth flow first

Cost Considerations

  • Google Ads API calls are free and don't count against your advertising budget
  • No additional costs beyond your normal Google Ads spend
  • API has rate limits: follow Google Ads API rate limits

Useful Links

  • Google Ads API Documentation
  • Google Ads Query Language (GAQL)
  • Google Ads API Metrics
  • Model Context Protocol

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


Powered by ZeroTwo

This Google Ads MCP connector is part of the ZeroTwo AI platform — the all-in-one AI workspace that lets you manage Google Ads campaigns, analyze performance, and optimize your ad spend through GPT-5, Claude, and Gemini.

🌐 ZeroTwo — All AI Models in One App · Manage Google Ads campaigns with GPT-5, Claude, and Gemini — all in one workspace.
✨ ZeroTwo Features · AI ad copywriting, campaign analysis, web search, and MCP-powered Google Ads tools.
🤖 AI Models — GPT-5, Claude & Gemini · Use the world's most capable AI to write ads, analyze metrics, and optimize campaigns.
🔌 ZeroTwo Connectors & Integrations · Connect Google Ads, Gmail, Google Analytics, and more to your AI marketing workflow.
💰 ZeroTwo Pricing · One subscription that replaces ChatGPT Plus, Claude Pro, and Gemini Advanced.
📝 ZeroTwo Blog · AI marketing strategies, Google Ads tips, and ZeroTwo product updates.
🚀 Try ZeroTwo Free · Supercharge your Google Ads with AI — get started free today.

> Built for ZeroTwo — Use this Google Ads MCP server with ZeroTwo's AI connector system to manage campaigns, analyze ad performance, and optimize your advertising through natural language conversations.

常见问题

6 问
答案由本站依据条目字段整理,不引用上游原文
Google Ads MCP Server 7e248015 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

Google Ads MCP Server 7e248015 怎么在 Claude 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Google Ads MCP Server 7e248015 收费吗?

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

Google Ads MCP Server 7e248015 需要 API Key 吗?

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

Google Ads MCP Server 7e248015 支持哪些客户端?

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

Google Ads MCP Server 7e248015 能提供哪些能力?

资料显示约 3 个工具;能力标签包括 广告管理、Claude、TypeScript开发。具体工具清单以官方文档为准。

热门专题

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

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