MCP Server Studio

Google Tag Manager MCP MCP server

MCP server for the Google Tag Manager API v2: containers, workspaces, tags, triggers, publishing.

Registry name: io.github.A1-x-Tech/mcp-google-tagmanager

Publisher
A1-x-Tech
Runs
Runs locally
Package
npm
Version
1.4.0
Category
Developer tools
Updated
2026-11-21

Source code on GitHub

Set up Google Tag Manager MCP (run locally)

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-google-tagmanager": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "GOOGLE_TAGMANAGER_CLIENT_ID": "<GOOGLE_TAGMANAGER_CLIENT_ID>",
        "GOOGLE_TAGMANAGER_CLIENT_SECRET": "<GOOGLE_TAGMANAGER_CLIENT_SECRET>",
        "GOOGLE_TAGMANAGER_REFRESH_TOKEN": "<GOOGLE_TAGMANAGER_REFRESH_TOKEN>",
        "GOOGLE_TAGMANAGER_ACCESS_TOKEN": "<GOOGLE_TAGMANAGER_ACCESS_TOKEN>",
        "GOOGLE_TAGMANAGER_OAUTH_PORT": "<GOOGLE_TAGMANAGER_OAUTH_PORT>",
        "GOOGLE_TAGMANAGER_API_BASE": "<GOOGLE_TAGMANAGER_API_BASE>",
        "GOOGLE_TAGMANAGER_TIMEOUT_MS": "<GOOGLE_TAGMANAGER_TIMEOUT_MS>",
        "GOOGLE_TAGMANAGER_MAX_RETRIES": "<GOOGLE_TAGMANAGER_MAX_RETRIES>",
        "GOOGLE_TAGMANAGER_MIN_INTERVAL_MS": "<GOOGLE_TAGMANAGER_MIN_INTERVAL_MS>"
      }
    }
  }
}

Claude Code

Run in your terminal:

claude mcp add mcp-google-tagmanager -e GOOGLE_TAGMANAGER_CLIENT_ID='<GOOGLE_TAGMANAGER_CLIENT_ID>' -e GOOGLE_TAGMANAGER_CLIENT_SECRET='<GOOGLE_TAGMANAGER_CLIENT_SECRET>' -e GOOGLE_TAGMANAGER_REFRESH_TOKEN='<GOOGLE_TAGMANAGER_REFRESH_TOKEN>' -e GOOGLE_TAGMANAGER_ACCESS_TOKEN='<GOOGLE_TAGMANAGER_ACCESS_TOKEN>' -e GOOGLE_TAGMANAGER_OAUTH_PORT='<GOOGLE_TAGMANAGER_OAUTH_PORT>' -e GOOGLE_TAGMANAGER_API_BASE='<GOOGLE_TAGMANAGER_API_BASE>' -e GOOGLE_TAGMANAGER_TIMEOUT_MS='<GOOGLE_TAGMANAGER_TIMEOUT_MS>' -e GOOGLE_TAGMANAGER_MAX_RETRIES='<GOOGLE_TAGMANAGER_MAX_RETRIES>' -e GOOGLE_TAGMANAGER_MIN_INTERVAL_MS='<GOOGLE_TAGMANAGER_MIN_INTERVAL_MS>' -- npx -y [email protected]

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "mcp-google-tagmanager": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "GOOGLE_TAGMANAGER_CLIENT_ID": "<GOOGLE_TAGMANAGER_CLIENT_ID>",
        "GOOGLE_TAGMANAGER_CLIENT_SECRET": "<GOOGLE_TAGMANAGER_CLIENT_SECRET>",
        "GOOGLE_TAGMANAGER_REFRESH_TOKEN": "<GOOGLE_TAGMANAGER_REFRESH_TOKEN>",
        "GOOGLE_TAGMANAGER_ACCESS_TOKEN": "<GOOGLE_TAGMANAGER_ACCESS_TOKEN>",
        "GOOGLE_TAGMANAGER_OAUTH_PORT": "<GOOGLE_TAGMANAGER_OAUTH_PORT>",
        "GOOGLE_TAGMANAGER_API_BASE": "<GOOGLE_TAGMANAGER_API_BASE>",
        "GOOGLE_TAGMANAGER_TIMEOUT_MS": "<GOOGLE_TAGMANAGER_TIMEOUT_MS>",
        "GOOGLE_TAGMANAGER_MAX_RETRIES": "<GOOGLE_TAGMANAGER_MAX_RETRIES>",
        "GOOGLE_TAGMANAGER_MIN_INTERVAL_MS": "<GOOGLE_TAGMANAGER_MIN_INTERVAL_MS>"
      }
    }
  }
}

VS Code

Add to .vscode/mcp.json:

{
  "servers": {
    "mcp-google-tagmanager": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "GOOGLE_TAGMANAGER_CLIENT_ID": "<GOOGLE_TAGMANAGER_CLIENT_ID>",
        "GOOGLE_TAGMANAGER_CLIENT_SECRET": "<GOOGLE_TAGMANAGER_CLIENT_SECRET>",
        "GOOGLE_TAGMANAGER_REFRESH_TOKEN": "<GOOGLE_TAGMANAGER_REFRESH_TOKEN>",
        "GOOGLE_TAGMANAGER_ACCESS_TOKEN": "<GOOGLE_TAGMANAGER_ACCESS_TOKEN>",
        "GOOGLE_TAGMANAGER_OAUTH_PORT": "<GOOGLE_TAGMANAGER_OAUTH_PORT>",
        "GOOGLE_TAGMANAGER_API_BASE": "<GOOGLE_TAGMANAGER_API_BASE>",
        "GOOGLE_TAGMANAGER_TIMEOUT_MS": "<GOOGLE_TAGMANAGER_TIMEOUT_MS>",
        "GOOGLE_TAGMANAGER_MAX_RETRIES": "<GOOGLE_TAGMANAGER_MAX_RETRIES>",
        "GOOGLE_TAGMANAGER_MIN_INTERVAL_MS": "<GOOGLE_TAGMANAGER_MIN_INTERVAL_MS>"
      }
    }
  }
}

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "mcp-google-tagmanager": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "GOOGLE_TAGMANAGER_CLIENT_ID": "<GOOGLE_TAGMANAGER_CLIENT_ID>",
        "GOOGLE_TAGMANAGER_CLIENT_SECRET": "<GOOGLE_TAGMANAGER_CLIENT_SECRET>",
        "GOOGLE_TAGMANAGER_REFRESH_TOKEN": "<GOOGLE_TAGMANAGER_REFRESH_TOKEN>",
        "GOOGLE_TAGMANAGER_ACCESS_TOKEN": "<GOOGLE_TAGMANAGER_ACCESS_TOKEN>",
        "GOOGLE_TAGMANAGER_OAUTH_PORT": "<GOOGLE_TAGMANAGER_OAUTH_PORT>",
        "GOOGLE_TAGMANAGER_API_BASE": "<GOOGLE_TAGMANAGER_API_BASE>",
        "GOOGLE_TAGMANAGER_TIMEOUT_MS": "<GOOGLE_TAGMANAGER_TIMEOUT_MS>",
        "GOOGLE_TAGMANAGER_MAX_RETRIES": "<GOOGLE_TAGMANAGER_MAX_RETRIES>",
        "GOOGLE_TAGMANAGER_MIN_INTERVAL_MS": "<GOOGLE_TAGMANAGER_MIN_INTERVAL_MS>"
      }
    }
  }
}

Settings

NameRequiredWhat it is
GOOGLE_TAGMANAGER_CLIENT_IDNoGoogle OAuth client id (refresh-token flow).
GOOGLE_TAGMANAGER_CLIENT_SECRETNoGoogle OAuth client secret (refresh-token flow). Treat it as a secret.
GOOGLE_TAGMANAGER_REFRESH_TOKENNoGoogle OAuth refresh token; exchanged for access tokens automatically. Treat it as a secret.
GOOGLE_TAGMANAGER_ACCESS_TOKENNoReady-made OAuth access token (~1h lifetime). Alternative to the client-id/secret/refresh-token trio.
GOOGLE_TAGMANAGER_OAUTH_PORTNoFixed 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_BASENoAPI root host override.
GOOGLE_TAGMANAGER_TIMEOUT_MSNoPer-request timeout in milliseconds.
GOOGLE_TAGMANAGER_MAX_RETRIESNoRetries on transient errors (429, quota 403, and 5xx/network for reads).
GOOGLE_TAGMANAGER_MIN_INTERVAL_MSNoMinimum spacing between API requests, for the 0.25 QPS quota.

More developer tools MCP servers