google-ads-mcp-worker
Provides read-only access to Google Ads data through GAQL, including listing accessible customers, expanding manager (MCC) accounts into client accounts, running search queries, and retrieving resource metadata.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@google-ads-mcp-workerList my accessible Google Ads customers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
google-ads-mcp-worker
A remote MCP server for the Google Ads API, running on Cloudflare Workers.
Read-only access to your Google Ads data through GAQL, reachable over HTTPS from any MCP client — no local process, no Python environment, no container. Implements the 2026-07-28 MCP specification: stateless Streamable HTTP, server/discover, no session ids.
Status: early. The protocol layer is exercised by tests and by the smoke script below. The tool surface is small on purpose and will grow with real use. Issues and PRs welcome.
Why this exists
Google ships an official MCP server (Python, Apache-2.0). It is good, and if you want a local stdio server you should probably use it. This project is a different shape:
| this project | |
Runtime | Python, local | Cloudflare Workers, remote-first |
MCP revision | 2025-era FastMCP | 2026-07-28 (stateless, |
Ads API version | pinned in code ( |
|
Ops | you run and patch a process |
|
Cold start | Python interpreter | edge isolate, ~ms |
Auth to the server | OAuth proxy | Cloudflare Access JWT, bearer token, or open |
MCC expansion | not exposed |
|
Neither replaces the other. Use whichever matches how you deploy.
Related MCP server: Google Ads MCP Server
Tools
All four are read-only (readOnlyHint: true). This server exposes no mutating tools — it never calls a mutate endpoint, so it cannot change your campaigns, budgets, or bids.
Tool | What it does |
| Customer ids the credentials can reach directly. Start here. |
| Expand a manager (MCC) account into its client accounts, with name, currency and time zone. |
| Run a GAQL query against one account. Paginated, with |
| Selectable/filterable/sortable fields of a resource, plus compatible metrics and segments. |
The server also ships instructions (served in server/discover) telling the model the things that otherwise cost a failed query each: metrics don't exist on manager accounts, money is in micros, query fields are snake_case while the response is camelCase.
Quickstart
1. Google Ads credentials
You need four values:
Developer token — Google Ads manager account → Tools & Settings → API Center. Note the access levels: Test reaches test accounts only, Explorer is capped at 2,880 operations/day and blocks several services, Basic gives 15,000/day, Standard is uncapped.
OAuth client id and secret — Google Cloud Console → APIs & Services → Credentials → OAuth client ID, with the Google Ads API enabled on the project. Choose Desktop app unless you have a reason not to: it allows the loopback redirect the helper below uses, with nothing to register.
Refresh token — for the scope
https://www.googleapis.com/auth/adwords. If you don't have one:node scripts/get-refresh-token.mjs path/to/your-oauth-client.jsonIt runs the consent flow against a local loopback and writes the client id, secret and refresh token into
.dev.vars— no copy-pasting a token through your scrollback. Pass--printif you'd rather handle it yourself.
Two things that catch people out:
A service account will not work without domain-wide delegation. The Google Ads API expects a user credential.
While your OAuth consent screen is in Testing, refresh tokens expire after 7 days. Publish the app before you rely on one for a deployed server, or the Worker starts failing with
invalid_granta week later.
2. Install and configure
git clone https://github.com/marcosvb1/google-ads-mcp-worker
cd google-ads-mcp-worker
npm install
cp .dev.vars.example .dev.vars # fill it in3. Run it locally
npm run devThen either point the MCP Inspector at http://localhost:8787/mcp (npm run inspect), or run the smoke script:
./scripts/smoke.sh4. Deploy
Load the four Google secrets straight from a credentials file, without them passing through your terminal:
./scripts/set-secrets.sh path/to/credentials.jsonOr set each one by hand:
npx wrangler secret put GOOGLE_ADS_DEVELOPER_TOKEN
npx wrangler secret put GOOGLE_ADS_CLIENT_ID
npx wrangler secret put GOOGLE_ADS_CLIENT_SECRET
npx wrangler secret put GOOGLE_ADS_REFRESH_TOKENThen pick an auth gate — without one the server refuses every request — and ship:
npx wrangler secret put MCP_SHARED_SECRET
npx wrangler deployServing more than one manager account
Developer tokens are issued per manager account and carry their own daily operation quota, and a client's MCC usually arrives with its own token and its own login. So "which credentials" is a property of the account being queried, not of the deployment.
Suffix any credential variable with _<PROFILE> to add a profile:
# default profile
npx wrangler secret put GOOGLE_ADS_DEVELOPER_TOKEN
# profile "sirio" — its own token and manager, reusing the default login
npx wrangler secret put GOOGLE_ADS_DEVELOPER_TOKEN_SIRIO
# GOOGLE_ADS_LOGIN_CUSTOMER_ID_SIRIO goes in wrangler.jsonc (not a secret)Or in one step, per profile:
./scripts/set-secrets.sh --profile sirio path/to/credentials.jsonThen every tool takes a profile argument. It is typed as an enum of the profiles you actually configured, so a wrong value fails schema validation with the real list rather than as a confusing permission error from Google. Anything a profile leaves unset is inherited from the default, so sharing one Google login across several managers costs one variable per profile. Results echo back which profile served them.
With a single profile configured, the argument is not advertised at all — nothing to think about until you need it.
Authentication
Two separate questions, easy to conflate:
How the Worker talks to Google — one set of credentials, held as Worker secrets. Every caller of this server shares that identity.
Who may call the Worker — configured below. Because of (1), this is the gate that matters: whoever reaches
/mcpcan read whatever those credentials can read.
Three modes, resolved in order. With none configured the server denies every request — that is deliberate.
Mode | Set | How callers authenticate |
Cloudflare Access |
| Access does the OAuth; the Worker verifies the |
Bearer token |
|
|
Open |
| none — local development only |
Narrow the blast radius further with GOOGLE_ADS_ALLOWED_CUSTOMER_IDS, a comma-separated allowlist of the accounts this deployment may query. Any other id is refused before a request reaches Google.
If you put it behind a Cloudflare MCP Portal
A MCP Server Portal gives you tool curation, per-call logging and a single endpoint for several servers. It is not a security perimeter for this Worker: Cloudflare's own documentation warns that blocked users can still reach the server's direct URL and bypass the Access policy. Keep MCP_SHARED_SECRET set (the portal stores it as the upstream credential), or configure Access on the Worker itself.
Connecting a client
{
"mcpServers": {
"google-ads": {
"type": "http",
"url": "https://google-ads-mcp-worker.<your-subdomain>.workers.dev/mcp",
"headers": { "Authorization": "Bearer <MCP_SHARED_SECRET>" }
}
}
}Clients that predate the 2026-07-28 revision still work: the handler serves 2025-era requests through its stateless fallback. GET and DELETE on /mcp answer 405, since those were session operations and there are no sessions.
Configuration reference
Variable | Kind | Default | Notes |
| secret | — | required |
| secret | — | required |
| secret | — | required |
| secret | — | required, scope |
| var | — | manager account id, digits only |
| var |
| see the version note below |
| var | — | comma-separated allowlist |
| var | — | enables Cloudflare Access mode |
| secret | — | enables bearer mode |
| var | — |
|
Any of the five GOOGLE_ADS_* credential variables may carry a _<PROFILE> suffix to define an additional profile — see above. GOOGLE_ADS_API_VERSION and GOOGLE_ADS_ALLOWED_CUSTOMER_IDS are deployment-wide and are never suffixed.
Secrets may also be supplied through the Secrets Store; the code reads either a plain string binding or a store binding.
Things that will bite you
Collected from the API's sharper edges — most of them cost somebody a debugging session.
API versions are retired abruptly. On 2026-08-07,
v21began returningVersion v21 is deprecated. Requests to this version will be blocked.mid-session, and avalidateOnlydry run had passed minutes earlier. A clean dry run does not guarantee the next call succeeds. That is why the version is a var: bumpGOOGLE_ADS_API_VERSIONand redeploy. Check the sunset dates.login-customer-idis required for MCC access. Reaching a client account through a manager without it fails withUSER_PERMISSION_DENIED, and the failure does not name the missing header.Manager accounts have no metrics. Query a client account; use
list_customer_clientsto find one.Query is snake_case, response is camelCase.
cost_microsin GAQL comes back ascostMicros. Read the returnedfieldMask.Money is micros. Divide by 1,000,000.
Brazil: Google does not pass PIS/COFINS through to the advertiser, so
cost_micros / 1e6is the amount actually billed — no gross-up. This is not symmetric with Meta Ads, which does pass tax through. A report combining both channels must not apply the same factor to both.Pages cap at 10,000 rows. Ignoring
next_page_tokensilently truncates large queries.Rate limits are a token bucket, not a fixed number. Expect
RESOURCE_TEMPORARILY_EXHAUSTEDunder load and back off.A Worker has 6 simultaneous outbound connections. Relevant if you fan out across many accounts.
Design notes
googleAds:search, notsearchStream.searchStreamreturns the whole result set in one response — and, uniquely in this API, wrapped in a JSON array rather than an object. That is a poor fit for a 128 MB Worker and gives the caller no way to stop early. Paging keeps every response bounded.No Durable Object. MCP
2026-07-28is stateless, and this server is a thin REST proxy that holds nothing between requests. A freshMcpServeris built per request; the handler is built once per isolate so thatsubscriptions/listenstreams are not orphaned.No
nodejs_compat.@modelcontextprotocol/serverhas aworkerdexport condition and bundles a@cfworker/json-schemavalidator, because Ajv compiles withnew Function, which workerd forbids.Access tokens are cached per isolate and refreshed a minute early. It is only ever a cache — a cold isolate simply fetches again.
Response size is capped at 60k characters, and the tool says so rather than returning truncated (invalid) JSON.
Contributing
See CONTRIBUTING.md. The short version: npm run typecheck && npm test must pass, and new tools stay read-only unless there is a discussion first.
License
Apache-2.0. Not an official Google product, and not affiliated with Google.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityBmaintenanceRead-only MCP server for Google Ads, enabling querying campaigns, ad groups, ads, insights, and keywords without create/update/delete operations.Last updated9MIT
- Alicense-qualityCmaintenanceProvides read-only access to Google Ads account data including campaigns, ad groups, keywords, and performance reports. Enables querying via GAQL through an MCP interface.Last updatedMIT
- Flicense-qualityCmaintenanceEnables MCP clients to read Google Analytics 4 data, deployed as a Cloudflare Worker with service account authentication.Last updated
- AlicenseAqualityBmaintenanceA read-only MCP server for querying Google Ads data using GAQL, enabling AI assistants to safely read campaign performance, ad groups, and keywords.Last updated12MIT
Related MCP Connectors
Hosted Amazon Seller Central and Amazon Ads MCP server for Claude, ChatGPT, Cursor, and agents.
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/marcosvb1/google-ads-mcp-worker'
If you have feedback or need assistance with the MCP directory API, please join our Discord server