Google Tag Manager MCP
Inspect and manage Google Tag Manager containers, with drafts kept apart from publishing
- Pricing
- Open source
- Platforms
- CLI, API
- Runs
- Locally
- Version
- 1.3.3
- Listing updated
- today
Similar MCP servers
About Google Tag Manager MCP
Google Tag Manager MCP is an open-source MCP server for marketing and seo. It runs locally on your machine and is started by your AI client.
Tag changes are risky when they go live straight away, so this server mirrors Tag Manager's own release path. Accounts hold containers, containers hold workspaces for drafts, tags, triggers and variables live in a workspace, compiling a workspace makes a container version, and publishing makes a version live. Each step is a separate operation, and the assistant is expected to ask before changing anything.
The README counts 25 tools: 10 only read, 4 create drafts or adjust built-in variables, and 5 can alter, delete, compile or publish live configuration. Updates replace a whole resource and are protected by its fingerprint. A typical flow lists containers and the tags firing on page view, then prepares a GA4 configuration tag as a draft without publishing it.
You can say connect Google Tag Manager and the server guides you through creating an OAuth client, catches the redirect on 127.0.0.1 with PKCE and keeps the tokens itself, or you can supply a client ID, secret and refresh token. Google allows 0.25 requests per second per project, so requests are spaced at least 4.2 seconds apart. It needs Node.js 20 or newer.
Install
Run in a terminal
claude mcp add mcp-google-tagmanager --env GOOGLE_TAGMANAGER_CLIENT_SECRET='<GOOGLE_TAGMANAGER_CLIENT_SECRET>' --env GOOGLE_TAGMANAGER_REFRESH_TOKEN='<GOOGLE_TAGMANAGER_REFRESH_TOKEN>' --env GOOGLE_TAGMANAGER_ACCESS_TOKEN='<GOOGLE_TAGMANAGER_ACCESS_TOKEN>' -- npx -y mcp-google-tagmanagerAdd to claude_desktop_config.json
{
"mcpServers": {
"mcp-google-tagmanager": {
"command": "npx",
"args": [
"-y",
"mcp-google-tagmanager"
],
"env": {
"GOOGLE_TAGMANAGER_CLIENT_SECRET": "<GOOGLE_TAGMANAGER_CLIENT_SECRET>",
"GOOGLE_TAGMANAGER_REFRESH_TOKEN": "<GOOGLE_TAGMANAGER_REFRESH_TOKEN>",
"GOOGLE_TAGMANAGER_ACCESS_TOKEN": "<GOOGLE_TAGMANAGER_ACCESS_TOKEN>"
}
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"mcp-google-tagmanager": {
"command": "npx",
"args": [
"-y",
"mcp-google-tagmanager"
],
"env": {
"GOOGLE_TAGMANAGER_CLIENT_SECRET": "<GOOGLE_TAGMANAGER_CLIENT_SECRET>",
"GOOGLE_TAGMANAGER_REFRESH_TOKEN": "<GOOGLE_TAGMANAGER_REFRESH_TOKEN>",
"GOOGLE_TAGMANAGER_ACCESS_TOKEN": "<GOOGLE_TAGMANAGER_ACCESS_TOKEN>"
}
}
}
}Add to .vscode/mcp.json
{
"servers": {
"mcp-google-tagmanager": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-google-tagmanager"
],
"env": {
"GOOGLE_TAGMANAGER_CLIENT_SECRET": "<GOOGLE_TAGMANAGER_CLIENT_SECRET>",
"GOOGLE_TAGMANAGER_REFRESH_TOKEN": "<GOOGLE_TAGMANAGER_REFRESH_TOKEN>",
"GOOGLE_TAGMANAGER_ACCESS_TOKEN": "<GOOGLE_TAGMANAGER_ACCESS_TOKEN>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-google-tagmanager": {
"command": "npx",
"args": [
"-y",
"mcp-google-tagmanager"
],
"env": {
"GOOGLE_TAGMANAGER_CLIENT_SECRET": "<GOOGLE_TAGMANAGER_CLIENT_SECRET>",
"GOOGLE_TAGMANAGER_REFRESH_TOKEN": "<GOOGLE_TAGMANAGER_REFRESH_TOKEN>",
"GOOGLE_TAGMANAGER_ACCESS_TOKEN": "<GOOGLE_TAGMANAGER_ACCESS_TOKEN>"
}
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"mcp-google-tagmanager": {
"command": "npx",
"args": [
"-y",
"mcp-google-tagmanager"
],
"env": {
"GOOGLE_TAGMANAGER_CLIENT_SECRET": "<GOOGLE_TAGMANAGER_CLIENT_SECRET>",
"GOOGLE_TAGMANAGER_REFRESH_TOKEN": "<GOOGLE_TAGMANAGER_REFRESH_TOKEN>",
"GOOGLE_TAGMANAGER_ACCESS_TOKEN": "<GOOGLE_TAGMANAGER_ACCESS_TOKEN>"
}
}
}
}Using several servers? Build one config file with the MCP config generator.
Configuration
GOOGLE_TAGMANAGER_CLIENT_IDGoogle OAuth client id (refresh-token flow).GOOGLE_TAGMANAGER_CLIENT_SECRETGoogle OAuth client secret (refresh-token flow). Treat it as a secret.GOOGLE_TAGMANAGER_REFRESH_TOKENGoogle OAuth refresh token; exchanged for access tokens automatically. Treat it as a secret.GOOGLE_TAGMANAGER_ACCESS_TOKENReady-made OAuth access token (~1h lifetime). Alternative to the client-id/secret/refresh-token trio.GOOGLE_TAGMANAGER_OAUTH_PORTFixed port for the loopback listener of the in-chat login (127.0.0.1 + PKCE). Set it when the client runs over SSH port forwarding; otherwise a free port is picked per login.GOOGLE_TAGMANAGER_API_BASEAPI root host override.GOOGLE_TAGMANAGER_TIMEOUT_MSPer-request timeout in milliseconds.GOOGLE_TAGMANAGER_MAX_RETRIESRetries on transient errors (429, quota 403, and 5xx/network for reads).GOOGLE_TAGMANAGER_MIN_INTERVAL_MSMinimum spacing between API requests, for the 0.25 QPS quota.
What it does
- Draft-first workflow
- Tags, triggers and variables are created in a workspace, and publishing is separate.
- Conversational sign-in
- Connects Google from the chat using OAuth with PKCE, with no config files.
- Tiered tools
- 10 read-only tools, 4 draft tools and 5 that can change live configuration.
- Quota-aware
- Spaces requests by at least 4.2 seconds to respect the 0.25 per second quota.
- Fingerprint-protected updates
- Whole-resource updates are guarded by the resource's fingerprint.
- Version compile and publish
- Compiles a workspace into a named version and publishes it deliberately.
Good for
- List which tags fire on the page-view trigger
- Prepare a GA4 configuration tag as a draft
- Enable the click variables a trigger needs
- Compile and publish a named container version after review
Pricing
Open source
Google Tag Manager MCP FAQ
Does it publish automatically?
No. Creating drafts and publishing a version are separate operations.
What do I need?
Node.js 20 or newer and a Google account with Tag Manager access.
How does it sign in?
Through an in-chat OAuth flow, or with a client ID, secret and refresh token you supply.
Why is it slow on big jobs?
Google limits Tag Manager to 0.25 requests per second per project.
Is Google Tag Manager MCP free?
Yes. Google Tag Manager MCP is open source, so you can use and self-host it for free.
How do I add Google Tag Manager MCP to Claude Code?
Run this command in your terminal: claude mcp add mcp-google-tagmanager --env GOOGLE_TAGMANAGER_CLIENT_SECRET='<GOOGLE_TAGMANAGER_CLIENT_SECRET>' --env GOOGLE_TAGMANAGER_REFRESH_TOKEN='<GOOGLE_TAGMANAGER_REFRESH_TOKEN>' --env GOOGLE_TAGMANAGER_ACCESS_TOKEN='<GOOGLE_TAGMANAGER_ACCESS_TOKEN>' -- npx -y mcp-google-tagmanager
What are the best alternatives to Google Tag Manager MCP?
The closest alternatives to Google Tag Manager MCP are Agent-Native Analytics, Google Ads + Meta Ads + SEO/GEO MCP, dashboard-icons, Tapetide - Indian Stock Market MCP and World Monitor.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

