Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Google Tag Manager MCPNew to Visual Studio Code? Get it now.
Google Tag Manager MCP

Google Tag Manager MCP

Renzo

| (0) | Free
Google Tag Manager MCP server for Claude Code, Cursor, Copilot and five more AI agents.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Google Tag Manager MCP

VS Code Marketplace Open VSX License: MIT

Google Tag Manager MCP server for Claude Code, Cursor, Copilot and five more AI agents. Connect Google Tag Manager to Claude, Copilot, Cursor, Codex, Gemini, Windsurf, Continue.dev and Cline. One extension, 8 agents, no config files to edit.

Install. Sign in with Google. Ask your AI agent about Google Tag Manager.

Quick Start

  1. Install from the VS Code Marketplace or Open VSX
  2. Authenticate: the setup wizard appears on first launch
  3. Ask your AI agent anything about Google Tag Manager
"List the tags in my main GTM container"
"Which triggers fire the GA4 config tag?"
"What changed in the live container version?"

Prerequisites

You need one of these (the wizard will guide you):

Method Best For What You Need
OAuth (recommended) Personal Google accounts A Google Cloud project with OAuth credentials
ADC Developers with gcloud CLI Run one terminal command
Service Account Workspace admins and servers A JSON key file

Option A: OAuth 2.0 (Browser Login), recommended

  1. Go to Google Cloud Console
  2. Create a project (or select an existing one)
  3. Enable the Tag Manager API under APIs & Services > Library
  4. Create OAuth credentials:
    • Go to APIs & Services > Credentials
    • Click Create Credentials > OAuth client ID
    • Application type: Desktop app
    • Copy the Client ID and Client Secret
  5. Configure the OAuth consent screen (if prompted) and add yourself as a test user
  6. In the extension wizard, select "OAuth" and paste your Client ID and Secret
  7. A browser window opens: sign in with your Google account and authorize

Option B: Application Default Credentials

gcloud auth application-default login \
  --scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/tagmanager.readonly,https://www.googleapis.com/auth/tagmanager.edit.containers,https://www.googleapis.com/auth/tagmanager.edit.containerversions,https://www.googleapis.com/auth/tagmanager.publish

Option C: Service Account Key

  1. Create a service account in Google Cloud Console and give it access to your Google Tag Manager data
  2. Download the JSON key file
  3. In the extension wizard, select "Service Account" and pick the file

Available Tools (9)

Tool What It Does Example Prompt
gtm_list_accounts List your GTM accounts "Which GTM accounts can I see?"
gtm_list_containers Containers and their GTM-XXXX IDs "List the containers in my account"
gtm_list_workspaces Workspaces in a container "Which workspaces are open?"
gtm_list_tags Tags with triggers and parameters "Which tags fire on all pages?"
gtm_list_triggers Triggers and their conditions "Show the click triggers"
gtm_list_variables User-defined and built-in variables "Which variables read the data layer?"
gtm_get_live_version What is published right now "What is live in GTM-ABC123?"

GTM Admin (gtm_admin)

One tool, called with an action and its params.

Action Needs confirm: true
create_tag(workspace_path, name, type, parameters?, firing_trigger_ids?, blocking_trigger_ids?) No
update_tag(tag_path, name?, parameters?, firing_trigger_ids?, blocking_trigger_ids?) No
pause_tag(tag_path, paused?) No
delete_tag(tag_path) Yes
create_trigger(workspace_path, name, type, filters?, custom_event_filters?, auto_event_filters?) No
create_variable(workspace_path, name, type, parameters?) No
create_version(workspace_path, name?, notes?) No
publish_version(version_path) Yes

Edits land in a workspace. Nothing reaches your site until publish_version, which needs confirm: true.

Safety

Actions that delete, remove, replace or publish need confirm: true in their params. Without it the server changes nothing and returns a warning, so your AI agent has to ask you and then call again with confirm: true.


Supported AI Agents

The extension auto-registers with every AI agent it detects:

Agent How It Registers Config File
VS Code Copilot VS Code API (automatic) --
Claude Code ~/.claude.json JSON
Cursor ~/.cursor/mcp.json JSON
OpenAI Codex ~/.codex/config.toml TOML
Google Gemini ~/.gemini/settings.json JSON
Windsurf ~/.codeium/windsurf/mcp_config.json JSON
Continue.dev ~/.continue/config.yaml YAML
Cline VS Code globalStorage JSON

You can toggle individual agents on/off in Settings > search googleTagManagerMcp.agents.


Settings

Setting Default Description
googleTagManagerMcp.authMethod "oauth" Auth method: oauth, adc, serviceAccount
googleTagManagerMcp.agents.* true Per-agent registration toggles
googleTagManagerMcp.registrationScope "global" Global or workspace registration
googleTagManagerMcp.autoStart true Auto-start server on VS Code launch
googleTagManagerMcp.serverLogLevel "info" Server log verbosity

Commands

Open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P) and search for:

Command What It Does
Google Tag Manager MCP: Setup Authentication Run the setup wizard
Google Tag Manager MCP: Register with AI Agents Re-register with all detected agents
Google Tag Manager MCP: Show Status Show auth method and server state
Google Tag Manager MCP: Restart MCP Server Restart the background MCP server
Google Tag Manager MCP: Check Authentication Status Verify credentials are valid
Google Tag Manager MCP: View Server Logs Open the output channel for debugging
Google Tag Manager MCP: Remove from All Agents Clean up all agent registrations

Troubleshooting

"Google Tag Manager MCP: Setup" in the status bar

Your credentials aren't configured. Click the status bar item or run Google Tag Manager MCP: Setup Authentication.

"Permission Denied" errors

Your credentials don't have access to the requested data. Make sure the Tag Manager API are enabled in your Google Cloud project.

Server keeps crashing

Run Google Tag Manager MCP: View Server Logs to see the error. Common causes:

  • Expired credentials: run the setup wizard again
  • Node.js not found: install Node.js 22 or newer

Uninstalling cleanly

Before uninstalling, run Google Tag Manager MCP: Remove from All Agents to clean up config files.


Privacy

This extension:

  • Does NOT collect telemetry or send data to third parties
  • Communicates only with Google APIs using your own credentials
  • Stores credentials in VS Code's built-in SecretStorage (encrypted, per-user)
  • OAuth refresh tokens never leave your machine

Links

  • Documentation
  • Report an Issue

By Renzo Johnson | Published by mercurial

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft