Authenticating an MCP Server to Google Ads API Without Exposing Developer Tokens in B2B Pipelines

Tenant-owned projects and vaults keep Google Ads credentials away from the AI.

Cover illustration for “Authenticating an MCP Server to Google Ads API Without Exposing Developer Tokens in B2B Pipelines”
Written by
Renata Solberg
Published
November 16, 2026
Reading time
9 min read
Sources cited
1 sources ↓

The official Google Ads MCP server connects AI assistants to the Google Ads API for reporting and limited asset and label changes. Authenticating it safely after the developer token sunset requires tenant-owned Cloud projects, protected OAuth credentials, per-tenant vaults, and stateless credential lookup. The central rule is simple. The server retrieves secrets to execute calls, but the AI assistant never receives them.

Why the developer token sunset changed the authentication problem entirely

September 9, 2026 changed how access to the Google Ads API works. Google’s MCP server guide states that GOOGLE_ADS_DEVELOPER_TOKEN was retired on that date. The Google Cloud project owning the OAuth client or service account now determines access at one of four tiers, namely Test, Explorer, Basic, or Standard. Instead of relying on a shared manager-account developer token, the design now depends on the owning project and its credentials.

Tutorials and open-source examples written for the old credential stack can lead engineers to protect a token that is no longer used for access. Removing that variable is not a complete migration. The replacement design must account for project ownership, OAuth secrets, and the credentials of each authorizing advertiser.

What is Google Ads MCP, and what can version 0.0.6 do?

The official server is an open-source Python bridge between MCP clients and the Google Ads API. Its capabilities are narrower than the API’s. The guide names three read tools, which are customers_list_accessible_customers, search_search for GAQL queries, and metadata_get_resource_metadata. Version 0.0.6 also provides four partial-mutation tools, namely assets_create_asset, upload_video_asset, manage_labels, and manage_label_associations.

Those write tools use a built-in propose-and-confirm flow, with a checksum bound to the customer ID and request parameters. Campaign, budget, bid, and keyword mutations remain outside the server’s scope and require direct API calls. That distinction defines the security boundary. A reporting connection and a campaign-management integration do not expose the same operations, even when both use Google Ads credentials.

For a client application, the connection target is a server the operator runs. Local use runs over stdio, while remote deployment uses streamable HTTP on Cloud Run. Google offers only an allowlisted pilot. Upgrades also affect tool names. Version 0.0.6 registers category namespace prefixes by default, so earlier prompt references need updating unless tools_config.yaml sets an empty prefix.

The three-layer credential stack that replaced the developer token and where each layer leaks

The first layer is the Cloud project’s access tier. It determines the API access available to the OAuth client or service account that the project owns. A design that treats every advertiser as belonging behind one shared project starts with the wrong separation, before any token reaches the server.

The second layer is the OAuth client ID and secret. The secret is a credential shared across the organization, while the client ID tells which OAuth application it is. If GOOGLE_ADS_MCP_OAUTH_CLIENT_ID and GOOGLE_ADS_MCP_OAUTH_CLIENT_SECRET are omitted when deploying with --allow-unauthenticated, the server falls back to Application Default Credentials. That exposes the container’s service account credentials to unauthenticated callers.

The third layer is the per-user refresh token, with one token for each authorizing advertiser. Each has its own lifecycle, and the server does not store, rotate, or revoke it. Token creation has become stricter too. Google required MFA for new user-based OAuth tokens from April 21, 2026, then required passkeys from August 5, 2026, excluding TOTP apps and SMS codes. Service account workflows are not affected by those requirements.

Why multi-tenant B2B pipelines make the per-user token problem structurally different from single-account setups

A single-account setup manages one advertiser’s authorization lifecycle. A B2B pipeline manages an inventory of long-lived secrets that grows with its clients, with each token expiring, rotating, or being revoked independently. This is the N-token problem. Neither the MCP server nor the API takes over that inventory, so the builder must manage both credential lifecycle and the association between each credential and its tenant.

Google’s developer policy update, published August 31, 2026, adds a separate architectural constraint. It prohibits an MCP server or proxy that solely replicates, wraps, or re-exposes Google Ads programmatic capabilities, and requires agencies and advertisers to use their own Google Cloud account and access level. This is not an optional security preference. A single shared managed MCP layer cannot be assumed to be an acceptable B2B model under that policy.

Each tenant therefore needs to own its project from the start. Vault isolation and compliance with restrictions on what the service itself does are distinct obligations. The credential system must separate advertisers’ access, while the product must also respect the prohibition on a service that solely re-exposes programmatic capabilities.

Choosing between OAuth 2.0 user credentials and service accounts for the MCP server’s auth mode

The accounts’ supported authorization paths determine the first implementation decision. Service accounts need no user interaction and are free of the user-token MFA requirement, so they are the recommended path for headless, scheduled, or multi-account automation where they are allowed. But eligibility is restrictive. The notes’ supported path requires Google Ads accounts managed under a Google Workspace domain with domain-wide delegation, which excludes most independent advertisers.

For accounts outside that arrangement, use user OAuth with an offline refresh token. It works for any Google Ads account, but generating new tokens requires the passkey step, and each user’s refresh token needs storage and lifecycle management. Headless execution does not erase that requirement. A B2B SaaS platform cannot choose service accounts merely because maintaining user credentials is inconvenient.

Deployment mode introduces another distinction. The guide describes local stdio authentication through Application Default Credentials using OAuth 2.0 client secret JSON or a service account key. Remote streamable HTTP requires OAuth 2.0 web application client credentials. For Cloud Run, the client secret should come from Secret Manager through --set-secrets to keep it out of plaintext --set-env-vars values.

Keeping secrets out of environment variables, logs, and LLM context

Do not place secret values in plaintext deployment variables or repositories. For secrets on Cloud Run, use --set-secrets to refer to values in Secret Manager. The client ID is a different case. The guide’s deployment command uses --set-env-vars for that identifier and --set-secrets for the client secret, so the rule applies specifically to secret values.

Upgrade deployments that predate the token-logging fix. Version 0.0.5, released October 9, 2026, upgraded FastMCP to address OAuth access tokens appearing in logs. Until older deployments are upgraded, their logs should be treated as a place where credentials may have leaked. The later audit trail for writes needs operation details.

Keep API credentials out of prompts, tool outputs, and agent reasoning traces. The agent should receive only an opaque reference and the call’s result. The MCP 2026-07-28 specification also prohibits token passthrough, so a token received to authorize an MCP request must not simply be forwarded to the downstream API. These are separate authorization boundaries. The same specification deprecates Dynamic Client Registration in favor of Client ID Metadata Documents, while retaining the OAuth 2.1 with PKCE requirements in place since 2025-03-26.

Per-tenant credential vault isolation as the structural answer to the N-token scaling problem

The structural answer to the N-token problem is a separate encrypted vault for each tenant, protected by tenant-specific decryption keys. Build credential retrieval around that boundary. If an application bug exposes stored credential data, access to one tenant’s decryption key should not unlock every other advertiser’s tokens. Isolation must exist in the keys themselves.

A concrete connection pattern uses a unique MCP endpoint for each connected account. The endpoint contains a random hex token that is hashed using a secret key before storage, making the URL an authentication and tenant-isolation boundary without revealing the underlying API credentials to the model. Revocation deletes the token entry. That endpoint pattern does not replace the remote authorization requirements or the need for separate tenant-owned Cloud projects.

Revocation must work at the connection level. The architecture should invalidate one tenant’s connection on the next tool call without changing other tenants’ credentials. A separate encrypted store is not enough if the execution layer continues using credentials after the connection has been revoked.

Stateless transport and the MCP 2026-07-28 specification’s effect on session-based auth patterns

The MCP 2026-07-28 specification removes session identifiers and the initialize handshake in its stateless transport model. Each remote request therefore needs enough context to tell which tenant it is for and get the right credentials. A session cannot supply that missing association. For the Cloud Run streamable HTTP path, credential selection must belong to the individual tool call.

In practice, retrieve credentials from the vault per request, or use a short-lived in-process cache with an explicit expiration period. Cache use must respect the requirement that revoking a connection takes effect on the next tool call. Authorizing access to the MCP server and obtaining the tenant’s downstream Google Ads credentials remain separate steps.

This also changes how the server scales. Without session affinity, requests can go to different server instances while keeping track of which tenant they belong to. The vault supplies the credential boundary.

The propose-and-confirm gate as the last line of defense for write operations

The built-in write gate completes this architecture. Each supported mutation first runs with validate_only=True and returns human-readable change_items plus a stateless SHA-256 checksum bound to customer_id and the request payload. Video upload has a narrower proposal step. It performs local file validation rather than the same API validation as the other write tools.

A second call with validate_only=false, the matching checksum, and the customer ID commits the change. Missing or mismatched checksums are rejected before mutation. The customer binding prevents cross-account replay of a proposal. It does not decide whether the caller should have access to that tenant’s credentials, which remains the job of the authorization and vault layers.

The mechanism binds the committed request to the validated proposal, but human review requires instrumentation outside the server. Where compliance requires that review, log the validate call, approval event, and commit call separately, with tenant identity and checksum in each entry. Direct API mutations need equivalent policy gating and the same vault-based credential retrieval path, rather than a separate shortcut for broader campaign operations.

Assembling the complete authentication architecture for a production B2B MCP pipeline

A production request should pass through four coordinated layers. The tenant-owned Cloud project establishes Google Ads API access, with its tier managed through the Google Ads API overview page in Google Cloud Console. Secret Manager or an equivalent system protects OAuth secret material. The tenant vault supplies the correct downstream credential without exposing it to the agent. Remote OAuth 2.1 with PKCE and policy checks for each operation decide whether the request can go ahead.

An authenticated MCP request must resolve to the right tenant, credential lookup must respect revocation, and a supported write must pass the checksum gate before committing. When human approval is required, it must have its own recorded event.

Building the stack from scratch is substantial engineering work. Platforms built for credential management can handle storage, tenant isolation, and policy enforcement, but those features need to be checked as part of a review of how the system is built. Broader write integrations add further work. Bid management, budget changes, and campaign creation still need direct API paths with the same level of protection.

The developer token sunset is one of several changes to credential rules, which also cover how user tokens are created and how remote clients are registered. Separating project access, secret storage, tenant lookup, and operation approval gives those changes a defined place to land. Later changes can be made without rebuilding the whole system.

Methodology & sources

  1. Google Ads MCP server: Developer integration guide  |  Google Ads API  |  Google for Developers

    Supplied the server's tool list, version 0.0.6 behavior, deployment and authentication modes, and the propose-and-confirm write flow described throughout the article.

Renata Solberg