@renzo.johnson/google-tag-manager-mcp
v26.11.15
Published
Google Tag Manager MCP server for Claude Code, Cursor, Copilot and five more AI agents. mcprush.com-3e863dcd878b4219b7329946
Maintainers
Readme
Google Tag Manager MCP
Google Tag Manager MCP server for Claude Code, Cursor, Copilot and five more AI agents. This is the MCP server from the Google Tag Manager MCP VS Code extension, packaged to run with npx in any MCP client.
Requires Node.js 22 or newer.
npx -y @renzo.johnson/google-tag-manager-mcpThe server speaks MCP over stdio, so you normally let your AI agent start it, as below.
Claude Code
claude mcp add google-tag-manager-mcp -- npx -y @renzo.johnson/google-tag-manager-mcpOr add it to .mcp.json in your project (or ~/.claude.json for every project):
{
"mcpServers": {
"google-tag-manager-mcp": {
"command": "npx",
"args": ["-y", "@renzo.johnson/google-tag-manager-mcp"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json"
}
}
}
}Cursor
Add the same block to ~/.cursor/mcp.json (or .cursor/mcp.json in a project):
{
"mcpServers": {
"google-tag-manager-mcp": {
"command": "npx",
"args": ["-y", "@renzo.johnson/google-tag-manager-mcp"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json"
}
}
}
}Credentials
The server signs in to Google in this order:
| Option | Environment | Best for |
|--------|-------------|----------|
| OAuth user | GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET, GOOGLE_OAUTH_REFRESH_TOKEN (all three) | Personal Google accounts |
| Service account or saved credentials | GOOGLE_APPLICATION_CREDENTIALS = path to a JSON key | Servers, Workspace admins |
| gcloud | none: run gcloud auth application-default login once | Developers with the Google Cloud CLI |
Setting only some of the three OAuth variables stops the server with an error that names the missing ones. Enable the Tag Manager API in your Google Cloud project.
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.
VS Code
Prefer a setup wizard that registers the server with eight agents for you? Install the Google Tag Manager MCP extension instead (also on the VS Code Marketplace). Use one or the other, not both.
