Skip to content
MCP server

Google Tag Manager MCP

Audit Google Tag Manager tags, triggers and variables, then version and publish

Runs locallyStatus and history
Pricing
Open source
Platforms
vscode, CLI, self-hosted
Runs
Locally
Version
26.11.14
Listing updated
2 days ago

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.

Seven read tools walk the account hierarchy: accounts, containers, workspaces, then tags with their firing and blocking triggers, triggers with conditions, variables (including enabled built-ins), and the live published version. A gtm_admin tool handles the changes: create or update a tag, pause or resume it, create triggers and variables, create a version and publish it.

Safety is built in: delete_tag and publish_version only run with confirm: true. The author describes container audits, comparing event names in code with triggers, and documenting what is live as the main uses.

It reads configuration only, so it cannot tell what fires in a visitor's browser and does not replace Preview mode; server-side containers are listed but the tools were designed around web containers. Your Google account needs at least read access to the container. It runs locally via a VS Code extension or npm on Node.js 22 or newer.

Install

Run in a terminal

claude mcp add google-tag-manager-mcp --env GOOGLE_OAUTH_CLIENT_SECRET='<GOOGLE_OAUTH_CLIENT_SECRET>' --env GOOGLE_OAUTH_REFRESH_TOKEN='<GOOGLE_OAUTH_REFRESH_TOKEN>' -- npx -y @renzo.johnson/google-tag-manager-mcp

Add to claude_desktop_config.json

{
  "mcpServers": {
    "google-tag-manager-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/google-tag-manager-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "google-tag-manager-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/google-tag-manager-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "google-tag-manager-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/google-tag-manager-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}

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

{
  "mcpServers": {
    "google-tag-manager-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/google-tag-manager-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "google-tag-manager-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@renzo.johnson/google-tag-manager-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>",
        "GOOGLE_OAUTH_REFRESH_TOKEN": "<GOOGLE_OAUTH_REFRESH_TOKEN>"
      }
    }
  }
}

Configuration

  • GOOGLE_APPLICATION_CREDENTIALSPath to a service account key or authorized_user JSON file. Optional if you use gcloud Application Default Credentials or the OAuth variables.
  • GOOGLE_OAUTH_CLIENT_IDOAuth client ID. Set together with the client secret and refresh token.
  • GOOGLE_OAUTH_CLIENT_SECRETOAuth client secret.
  • GOOGLE_OAUTH_REFRESH_TOKENOAuth refresh token with the Tag Manager scopes.

Tools this server provides (8)

Taken from the project documentation; the running server may differ.

gtm_list_accounts
List Tag Manager accounts you can open.
gtm_list_containers
List containers in an account with public IDs.
gtm_list_workspaces
List workspaces in a container.
gtm_list_tags
List tags with type, firing and blocking triggers and parameters.
gtm_list_triggers
List triggers with type and conditions.
gtm_list_variables
List user-defined and enabled built-in variables.
gtm_get_live_version
Read the published version of a container.
gtm_admin
Create, update, pause and delete tags; create triggers, variables and versions; publish a version.

What it does

Container audit
Lists every tag, trigger and variable with the relationships between them.
Live version
Reads the published version of a container.
Tag editing
Creates, updates, pauses and deletes tags.
Triggers and variables
Creates new ones through named actions.
Versioning
Creates a container version from a workspace.
Confirmed publishing
Publishing to the live site needs confirm: true.

Good for

  • Find tags with no firing trigger
  • Check the GA4 configuration tag's measurement ID
  • Pause an old remarketing tag
  • Compare data-layer events with triggers
  • Write up what is live for a privacy review

Pricing

Open source

Free, MIT-licensed

Prices change. Check renzojohnson.com before you buy.

Google Tag Manager MCP FAQ

Can it replace Preview mode?

No, it reads configuration, not what fires in browsers.

Does it publish by itself?

Only when the agent passes confirm: true.

Are server-side containers supported?

They are listed, but the tools were designed around web containers.

What access do I need?

At least read access to the container in Tag Manager.

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 google-tag-manager-mcp --env GOOGLE_OAUTH_CLIENT_SECRET='<GOOGLE_OAUTH_CLIENT_SECRET>' --env GOOGLE_OAUTH_REFRESH_TOKEN='<GOOGLE_OAUTH_REFRESH_TOKEN>' -- npx -y @renzo.johnson/google-tag-manager-mcp

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, Tapetide - Indian Stock Market MCP, World Monitor and Calven.

Alternatives to Google Tag Manager MCP

  1. Open-source analytics app where an AI agent builds charts and dashboards from your data

    • Remote
    • Open source
    • 7.7K GitHub stars
    • Analytics and data
  2. Hosted MCP connector for managing Google Ads, Meta Ads, GA4 and Search Console from chat

    • 8 tools
    • Remote
    • Freemium
    • 8.1K GitHub stars
    • Marketing and SEO
  3. Indian NSE and BSE stock market data for AI assistants through 48 MCP tools

    • 17 tools
    • Remote
    • Freemium
    • 150 GitHub stars
    • Finance and payments
  4. World Monitor

    MCP server

    Live geopolitical intelligence dashboard with an API and MCP server for agents

    • Remote
    • Freemium
    • Analytics and data
  5. Calven

    MCP server

    Product marketing context from Calven delivered into Claude, ChatGPT and other AI tools

    Not checked yet
    • Remote
    • Free trial
    • 3 GitHub stars
    • Marketing and SEO
  6. CompanyData

    MCP server

    Search and enrich company records from official registers via the CompanyData API

    • 3 tools
    • Remote
    • Paid
    • 3 GitHub stars
    • Analytics and data