modelscope·@johnoconnor0/google-ads-mcp
暂无描述。
A comprehensive Model Context Protocol server for Google Ads API integration, providing powerful tools for campaign analysis, optimization, and management.
You need:
You need to generate a refresh token using the OAuth2 flow. Here's a Python script to help:
from google_auth_oauthlib.flow import InstalledAppFlow
# Your OAuth2 credentials
CLIENT_ID = 'your-client-id.apps.googleusercontent.com'
CLIENT_SECRET = 'your-client-secret'
# Google Ads API scope
SCOPES = ['https://www.googleapis.com/auth/adwords']
# Run OAuth flow
flow = InstalledAppFlow.from_client_config(
{
"installed": {
"client_id": CLIENT_ID,
"client_secret": CLIENT_SECRET,
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
}
},
scopes=SCOPES
)
credentials = flow.run_local_server(port=0)
print(f"Refresh Token: {credentials.refresh_token}")
Save this as generate_token.py and run it. It will open a browser for authorization and print your refresh token.
Install required package first:
pip install google-auth-oauthlib
pip install -r requirements.txt
Or install manually:
pip install google-ads mcp httpx pydantic
Add the MCP server to your Claude Desktop configuration:
On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%\Claude\claude_desktop_config.json
Add this configuration:
{
"mcpServers": {
"google-ads": {
"command": "python",
"args": ["/absolute/path/to/google_ads_mcp.py"],
"env": {}
}
}
}
Replace /absolute/path/to/google_ads_mcp.py with the actual path to the server file.
Close and reopen Claude Desktop for the changes to take effect.
When you first interact with Claude Desktop after installing the MCP server, initialize the connection with your credentials:
Initialize my Google Ads connection with these credentials:
- Developer Token: INSERT_YOUR_DEV_TOKEN
- Client ID: INSERT_YOUR_CLIENT_ID.apps.googleusercontent.com
- Client Secret: INSERT_YOUR_CLIENT_SECRET
- Refresh Token: INSERT_YOUR_REFRESH_TOKEN
- Login Customer ID: INSERT_YOUR_MCC_ID (optional, only if using MCC)
Claude will call the google_ads_initialize tool and confirm the connection.
Once initialized, you can ask Claude things like:
"Show me all my Google Ads accounts"
"List all accessible accounts"
"Show campaign performance for the last 30 days for account 1234567890"
"Which campaigns spent the most in the last week?"
"Show me only enabled campaigns with at least $100 in spend"
"Analyze keyword performance for campaign 12345"
"Show me keywords with quality score below 5"
"Which keywords have the highest cost per conversion?"
"Get search terms report for the last 30 days"
"What search queries are triggering my ads?"
"Find search terms with high impressions but low CTR"
"Increase budget for campaign 12345 to $100 per day"
"Pause campaign 67890"
"Enable campaign 54321"
"Show me Google's optimization recommendations"
"Compare ad group performance across all campaigns"
"Find keywords with average position worse than 3"
"Execute this GAQL query: SELECT campaign.name, metrics.clicks FROM campaign"
Initialize API connection with OAuth credentials.
Parameters:
developer_token (required)client_id (required)client_secret (required)refresh_token (required)login_customer_id (optional) - MCC account IDList all accessible Google Ads accounts.
Parameters:
response_format - "markdown" or "json"Get comprehensive campaign metrics.
Parameters:
customer_id (required) - Account ID without hyphensdate_range - TODAY, YESTERDAY, LAST_7_DAYS, LAST_30_DAYS, etc.campaign_status - Filter by ENABLED, PAUSED, or REMOVEDmin_cost - Minimum cost thresholdlimit - Max results (default: 50)response_format - "markdown" or "json"Analyze keyword-level performance.
Parameters:
customer_id (required)campaign_id (…# 翻译 一个通过模型上下文协议提供访问Google Search Console数据的服务器,允许用户检索和分析具有自定义维度和报告周期的搜索分析数据。
一种模型上下文协议服务器,允许AI助手通过Dub.co API创建、更新和删除Dub.co短链接。
启用人工智能和大语言模型系统与Buttondown通讯服务的交互,支持通过模型上下文协议接口进行电子邮件草拟、安排、分析检索和列表管理。
为电子邮件活动和潜在客户管理功能提供对Instantly API v2的访问。
提供了一个通过SendGrid的API管理电子邮件营销、联系人列表、动态模板和电子邮件分析的接口。
一个多通道代理服务器,为与Smartlead的API交互提供结构化的接口,将功能组织成逻辑工具,用于活动管理、潜在客户管理和其它营销自动化功能。