Enables GAQL (Google Ads Query Language) query execution, account management, and keyword research with search volume data for Google Ads accounts, all with automatic OAuth 2.0 authentication and token refresh.
Google Ads MCP Server 🚀
A FastMCP-powered Model Context Protocol server for Google Ads API integration with automatic OAuth 2.0 authentication
Connect Google Ads API directly to Claude Desktop and other MCP clients with seamless OAuth 2.0 authentication, automatic token refresh, GAQL querying, and keyword research capabilities.
Your browser does not support the video tag.
Easy One-Click Setup
For a simpler setup experience, we offer ready-to-use installers:
👉 Download installer - https://gomarble.ai/mcp
Join our community for help and updates
👉 Slack Community - AI in Ads
Try Facebook ads mcp server also
👉 Facebook Ads MCP - Facebook Ads MCP
✨ Features
- 🔐 Automatic OAuth 2.0 - One-time browser authentication with auto-refresh
- 🔄 Smart Token Management - Handles expired tokens automatically
- 📊 GAQL Query Execution - Run any Google Ads Query Language queries
- 🏢 Account Management - List and manage Google Ads accounts
- 🔍 Keyword Research - Generate keyword ideas with search volume data
- 🚀 FastMCP Framework - Built on the modern MCP standard
- 🖥️ Claude Desktop Ready - Direct integration with Claude Desktop
- 🛡️ Secure Local Storage - Tokens stored locally, never exposed
📋 Available Tools
Tool | Description | Parameters | Example Usage |
---|---|---|---|
list_accounts | List all accessible Google Ads accounts | None | "List all my Google Ads accounts" |
run_gaql | Execute GAQL queries with custom formatting | customer_id , query , manager_id (optional) | "Show me campaign performance for account 1234567890" |
run_keyword_planner | Generate keyword ideas with metrics | customer_id , keywords , manager_id , page_url , date range options | "Generate keyword ideas for 'digital marketing'" |
Note: All tools automatically handle authentication - no token parameters required!
🚀 Quick Start
Prerequisites
Before setting up the MCP server, you'll need:
- Python 3.10+ installed
- A Google Cloud Platform account
- A Google Ads account with API access
🔧 Step 1: Google Cloud Platform Setup
1.1 Create Google Cloud Project
- Go to Google Cloud Console
- Create a new project:
- Click "Select a project" → "New Project"
- Enter project name (e.g., "Google Ads MCP")
- Click "Create"
1.2 Enable Google Ads API
- In your Google Cloud Console:
- Go to "APIs & Services" → "Library"
- Search for "Google Ads API"
- Click on it and press "Enable"
1.3 Create OAuth 2.0 Credentials
- Go to "APIs & Services" → "Credentials"
- Click "+ CREATE CREDENTIALS" → "OAuth 2.0 Client ID"
- Configure consent screen (if first time):
- Click "Configure Consent Screen"
- Choose "External" (unless you have Google Workspace)
- Fill required fields:
- App name: "Google Ads MCP"
- User support email: Your email
- Developer contact: Your email
- Click "Save and Continue" through all steps
- Create OAuth Client:
- Application type: "Desktop application"
- Name: "Google Ads MCP Client"
- Click "Create"
- Download credentials:
- Click "Download JSON" button
- Save file as
client_secret_[long-string].json
in your project directory
🔧 Step 2: Google Ads API Setup
2.1 Get Developer Token
- Sign in to Google Ads
- Go to Tools & Settings (wrench icon in top navigation)
- Under "Setup", click "API Center"
- Accept Terms of Service if prompted
- Click "Apply for token"
- Fill out application form:
- Describe your use case (e.g., "MCP integration for campaign analysis")
- Provide technical details about your implementation
- Submit and wait for approval (usually 1-3 business days)
Note: You'll initially get a test token with limited functionality. After testing, you can apply for production access.
2.2 Find Your Developer Token
Once approved:
- Return to API Center in Google Ads
- Copy your Developer Token (format:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
)
🔧 Step 3: Installation & Setup
3.1 Clone and Install
3.2 Environment Configuration
Create a .env
file in your project directory:
Edit .env
with your credentials:
Example .env
file:
🖥️ Step 4: Claude Desktop Integration
4.1 Locate Claude Configuration
Find your Claude Desktop configuration file:
macOS:
Windows:
4.2 Add MCP Server Configuration
Edit the configuration file and add your Google Ads MCP server:
Real Example:
Important:
- Use absolute paths for all file locations
- On Windows, use forward slashes
/
or double backslashes\\
in paths - Replace
your_developer_token_here
with your actual developer token
4.3 Restart Claude Desktop
Close and restart Claude Desktop to load the new configuration.
🔐 Step 5: First-Time Authentication
5.1 Trigger OAuth Flow
- Open Claude Desktop
- Try any Google Ads command, for example:
5.2 Complete Authentication
- Browser opens automatically to Google OAuth page
- Sign in with your Google account (the one with Google Ads access)
- Grant permissions by clicking "Allow"
- Browser shows success page
- Return to Claude - your command will complete automatically!
5.3 Verify Setup
After authentication, you should see:
- A
google_ads_token.json
file created in your project directory - Your Google Ads accounts listed in Claude's response
📖 Usage Examples
Basic Account Operations
Campaign Analysis
Keyword Research
Custom GAQL Queries
🔍 Advanced GAQL Examples
Campaign Performance with Revenue
Keyword Performance Analysis
Device Performance Breakdown
📁 Project Structure
🔒 Security & Best Practices
File Security
- ✅ Credential files are gitignored - Never committed to version control
- ✅ Local token storage - Tokens stored in
google_ads_token.json
locally - ✅ Environment variables - Sensitive data in
.env
file - ✅ Automatic refresh - Minimal token exposure time
Recommended File Permissions
Production Considerations
- Use environment variables instead of
.env
files in production - Implement rate limiting to respect API quotas
- Monitor API usage in Google Cloud Console
- Secure token storage with proper access controls
- Regular token rotation for enhanced security
🛠️ Troubleshooting
Authentication Issues
Issue | Symptoms | Solution |
---|---|---|
No tokens found | "Starting OAuth flow" message | ✅ Normal for first-time setup - complete browser authentication |
Token refresh failed | "Refreshing token failed" error | ✅ Delete google_ads_token.json and re-authenticate |
OAuth flow failed | Browser error or no response | Check credentials file path and internet connection |
Permission denied | "Access denied" in browser | Ensure Google account has Google Ads access |
Configuration Issues
Issue | Symptoms | Solution |
---|---|---|
Environment variables missing | "Environment variable not set" | Check .env file and Claude config env section |
File not found | "FileNotFoundError" | Verify absolute paths in configuration |
Module import errors | "ModuleNotFoundError" | Run pip install -r requirements.txt |
Python path issues | "Command not found" | Use absolute path to Python executable |
Claude Desktop Issues
Issue | Symptoms | Solution |
---|---|---|
Server not connecting | No Google Ads tools available | Restart Claude Desktop, check config file syntax |
Invalid JSON config | Claude startup errors | Validate JSON syntax in config file |
Permission errors | "Permission denied" on startup | Check file permissions and paths |
API Issues
Issue | Symptoms | Solution |
---|---|---|
Invalid customer ID | "Customer not found" | Use 10-digit format without dashes: 1234567890 |
API quota exceeded | "Quota exceeded" error | Wait for quota reset or request increase |
Invalid developer token | "Authentication failed" | Verify token in Google Ads API Center |
GAQL syntax errors | "Invalid query" | Check GAQL syntax and field names |
Debug Mode
Enable detailed logging for troubleshooting:
Getting Help
If you encounter issues:
- Check the error message carefully - it usually indicates the exact problem
- Verify all file paths are absolute and correct
- Ensure environment variables are properly set
- Check Google Cloud Console for API quotas and billing
- Restart Claude Desktop after any configuration changes
🚀 Advanced Configuration
HTTP Transport Mode
For web deployment or remote access:
Claude Desktop config for HTTP:
Custom Token Storage
Modify token storage location in oauth/google_auth.py
:
Manager Account Configuration
For managing multiple accounts under an MCC:
🤝 Contributing
We welcome contributions! Here's how to get started:
Development Setup
Making Changes
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes with appropriate tests
- Test thoroughly with different account configurations
- Update documentation as needed
- Commit changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin feature/amazing-feature
- Open a Pull Request with detailed description
Testing Your Changes
📊 API Limits and Quotas
Google Ads API Quotas
- Basic access: 15,000 operations per day
- Standard access: 40,000 operations per day
- Request rate: 1,600 requests per minute per developer token
Best Practices for API Usage
- Cache results when possible to reduce API calls
- Use date ranges to limit data volume
- Batch requests when supported
- Monitor usage in Google Cloud Console
- Implement retry logic for rate limit errors
Quota Management
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
📈 Roadmap
Upcoming Features
- 🔄 Enhanced keyword research with competitor analysis
- 📊 Built-in data visualization with charts and graphs
- 🤖 AI-powered optimization suggestions
- 📝 Campaign creation and management tools
- 🔍 Advanced reporting capabilities
- 🌐 Multi-language support
Made with ❤️ for the MCP community
Connect your Google Ads data directly to AI assistants and unlock powerful advertising insights through natural language conversations.
This server cannot be installed
A FastMCP-powered Model Context Protocol server for Google Ads API integration with automatic OAuth 2.0 authentication
Connect Google Ads API directly to MCP Clients with seamless OAuth 2.0 authentication, automatic token refresh, GAQL querying, and keyword research capabilities.
- Easy One-Click Setup
- Join our community for help and updates
- Try Facebook ads mcp server also
- ✨ Features
- 📋 Available Tools
- 🚀 Quick Start
- 🔧 Step 1: Google Cloud Platform Setup
- 🔧 Step 2: Google Ads API Setup
- 🔧 Step 3: Installation & Setup
- 🖥️ Step 4: Claude Desktop Integration
- 🔐 Step 5: First-Time Authentication
- 📖 Usage Examples
- 🔍 Advanced GAQL Examples
- 📁 Project Structure
- 🔒 Security & Best Practices
- 🛠️ Troubleshooting
- 🚀 Advanced Configuration
- 🤝 Contributing
- 📊 API Limits and Quotas
- 📄 License
- 📈 Roadmap
Related MCP Servers
- -securityFlicense-qualityA specialized Model Context Protocol (MCP) server that integrates Google services (Gmail, Calendar, etc.) into your AI workflows. This server enables seamless access to Google services through MCP, allowing AI agents to interact with Gmail, Google Calendar, and other Google services.Last updated -103TypeScript
- AsecurityFlicenseAqualityAn MCP (Model Context Protocol) server that provides Google search capabilities and webpage content analysis tools. This server enables AI models to perform Google searches and analyze webpage content programmatically.Last updated -33952TypeScript
- -securityAlicense-qualityA Model Context Protocol (MCP) based search API server that provides standardized access to Google Maps, Google Flights, Google Hotels and other services. This server enables AI assistants to access various search services through a unified interface.Last updated -48PythonMIT License
- -securityFlicense-qualityAn MCP server that enables authentication and authorization with Google's OAuth2 API, allowing users to securely authenticate and access Google services through natural language interactions.Last updated -Python