Google Ads MCP Server
Enables AI assistants to manage, report, and analyze Google Ads campaigns securely with encrypted multi-client support, real-time API integrations, and audit trail logging.
README
Google Ads Model Context Protocol (MCP) Server
This is a Model Context Protocol (MCP) server that enables AI assistants (such as Gemini, ChatGPT, Claude, and Cursor) to manage, report, and analyze Google Ads campaigns securely.
It features an encrypted database storage for managing multiple client accounts, real-time Google Ads API integrations, and robust audit trail logging.
Features
- Campaign Reporting: Query campaigns, budgets, keywords, search terms, ads, conversions, audience, and device performance metrics.
- Campaign Mutations: Create campaigns, update budgets (with dry-run support), pause/resume campaigns, and add keywords or negative keywords.
- Account Diagnostics: Automated account analysis to identify issues like budget constraints and list actionable optimization recommendations.
- Cross-Client Performance Comparison: Compare metrics (Clicks, Cost, Conversions, CPA, ROAS) across all client accounts connected to the agency.
- Encrypted Multi-Client Credentials: Securely store and encrypt OAuth refresh tokens in Supabase using AES-256-GCM.
- Dual Transport Mode: Supports local command-line execution (
stdio) and cloud-ready hosting (Streamable HTTP / SSE). - Comprehensive Audit Trails: Automatically logs every tool execution (reads and writes) to Supabase for enterprise compliance.
Setup & Local Development
1. Installation
Clone the repository and install dependencies:
npm install
2. Configure Environment Variables
Copy .env.example to a new file named .env and fill in your keys:
MOCK_MODE=false
# Supabase Configurations
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-supabase-service-role-key
ENCRYPTION_KEY=your-32-character-encryption-key-here
# Google Ads API Credentials (from Google Cloud Console & Ads Manager Account)
GOOGLE_CLIENT_ID=your-google-oauth-client-id
GOOGLE_CLIENT_SECRET=your-google-oauth-client-secret
GOOGLE_DEVELOPER_TOKEN=your-google-ads-developer-token
Note: Set
MOCK_MODE=trueto test the server with simulated in-memory data without requiring Google Ads API credentials.
3. Generate OAuth Refresh Token
To allow the server to access a client's Google Ads account, run the OAuth helper script:
npx tsx src/utils/authHelper.ts
- Click the generated link to open the browser.
- Sign in with the client's Google account and grant Google Ads permissions.
- The script will output a Refresh Token in your terminal.
4. Register a Client
Save and encrypt the client's details in your Supabase database:
npx tsx src/utils/registerClient.ts <google_customer_id> "<client_name>" "<refresh_token>"
Example:
npx tsx src/utils/registerClient.ts 181-756-0637 "nexusdatabase" "1//0gL0Srx..."
Running the Server
Stdio Mode (Default Local)
To run the server locally on your machine (for Cursor, Claude Desktop, or Gemini CLI):
# Build TypeScript
npm run build
# Start server
npm start
Remote / Cloud Mode (Streamable HTTP / SSE)
Whenever a PORT environment variable is defined, the server will automatically start as a web server listening on /mcp.
$env:PORT="8080"
npm start
The server will now be accessible at http://0.0.0.0:8080/mcp.
Testing
Run the automated mock test suite to verify that all reporting, mutation, diagnostics, and database functions are working correctly:
npm test
Cloud Deployment
You can host this server on any cloud platform supporting Node.js (e.g., Render, Railway, or Heroku).
- Connect this repository to your hosting provider.
- Configure the following deployment commands:
- Build Command:
npm install && npm run build - Start Command:
npm start
- Build Command:
- Add your environment variables (from
.env) in your cloud provider's dashboard. - Connect your AI client (like Cursor or ChatGPT) directly using the hosted URL (e.g.
https://your-app-name.render.com/mcp).
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。