LABSCO SUMMARY
Same tools, two trust models — pick one.
The split here is the useful part. If you want GTM in an assistant this afternoon, the hosted Worker handles OAuth and you paste four lines. If your tags are the kind of thing that cannot route through a third party, the identical tool set runs locally on your own service account, because credentials are fetched through an interface rather than baked into the tools.
What it is
An interface to the Google Tag Manager API over MCP, shipped as two things that share the same tool set. The hosted flavour is a Cloudflare Worker at gtm-mcp.stape.ai that handles Google OAuth and the approval flow for you; the local flavour is an npm package running over stdio against a service account key or refresh token you provide.
What you get
- Every GTM tool and schema, held in a
google-tag-manager-mcp-corepackage that is independent of how credentials are obtained - A hosted path where connecting means pasting one config and completing a browser OAuth flow — no key handling on your side
- A local path where no data passes through anyone else's server: the
google-tag-manager-mcp-serverpackage run throughnpxwithGOOGLE_SERVICE_ACCOUNT_KEYset, or a refresh token instead - Tools that reach Google through an auth provider interface rather than a specific session, which is what lets the same tool set back a private deployment with your own auth
- A self-hostable Worker you can run locally against your own Google Cloud OAuth client for testing before deploying
Requirements
For the hosted server: nothing but the config, and a Google account to authorise. For the local server: Node with npx, plus either a service account key in GOOGLE_SERVICE_ACCOUNT_KEY or a refresh token. Running the Worker yourself needs a Google Cloud project with the Tag Manager API enabled, an OAuth client with http://localhost:8788/callback as a redirect URI, and GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, COOKIE_ENCRYPTION_KEY and WORKER_HOST in .dev.vars. One gotcha worth knowing before you name things: some clients cap the combined server name plus tool name at 60 characters, and a long server name silently filters tools out — keep it short, as in gtm-mcp-server.
Setup effort
Paste a URL, then authorize — add the endpoint to your client, then approve the OAuth consent screen
USE CASES
01
Getting GTM into an assistant without handling keys
Point the client at the hosted server through mcp-remote, complete the Google OAuth flow in the browser it opens, and the tools appear.
02
Keeping container data off a third party
Run the npm package locally with a service account key in the environment — no OAuth flow, and nothing leaves your machine.
03
Testing changes to the Worker before deploying
Run it locally on http://localhost:8788 against your own OAuth client, with your account added as a test user.
04
Recovering when tools stop appearing
Shorten the MCP server name to stay under the 60-character client limit, and clear the mcp-remote credential cache at ~/.mcp-auth before restarting the client.
BEFORE YOU INSTALL
What to know first
Requires
- npx on PATH
- A Google account with access to the Tag Manager containers (the hosted server signs in through Google OAuth)
- For the local package only: GOOGLE_SERVICE_ACCOUNT_KEY (a service account key) or a refresh token
Where it runs
Of the 3 documented setups, 2 run the server on your machine and 1 connects to a hosted endpoint.
INSTALLATION
Connect your client
Add the endpoint to your client, then approve the OAuth consent screen.
Server setup
ENDPOINT URL
https://gtm-mcp.stape.ai/mcpMCP Clients
Claude Desktop — remote
CLAUDE DESKTOP — REMOTE · JSON
{
"mcpServers": {
"gtm-mcp-server": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://gtm-mcp.stape.ai/mcp"
]
}
}
}Claude Desktop — local
CLAUDE DESKTOP — LOCAL · JSON
{
"mcpServers": {
"gtm-mcp-server": {
"command": "npx",
"args": [
"-y",
"google-tag-manager-mcp-server"
],
"env": {
"GOOGLE_SERVICE_ACCOUNT_KEY": "{\"type\":\"service_account\", ... }"
}
}
}
}Claude Desktop — self-hosted
CLAUDE DESKTOP — SELF-HOSTED · JSON
{
"mcpServers": {
"gtm-mcp-server-local": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:8788/mcp"
]
}
}
}