Google Ads
About
MCP server acting as an interface to the Google Ads, enabling programmatic access to Google Ads data and management features.
Details
- Author
- gomarble-ai
- Categories
- Cloud Service, Community, Other
Jump to
Setup
Install Google Ads in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/gomarble-ai/google-ads-mcp-server
Follow the installation instructions in the repository README, then restart your MCP client.
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.
For a simpler setup experience, we offer ready-to-use installers:
πDownload installer -https://gomarble.ai/mcp
- π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
Note:All tools automatically handle authentication - no token parameters required!
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
- Go toGoogle Cloud Console
- Create a new project:
- Click "Select a project" β "New Project"
- Enter project name (e.g., "Google Ads MCP")
- Click "Create"
- In your Google Cloud Console:
- Go to "APIs & Services" β "Library"
- Search for "Google Ads API"
- Click on it and press "Enable"
- 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
- Application type:"Desktop application"
- Name: "Google Ads MCP Client"
- Click "Create"
- Click "Download JSON" button
- Save file asclient_secret_[long-string].jsonin your project directory
Note:You'll initially get a test token with limited functionality. After testing, you can apply for production access.
- Return to API Center in Google Ads
- Copy your Developer Token(format:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)
# Clone the repository git clone https://github.com/yourusername/google-ads-mcp-server.git cd google-ads-mcp-server # Create virtual environment (recommended) python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate # Install dependencies pip install -r requirements.txt
Create a.envfile in your project directory:
# Copy the example file cp .env.example .env
# Required: Google Ads API Developer Token GOOGLE_ADS_DEVELOPER_TOKEN=your_developer_token_here # Required: Path to OAuth credentials JSON file (downloaded from Google Cloud) GOOGLE_ADS_OAUTH_CONFIG_PATH=/full/path/to/your/client_secret_file.json
GOOGLE_ADS_DEVELOPER_TOKEN=ABCDEFG1234567890 GOOGLE_ADS_OAUTH_CONFIG_PATH=/Users/john/google-ads-mcp/client_secret_138737274875-abc123.apps.googleusercontent.com.json
Find your Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Edit the configuration file and add your Google Ads MCP server:
{ "mcpServers": { "google-ads": { "command": "/full/path/to/your/project/.venv/bin/python", "args": [ "/full/path/to/your/project/server.py" ] } } }
{ "mcpServers": { "google-ads": { "command": "/Users/marble-dev-01/workspace/google_ads_with_fastmcp/.venv/bin/python", "args": [ "/Users/marble-dev-01/workspace/google_ads_with_fastmcp/server.py" ] } } }
- Useabsolute pathsfor all file locations
- On Windows, use forward slashes/or double backslashes\\in paths
- Replaceyour_developer_token_herewith your actual developer token
Close and restart Claude Desktop to load the new configuration.
- Open Claude Desktop
- Try any Google Ads command, for example:
"List all my Google Ads accounts"
- Agoogle_ads_token.jsonfile created in your project directory
- Your Google Ads accounts listed in Claude's response
"List all my Google Ads accounts" "Show me the account details and which ones have active campaigns"
"Show me campaign performance for account 1234567890 in the last 30 days" "Get conversion data for all campaigns in the last week" "Which campaigns have the highest cost per conversion?"
"Generate keyword ideas for 'digital marketing' using account 1234567890" "Find keyword opportunities for 'AI automation' with search volume data" "Research keywords for the page https://example.com/services"
"Run this GAQL query for account 1234567890: SELECT campaign.name, metrics.clicks, metrics.cost_micros FROM campaign WHERE segments.date DURING LAST_7_DAYS" "Get keyword performance data: SELECT ad_group_criterion.keyword.text, metrics.ctr, metrics.average_cpc FROM keyword_view WHERE metrics.impressions > 100"
SELECT campaign.id, campaign.name, metrics.clicks, metrics.impressions, metrics.cost_micros, metrics.conversions, metrics.conversions_value FROM campaign WHERE segments.date DURING LAST_30_DAYS ORDER BY metrics.cost_micros DESC
SELECT campaign.name, ad_group_criterion.keyword.text, ad_group_criterion.keyword.match_type, metrics.ctr, metrics.average_cpc, metrics.quality_score FROM keyword_view WHERE segments.date DURING LAST_7_DAYS AND metrics.impressions > 100 ORDER BY metrics.conversions DESC
SELECT campaign.name, segments.device, metrics.clicks, metrics.cost_micros, metrics.conversions FROM campaign WHERE segments.date DURING LAST_30_DAYS AND campaign.status = 'ENABLED'
google-ads-mcp-server/ βββ server.py # Main MCP server βββ oauth/ β βββ __init__.py # Package initialization β βββ google_auth.py # OAuth authentication logic βββ google_ads_token.json # Auto-generated token storage (gitignored) βββ client_secret_[long-string].json # Your OAuth credentials (gitignored) βββ .env # Environment variables (gitignored) βββ .env.example # Environment template βββ .gitignore # Git ignore file βββ requirements.txt # Python dependencies βββ LICENSE # MIT License βββ README.md # This file
- β
Credential files are gitignored- Never committed to version control
- β
Local token storage- Tokens stored ingoogle_ads_token.jsonlocally
- β
Environment variables- Sensitive data in.envfile
- β
Automatic refresh- Minimal token exposure time
# Set secure permissions for sensitive files chmod 600 .env chmod 600 google_ads_token.json chmod 600 client_secret_.json
- Use environment variablesinstead of.envfiles in production
- Implement rate limitingto respect API quotas
- Monitor API usagein Google Cloud Console
- Secure token storagewith proper access controls
- Regular token rotationfor enhanced security
Enable detailed logging for troubleshooting:
# Add to server.py for debugging import logging logging.basicConfig(level=logging.DEBUG)
- Check the error message carefully- it usually indicates the exact problem
- Verify all file pathsare absolute and correct
- Ensure environment variablesare properly set
- Check Google Cloud Consolefor API quotas and billing
- Restart Claude Desktopafter any configuration changes
# Start server in HTTP mode python3 server.py --http
{ "mcpServers": { "google-ads": { "url": "http://127.0.0.1:8000/mcp" } } }
Modify token storage location inoauth/google_auth.py:
# Custom token file location def get_token_path(): return "/custom/secure/path/google_ads_token.json"
For managing multiple accounts under an MCC:
# Add to .env file GOOGLE_ADS_LOGIN_CUSTOMER_ID=123-456-7890
We welcome contributions! Here's how to get started:
# Fork and clone the repository git clone https://github.com/yourusername/google-ads-mcp-server.git cd google-ads-mcp-server # Create development environment python3 -m venv .venv source .venv/bin/activate # Install dependencies pip install -r requirements.txt # Set up development environment cp .env.example .env # Add your development credentials to .env
- Create a feature branch:git checkout -b feature/amazing-feature
- Make your changeswith appropriate tests
- Test thoroughlywith different account configurations
- Update documentationas needed
- Commit changes:git commit -m 'Add amazing feature'
- Push to branch:git push origin feature/amazing-feature
- Open a Pull Requestwith detailed description
# Test authentication flow python3 server.py --test-auth # Test API connectivity python3 -c " from oauth.google_auth import get_oauth_credentials creds = get_oauth_credentials() print('β
Authentication successful!') " # Test with Claude Desktop # Add your server to Claude config and test various commands
- Basic access:15,000 operations per day
- Standard access:40,000 operations per day
- Request rate:1,600 requests per minute per developer token
- Cache resultswhen possible to reduce API calls
- Use date rangesto limit data volume
- Batch requestswhen supported
- Monitor usagein Google Cloud Console
- Implement retry logicfor rate limit errors
# Monitor usage in Google Cloud Console # Go to APIs & Services β Quotas # Search for "Google Ads API" to see current usage
This project is licensed under the MIT License - see theLICENSEfile for details.
Copyright (c) 2025 Google Ads MCP Server Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- πEnhanced keyword researchwith competitor analysis
- πBuilt-in data visualizationwith charts and graphs
- π€AI-powered optimization suggestions
- πCampaign creation and management tools
- πAdvanced reporting capabilities
- πMulti-language support
Connect your Google Ads data directly to AI assistants and unlock powerful advertising insights through natural language conversations.*
AniList MCP server for accessing AniList API data
APISIX Model Context Protocol (MCP) server is used to bridge large language models (LLMs) with the APISIX Admin API, supporting querying and managing all resources in Apache APISIX.
Get up-to-date EC2 pricing information with one call. Fast. Powered by a pre-parsed AWS pricing catalogue.
Interact with your content on the Contentful platform
A Model Context Protocol (MCP) server enabling interaction with Google Admin APIs.
Server for using HuggingFace Spaces, supporting Images, Audio, Text and more. Claude Desktop mode for ease-of-use.
Connect to Kubernetes cluster and manage pods, deployments, services.
Golang-based Kubernetes MCP Server. Built to be extensible.
A Python MCP server for Microsoft Entra ID (Azure AD) directory, user, group, device, sign-in, and security operations via Microsoft Graph.
List and analyze Netbird network peers, groups, policies, and more.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




