The Model Context Protocol (MCP) is an open standard that lets large language models (LLMs) securely interact with external data and applications. The Google Ads MCP server provides a standardized bridge to the Google Ads API. It lets AI agents retrieve and analyze account data, create assets, upload videos, and manage labels by using natural language.
Community resources and support
GitHub repository: Find demos and examples, report bugs, or suggest features in the google-ads-mcp repository.
Use the Issues tab for bug reports and feature requests.
Community: Join the
#ads-api-ai-toolschannel on the Google Advertising Community Discord.
Technical overview
Integrating the Google Ads MCP server removes the need to write custom code for Google Ads API authentication, resource fetching, data parsing, and supported asset or label mutations. The server exposes callable tools and reference resources (see Core capabilities) that an LLM can inspect and invoke.
Key specifications
- Protocol: MCP (Model Context Protocol)
- Mode: Read and partial mutate (asset creation, video uploads, and label management with propose-and-confirm validation, or configurable read-only mode)
- Language: Python 3.10 or later
- Transport: Standard input/output (
stdio) or Streamable HTTP (streamable-httpon Cloud Run) - Authentication: Application Default Credentials (OAuth 2.0 user
credentials or service account) for local
stdio, or OAuth 2.0 Web application credentials for remote HTTP
How the interaction loop works
- Request: You submit a prompt such as "How is my campaign performance this week?" or "Create a callout asset for our summer sale".
- Discovery: The LLM inspects its available tools and resources and
selects a matching
google-ads-mcptool. - Execution or dry-run validation: Read tools query the Google Ads API directly.
Mutate tools first run in propose mode (
validate_only=True) to validate inputs without committing changes (see Propose-and-confirm safety workflow). - Context injection: The MCP server returns structured query results, or
proposed
change_itemsentries and a verificationchecksumdigest, to the LLM's context window. - Response and confirmation: The LLM presents an answer or asks you to
confirm the proposed changes. After you approve, the LLM calls the mutate
tool again with
validate_only=Falseand the matchingchecksumvalue to commit the change.
Get started
Follow these steps to configure and run the Google Ads MCP server locally. To deploy a shared remote service instead, see Deployment on Google Cloud.
Prerequisites
Before you configure the server, complete the following prerequisites in your local environment and the Google Cloud console:
- Google Cloud project: Create or select a Google Cloud project with the
Google Ads API enabled. Enabling the API grants Test access for testing read
and mutate workflows against test accounts. To access
production accounts, check the Google Ads API overview page for
Explorer, Basic, or Standard access, or apply for one of these access
levels. Otherwise, production calls fail with an
AuthorizationError.CLOUD_PROJECT_NOT_APPROVED_FOR_PRODUCTIONerror. Google sunset developer tokens (GOOGLE_ADS_DEVELOPER_TOKEN) on September 9, 2026. The Google Cloud project that owns your OAuth client or service account determines your API access level. - Credentials: Local
stdiomode authenticates with Application Default Credentials (ADC) from an OAuth 2.0 client secret JSON file or a service account in your Cloud project. Set theGOOGLE_CLOUD_PROJECTenvironment variable when needed to specify your default quota or ADC project. Remotestreamable-httpdeployments instead require an OAuth 2.0 Web application Client ID and Client secret (see Deploy to Google Cloud Run). - Local software (for
stdiomode): Install Python 3.10 or later,pipx, and thegcloudcommand-line tool (used to generate user ADC files).
Configuration
Generate Application Default Credentials (ADC) using an OAuth client from your API-enabled Google Cloud project and include the Google Ads API scope:
gcloud auth application-default login \ --scopes=https://www.googleapis.com/auth/adwords,https://www.googleapis.com/auth/cloud-platform \ --client-id-file=PATH_TO_CLIENT_SECRET_JSONReplace the following:
PATH_TO_CLIENT_SECRET_JSON: the path to your OAuth 2.0 client secret JSON file.
This command prints
Credentials saved to file: [PATH_TO_CREDENTIALS_JSON](such as~/.config/gcloud/application_default_credentials.jsonon Linux and macOS). To authenticate with a service account instead, skip this step and pointGOOGLE_APPLICATION_CREDENTIALSto your service account key JSON file, or pass--impersonate-service-accounttogcloud auth application-default login.Add the server to your host's MCP configuration file (such as
~/.gemini/config/mcp_config.json,~/.gemini/settings.json, or~/.claude/settings.json):{ "mcpServers": { "google-ads-mcp": { "command": "pipx", "args": [ "run", "--spec", "google-ads-mcp==0.0.6", "google-ads-mcp" ], "env": { "GOOGLE_CLOUD_PROJECT": "PROJECT_ID", "GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_CREDENTIALS_JSON" } } } }Replace the following:
PROJECT_ID: your Google Cloud project ID.PATH_TO_CREDENTIALS_JSON: the path to the ADC JSON file printed in step 1, or to your service account key JSON file. You can omitGOOGLE_APPLICATION_CREDENTIALSwhen using the defaultgcloudADC file location.
To access client accounts through a manager account, set
GOOGLE_ADS_LOGIN_CUSTOMER_ID(10 digits, without hyphens) inenv, or pass thelogin_customer_idparameter on individual tool calls.
Optional: Equip your agent with skills and the Developer Assistant
The Google Ads MCP server gives your AI client live access to account reporting data along with asset creation, video upload, and label management tools. Pair the MCP server with the following companion tools to help your agent construct valid Google Ads Query Language (GAQL) queries and diagnose account performance shifts. These tools also generate client library code, such as scripts to link created assets to campaigns or perform other unsupported mutations:
Google Ads API agent skills: Portable workflow modules (including
google-ads-api-mcp-setup,google-ads-api-account-diagnostics, andgoogle-ads-api-quickstart) that help your agent use the Google Ads MCP server with lower token overhead. Run the following command to install them (requires Node.js), or see the Google Ads API agent skills guide for Antigravity, Claude Code, Codex, and Cursor setup:npx skills add google/skills/skills/adsGoogle Ads API Developer Assistant: A modular plugin for Google Antigravity and Claude Code that provides local Protobuf schema inspection, GAQL validation, client library code generation, and offline conversion troubleshooting. Read What is the Google Ads API Developer Assistant? or follow the installation guide.
Core capabilities
The following sections describe the server's read tools, partial mutate tools,
and reference resources. Starting in v0.0.6, tools register by default with
their category namespace prefix (such as search_search). When upgrading
prompts or allowlists from unprefixed releases, update tool names or set an
empty prefix ("") in tools_config.yaml (see Configure tool namespaces and
read-only mode).
Read tools
customers_list_accessible_customers(toollist_accessible_customers): Returns the Google Ads customer IDs directly accessible to the authenticated user.search_search(toolsearch): Builds and runs GAQLSearchStreamqueries from structured parameters (customer_id,resource, andfields, plus optionalconditions,orderings,limit, andlogin_customer_id) rather than a raw GAQL string. Every query appendsPARAMETERS omit_unselected_resource_names=trueto fetch resource attributes, metrics, segments, budgets, and status cleanly.metadata_get_resource_metadata(toolget_resource_metadata): Retrieves selectable, filterable, and sortable attributes, metrics, and segments for a Google Ads API resource type (for example,"campaign"). Use this metadata to discover valid query fields—including metrics and segments added in minor releases such as v26.2—before calling thesearch_searchtool.
Mutate tools (partial support)
assets_create_asset(toolcreate_asset): Creates standalone Google Ads assets with dedicated parameters forTEXT,IMAGE,YOUTUBE_VIDEO,SITELINK,CALLOUT, andSTRUCTURED_SNIPPETasset types. Pass theextra_paramsdictionary for other mutableAssetServicetypes (such asPRICE,PROMOTION,CALL, orBUSINESS_MESSAGE), and include root-levelfinal_urlsalongsidesitelink_link_textforSITELINKassets. Local file paths (image_asset_path) work in localstdiomode only. For remote HTTP deployments, pass the base64-encodedimage_asset_dataparameter withimage_asset_mime_typeset toIMAGE_PNG,IMAGE_JPEG, orIMAGE_GIF(up to 20 MB).assets_upload_video_asset(toolupload_video_asset): Uploads a local video file (.3gp,.avi,.flv,.mkv,.mov,.mp4,.mpeg,.mpg,.ogg,.webm, or.wmv) to YouTube through the Google Ads API in localstdiomode only. Bothvideo_titleandvideo_descriptionare required parameters, and privacy defaults toUNLISTED(orPUBLICon advertiser-owned brand channels with user OAuth). This tool returns a Google Adsvideo_upload_idvalue (and resource name), not the 11-character YouTubevideo_id. Queryyou_tube_video_uploadwith thesearch_searchtool (filtering byyou_tube_video_upload.video_upload_id) untilyou_tube_video_upload.state = 'PROCESSED'. Then passyou_tube_video_upload.video_idas theyoutube_video_idparameter toassets_create_asset(asset_type="YOUTUBE_VIDEO").labels_manage_labels(toolmanage_labels): Creates, updates, and removes account labels, including name, description, and hex background color.labels_manage_label_associations(toolmanage_label_associations): SupportsCREATEandREMOVElabel association operations (UPDATEis not supported) onCAMPAIGN,CUSTOMER,AD_GROUP, andAD_GROUP_CRITERIONresources. ForCUSTOMERresources,resource_idis optional and defaults tocustomer_id. Pass a composite{ad_group_id}~{criterion_id}ID forAD_GROUP_CRITERIONresources, and remove associations by passing eitherresource_idandlabel_idorassociation_resource_name. Ad-levelAD_GROUP_ADlabels are not supported.
Reference resources
The server exposes four read-only MCP resources that remain mounted regardless
of your tools_config.yaml settings:
resource://discovery-document: JSON REST discovery overview of Google Ads API resources, service methods, and schemas. It complements themetadata_get_resource_metadatatool, which returns selectable, filterable, and sortable GAQL query fields.resource://metrics: HTML reference documentation for Google Ads API metrics.resource://segments: HTML reference documentation for Google Ads API segments.resource://release-notes: HTML Google Ads API release notes covering version changes and new features.
Propose-and-confirm safety workflow
Every mutate tool (assets_create_asset, assets_upload_video_asset,
labels_manage_labels, and labels_manage_label_associations) enforces a
two-step propose-and-confirm workflow to help prevent unintended account
modifications:
- Propose (
validate_only=True, default): Validates inputs without committing changes. The asset and label tools execute a live Google Ads APIvalidate_onlydry run. BecauseYouTubeVideoUploadServicehas no dry-run mode,assets_upload_video_assetinstead validates the local file and binds its size and modification timestamp. Each tool returns human-readablechange_itemsentries and a stateless SHA-256checksumdigest bound to thecustomer_idparameter and request payload. - Confirm (
validate_only=False): After presenting thechange_itemslist and receiving your approval, the agent calls the tool again withvalidate_only=False, the identicalcustomer_idparameter and arguments, and thechecksumvalue from step 1. The server rejects any missing or mismatched checksum before mutating the account.
Configure tool namespaces and read-only mode
The server bundles a default tools_config.yaml file with all five tool
categories (customers, search, metadata, labels, and assets) enabled.
Customize tools_config.yaml to selectively enable or disable individual tools
or namespaces, change or remove namespace prefixes, or enforce a strictly
read-only deployment.
At startup, the server resolves tools_config.yaml in the following order:
- An explicit path in the
GOOGLE_ADS_MCP_TOOLS_CONFIGenvironment variable (recommended for localstdiohosts, whose working directory can differ from your project folder). - A
tools_config.yamlfile in the server's current working directory. - The default
tools_config.yamlfile bundled with the package.
If GOOGLE_ADS_MCP_TOOLS_CONFIG points to a missing file, or if any resolved
configuration file is invalid, the server raises an error at startup instead of
falling back to defaults.
The following minimal tools_config.yaml file enforces a strictly read-only
deployment:
namespaces:
customers: true
search: true
metadata: true
labels: false
assets: false
The following tools_config.yaml file customizes prefixes and filters
individual tools (for example, exposing the base64 create_asset tool on Cloud
Run while disabling the local-only upload_video_asset tool):
namespaces:
# Default prefix ("customers_list_accessible_customers")
customers: true
# Empty prefix mounts unprefixed tool names ("search")
search: ""
# Custom prefix ("schema_get_resource_metadata")
metadata: "schema"
# Enable only specific tools in a multi-tool category
assets:
enabled_tools:
- create_asset
Sample prompts to start
Try the following prompts in your MCP client after connecting the server.
Ask what the server can do
What can the google-ads-mcp server do?
Ask about customers
What customers do I have access to?
Ask about campaigns
How many active campaigns do I have?
How is my campaign performance this week?
Give me a report of the top spending campaigns split by device category over the last 7 days for account 1234567890
Create assets, upload videos, and manage labels
Create a callout asset with the text "Free Shipping" for account 1234567890
Upload /path/to/promo.mp4 with title "Summer Sale" and description "Summer promo video" for account 1234567890
Create a label named "Q4 Promo" with background color #34A853 and apply it to campaign 9876543210 in account 1234567890
Deployment on Google Cloud
To share the MCP server across multiple agents or run it as a web service, host it on Google Cloud Run or another cloud infrastructure provider instead of running it locally.
Prerequisites
- A Google Cloud project with the Google Ads API enabled (see Prerequisites for production access requirements).
The
gcloudcommand-line tool installed, authenticated, and configured with an active project:gcloud config set project PROJECT_IDReplace the following:
PROJECT_ID: your Google Cloud project ID.
Build and push a Docker image
Use Cloud Build to build and push the container image to Artifact Registry without installing Docker locally:
Create a repository in Artifact Registry:
gcloud artifacts repositories create mcp-servers \ --repository-format=docker --location=us-central1Build and submit the image from a release tag in the GitHub repository (or from
.in a local checkout if you customizedDockerfileortools_config.yaml):gcloud builds submit https://github.com/googleads/google-ads-mcp \ --git-source-revision=v0.0.6 \ --tag=us-central1-docker.pkg.dev/PROJECT_ID/mcp-servers/google-ads-mcp:v0.0.6Replace the following:
PROJECT_ID: your Google Cloud project ID.
Rebuild and redeploy the image whenever you update
google-ads-mcpor upgrade the bundledgoogle-adsPython client library for new Google Ads API releases (such as v26.2).
Deploy to Google Cloud Run
Configure the following environment variables and secrets for your Cloud Run service:
GOOGLE_ADS_MCP_OAUTH_CLIENT_ID: The OAuth 2.0 Web application Client ID from your API-enabled Google Cloud project for application-level OAuth authentication. Complete the following OAuth configuration steps:- Add the authorized redirect URIs for any AI clients that you plan to
connect (such as
https://claude.ai/api/mcp/auth_callback,https://chatgpt.com/connector_platform_oauth_redirect, orhttps://antigravity.google/oauth-callback). - Add the
https://www.googleapis.com/auth/adwordsscope to the OAuth consent screen under APIs & Services > OAuth consent screen > Data Access (Add or remove scopes). - If your OAuth consent screen publishing status is set to Testing (the default), add the Google Accounts connecting to the MCP server as Test users under APIs & Services > OAuth consent screen > Audience (Test users > + Add users).
- Add the authorized redirect URIs for any AI clients that you plan to
connect (such as
GOOGLE_ADS_MCP_OAUTH_CLIENT_SECRET: The OAuth Client secret corresponding to your OAuth Client ID.GOOGLE_ADS_MCP_BASE_URL: The public base URL of your MCP server (for example,https://google-ads-mcp-xyz-uc.a.run.app). Cloud Run assigns this URL during initial deployment, so deploy without this variable first and update the service afterward.GOOGLE_ADS_MCP_JWT_SIGNING_KEY(recommended for multi-instance Cloud Run): A persistent secret that signs FastMCP JWTs across container restarts and horizontal scaling.GOOGLE_ADS_MCP_STORAGE_TYPE(recommended for multi-instance Cloud Run): Persistent backend for OAuth client registrations and tokens (rediswithGOOGLE_ADS_MCP_STORAGE_REDIS_URL, orfirestore). Because the stockv0.0.6Dockerfileinstalls only the in-memory backend, installpy-key-value-aio[redis]or.[firestore]in a customDockerfilefirst. Usingfirestorealso requires a Firestore database and theroles/datastore.userIAM role on the Cloud Run service account. For single-instance testing with in-memory storage, pass--max-instances=1.GOOGLE_ADS_LOGIN_CUSTOMER_ID(optional): Default 10-digit manager customer ID (without hyphens) used when tool calls omit thelogin_customer_idparameter.GOOGLE_ADS_MCP_TOOLS_CONFIG(optional): Container path to a customtools_config.yamlfile (for example, mounted from Secret Manager at/etc/mcp/tools_config.yamlto enforce read-only mode without rebuilding the image). See Configure tool namespaces and read-only mode.
Store GOOGLE_ADS_MCP_OAUTH_CLIENT_SECRET and GOOGLE_ADS_MCP_JWT_SIGNING_KEY
in Secret Manager and deploy the service to Google Cloud Run:
gcloud run deploy google-ads-mcp \
--image=us-central1-docker.pkg.dev/PROJECT_ID/mcp-servers/google-ads-mcp:v0.0.6 \
--platform=managed \
--region=us-central1 \
--allow-unauthenticated \
--set-env-vars="GOOGLE_ADS_MCP_OAUTH_CLIENT_ID=CLIENT_ID" \
--set-secrets="GOOGLE_ADS_MCP_OAUTH_CLIENT_SECRET=MCP_OAUTH_CLIENT_SECRET:latest,GOOGLE_ADS_MCP_JWT_SIGNING_KEY=MCP_JWT_SIGNING_KEY:latest"
After Cloud Run completes the deployment, retrieve the assigned service URL and
update the service with the GOOGLE_ADS_MCP_BASE_URL environment variable:
gcloud run services update google-ads-mcp \
--region=us-central1 \
--update-env-vars="GOOGLE_ADS_MCP_BASE_URL=https://CLOUD_RUN_SERVICE_URL"
Replace the following:
PROJECT_ID: your Google Cloud project ID.CLIENT_ID: your OAuth 2.0 Web application Client ID.MCP_OAUTH_CLIENT_SECRET: the Secret Manager secret name storing your OAuth 2.0 Client secret.MCP_JWT_SIGNING_KEY: the Secret Manager secret name storing your JWT signing key.CLOUD_RUN_SERVICE_URL: the hostname assigned to your Cloud Run service (for example,google-ads-mcp-xyz-uc.a.run.app).
Authentication and security model
Deploying with --allow-unauthenticated disables Cloud Run's infrastructure IAM
check (roles/run.invoker) so external AI clients can connect without Google
Cloud service account tokens. Authentication is delegated to the application
layer instead:
- When
GOOGLE_ADS_MCP_OAUTH_CLIENT_IDandGOOGLE_ADS_MCP_OAUTH_CLIENT_SECRETare set, the server enforces Google OAuth 2.0 on every request and returns a401 UnauthorizedHTTP status code to unauthenticated callers. Every tool call executes under the authenticated caller's OAuth identity. - Omitting
--allow-unauthenticatedrequires callers to pass Google Cloud OIDC identity tokens with every request. Standard AI clients (such as Claude and ChatGPT) use end-user OAuth rather than Google Cloud IAM tokens, so direct connections require--allow-unauthenticatedpaired with application-level OAuth.
Configure the MCP client
After deployment, configure your MCP client with the Cloud Run service URL. Because the server enforces OAuth 2.0, your client must support the MCP OAuth flow or supply an authorized Bearer token:
- OAuth-enabled clients: In clients that support MCP OAuth discovery (such
as Antigravity), connecting triggers a Google sign-in prompt to grant the
https://www.googleapis.com/auth/adwordsscope (shown as.../auth/adwordsin the Google Cloud console). - Third-party AI platforms (Claude, ChatGPT): In your client's connector
settings, add a custom connector pointing to your service URL with the
/mcppath (for example,https://google-ads-mcp-xyz-uc.a.run.app/mcp). Select OAuth 2.0 authentication with your OAuth Client ID and Client secret, and confirm that the client's callback URI is in your OAuth client's authorized redirect URIs. - Clients without OAuth support: Clients that don't support HTTP OAuth
flows receive a
401 UnauthorizedHTTP status code. For those clients, use the local stdio configuration instead.
The following example configures the gemini command-line tool in
~/.gemini/settings.json (for Google Antigravity in
~/.gemini/config/mcp_config.json, replace "httpUrl" with "serverUrl" or
"url"):
{
"mcpServers": {
"google-ads-mcp": {
"httpUrl": "https://CLOUD_RUN_SERVICE_URL/mcp"
}
}
}
Replace the following:
CLOUD_RUN_SERVICE_URL: the hostname assigned to your Cloud Run service (for example,google-ads-mcp-xyz-uc.a.run.app).
Next steps
- Install Google Ads API agent skills
- Learn about the Google Ads API Developer Assistant
- Install and use the Google Ads API Developer Assistant