← Back to directory
G

GTM MCP Server

Community
Manage Google Tag Manager through MCP.
Category
Other #9 of 678
Stars
★ 195 Very popular
Transport
stdio (local process) · Streamable HTTP
Runtime
Go 1.26+ · Docker 2+ · Prebuilt binary
Credentials
API key / credential required
License
BSD-3-Clause
Last commit
Tools
96

Static review · not runReviewed 2026-11-30

FMRS 67/100 · C · Weakest Maintenance 9/20 — Read the FMRS scoring method →

Fit and risk

What it can accessUses the networkChanges third-party account data

Best for

  • Individuals and teams able to self-host and manage GTM through MCP.
  • Team OAuth deployments where each user should act with their own Google identity and GTM permissions.
  • Automation or local stdio use where a shared service account can be managed securely.
  • Users who want selectable MCP tool groups or explicit confirmation for deletes and publication.

Not for

  • Users who need a turnkey public hosted endpoint; the former public endpoint is shut down.
  • Users who expect ongoing feature development; the project is in maintenance mode with security fixes only.
  • Use cases requiring an LLM to manage GTM account permissions; account user_permissions methods are intentionally excluded.
  • Users unwilling to manage service-account credentials, an OAuth client, or self-hosted infrastructure.

Required permissions

  • The Google identity must have the required GTM permissions on target accounts or containers: container Read for audits, Edit for workspace changes, Approve to create versions, and Publish to publish.
  • Creating or deleting containers requires the corresponding GTM account administrator access.
  • HTTP OAuth mode requires a configured Google OAuth client and requests five fixed Tag Manager scopes; actual actions remain limited by each user's GTM permissions.
  • A service account must be granted access in GTM User Management. HTTP service-account mode also requires clients to hold its API key; stdio always requires service-account credentials.

Risks and side effects

  • Publishing and deletion can affect GTM. Publication, deletion, and some other operations require explicit confirmation, while account and container operations act directly on those resources.
  • Anyone holding the service-account API key or key file can use the service account's GTM permissions.
  • The token store contains OAuth tokens and Google refresh tokens; restrict access and protect backups.
  • OAuth state is held by a single process, so multiple instances can cause token failures; without persistent token storage, restarts sign users out.
  • Without OAuth or an API key, the server starts in open mode and should not be exposed to untrusted networks.

Setup

Before you start

Runtime:Go 1.26+ · Docker 2+ · Prebuilt binary

GOOGLE_CLIENT_SECRET optionalsecret Google OAuth web-client secret, obtained with the client ID when creating the OAuth client.
SERVICE_ACCOUNT_API_KEY optionalsecret Bearer API key for HTTP service-account mode; generate one and store it in a secret manager.
GOOGLE_SERVICE_ACCOUNT_KEY_JSON optionalsecret Service-account key supplied as a JSON string; takes precedence over Application Default Credentials.
JWT_SECRET optionalsecret Read for backward compatibility but has no effect.
Other optional settings (15)
BASE_URL optional The public base URL clients use to reach the server; for OAuth, use an HTTPS URL with no trailing slash.
GOOGLE_CLIENT_ID optional Google OAuth web-client ID, obtained when creating an OAuth client in Google Auth Platform.
TOKEN_STORE_PATH optional Path for the persisted OAuth token file; use durable storage for an OAuth deployment.
TRUST_PROXY optional Set to true to trust X-Forwarded-For from a reverse proxy; use only with exactly one trusted proxy.
GOOGLE_APPLICATION_CREDENTIALS optional Path to a service-account key file used by Google Application Default Credentials; an attached Google Cloud service account can also provide credentials.
MCP_TRANSPORT optional Transport mode, either http or stdio; stdio requires service-account credentials.
DASHBOARD_ENABLED optional Set to true to enable the public connection setup page.
PORT optional HTTP listen port; defaults to 8080.
MCP_STATELESS_HTTP optional Whether to disable in-memory MCP HTTP sessions; defaults to true.
ACCESS_TOKEN_TTL optional MCP access-token lifetime; defaults to 8h and uses Go duration syntax.
AUTH_AUTO_REFRESH_MAX_AGE optional Maximum age for silent token renewal; defaults to 168h and uses Go duration syntax.
ALLOWED_HOSTS optional Comma-separated list of trusted extra host[:port] values for internal host resolution.
LOG_LEVEL optional Log level; set to debug for debug logs, while other values use info.
GTM_TOOL_GROUPS optional Comma-separated tool groups or all; unset enables the default groups.
GOOGLE_REDIRECT_URI optional Read for backward compatibility but has no effect.

There is no public hosted endpoint; self-host the server. For HTTP OAuth mode, configure a Google OAuth web client, an HTTPS hostname, and persistent token storage. For HTTP service-account mode, grant the service account GTM access and configure its credentials plus a client Bearer API key. Local stdio mode uses service-account credentials. Deploy with Docker Compose, a prebuilt binary, or Go 1.26+ from source. HTTP clients connect to the self-hosted BASE_URL; an stdio client starts the binary with --stdio.

Check that it works

Confirm the GTM MCP tools appear in your client, then ask it to list your GTM accounts without making changes. A returned account list confirms the connection and authentication are working.

Troubleshooting

  1. Check that the Tag Manager API is enabled in the Google Cloud project that owns the OAuth client or service account.
  2. Confirm that the Google identity or service account has the required access in GTM User Management.
  3. For OAuth sign-in issues, check that BASE_URL and the Google-registered callback URL match character for character and meet HTTPS or localhost requirements.
  4. For update conflicts, inspect workspace status and resolve conflicts; the workspace must also contain changes before creating a version.
  5. If OAuth mode returns intermittent 401 errors, verify that only one server instance is running and token storage is persistent.
  6. If OAuth test users must sign in again weekly, check whether the Google OAuth consent screen is still in Testing status.

Things to try

Once connected, you can ask your AI assistant things like:

  • List my accessible GTM accounts, containers, and workspaces. Do not make changes.
  • Review this workspace's tags, triggers, and variables for duplicate tags or unused triggers.
  • Create a GA4 purchase event tag, but do not publish it.
  • Show the difference between the latest saved version and the live version.

Tools 96

ping read-only
Check MCP connectivity.
auth_status read-only
Check whether the current request is authenticated.
list_accounts read-only
List GTM accounts accessible to the current identity.
update_account writes
Rename a GTM account.
list_containers read-only
List containers and their public IDs and settings.
lookup_container read-only
Find a container by destination ID or GTM public tag ID.
get_container_snippet read-only
Get a web install snippet or server-container configuration.
create_container writes
Create a web, app, AMP, or server container.
Show 88 more tools
update_container writes
Rename a container while preserving other settings.
delete_container destructive
Permanently delete a container; confirmation is required.
combine_containers destructive
Merge a source container into a target; requires an opt-in tool group and confirmation.
move_tag_id writes
Move a tag ID to a new container; requires an opt-in tool group, confirmation, and terms acceptance.
list_workspaces read-only
List workspaces in a container.
create_workspace writes
Create a workspace.
get_workspace read-only
Get workspace metadata and its current fingerprint.
update_workspace writes
Update selected workspace fields.
delete_workspace destructive
Delete a workspace; confirmation is required.
quick_preview_workspace read-only
Compile an ephemeral preview without saving or publishing.
get_workspace_status read-only
List added, updated, or deleted entities and merge conflicts.
bulk_update_workspace writes
Apply multiple entity changes; requires an opt-in tool group and confirmation.
resolve_workspace_conflict writes
Replace a conflict with a resolved entity; requires an opt-in tool group and confirmation.
sync_workspace writes
Synchronize with the latest container version; requires an opt-in tool group and confirmation.
list_tags read-only
List workspace tags.
get_tag read-only
Get complete tag details.
create_tag writes
Create a tag.
update_tag writes
Update a tag with fingerprint-based concurrency control.
delete_tag destructive
Delete a tag; confirmation is required.
list_triggers read-only
List workspace triggers.
get_trigger read-only
Get complete trigger details.
create_trigger writes
Create a trigger.
update_trigger writes
Update a trigger with fingerprint-based concurrency control.
delete_trigger destructive
Delete a trigger; confirmation is required.
list_variables read-only
List workspace variables.
get_variable read-only
Get complete variable details.
create_variable writes
Create a variable.
update_variable writes
Update a variable with fingerprint-based concurrency control.
delete_variable destructive
Delete a variable; confirmation is required.
list_folders read-only
List workspace folders.
get_folder_entities read-only
List tags, triggers, and variables assigned to a folder.
get_folder read-only
Get folder metadata; requires an opt-in tool group.
create_folder writes
Create a folder; requires an opt-in tool group.
update_folder writes
Update a folder with fingerprint protection; requires an opt-in tool group.
delete_folder destructive
Delete a folder; requires an opt-in tool group and confirmation.
move_entities_to_folder writes
Move tags, triggers, and variables; requires an opt-in tool group and confirmation.
revert_folder destructive
Discard workspace folder changes; requires an opt-in tool group and confirmation.
list_built_in_variables read-only
List enabled built-in variables.
enable_built_in_variables writes
Enable built-in variable types.
disable_built_in_variables writes
Disable built-in variable types; confirmation is required.
list_zones read-only
List all zones across every result page.
get_zone read-only
Get zone boundary, child-container, and type-restriction configuration.
create_zone writes
Create a workspace zone.
update_zone writes
Update selected fields with fingerprint-based concurrency control.
delete_zone destructive
Delete a zone; confirmation is required.
list_environments read-only
List all container environments; requires an opt-in tool group.
get_environment read-only
Get environment configuration and authorization metadata; requires an opt-in tool group.
create_environment writes
Create a user environment; requires an opt-in tool group.
update_environment writes
Update an environment with fingerprint-based concurrency control; requires an opt-in tool group.
reauthorize_environment writes
Rotate the authorization code; requires an opt-in tool group and confirmation.
delete_environment destructive
Delete a user environment; requires an opt-in tool group and confirmation.
list_destinations read-only
List Google tag destinations linked to a container; requires an opt-in tool group.
get_destination read-only
Get a destination by link ID; requires an opt-in tool group.
link_destination writes
Move a destination to a container; requires an opt-in tool group and confirmation.
list_google_tag_configs read-only
List Google tag configurations in a workspace; requires an opt-in tool group.
get_google_tag_config read-only
Get a Google tag configuration; requires an opt-in tool group.
create_google_tag_config writes
Create a Google tag configuration; requires an opt-in tool group.
update_google_tag_config writes
Update a Google tag configuration with fingerprint protection; requires an opt-in tool group.
delete_google_tag_config destructive
Delete a Google tag configuration; requires an opt-in tool group and confirmation.
list_templates read-only
List custom templates.
get_template read-only
Get template metadata and code.
create_template writes
Create a custom template from .tpl code.
update_template writes
Update template code.
delete_template destructive
Delete an unused template; confirmation is required.
import_gallery_template writes
Import a Community Template Gallery template.
get_tag_templates read-only
Return GA4 and Custom HTML input examples.
get_trigger_templates read-only
Return trigger input examples.
list_clients read-only
List server-container clients.
get_client read-only
Get a server-container client.
create_client writes
Create a server-container client.
update_client writes
Update a server-container client.
delete_client destructive
Delete a server-container client; confirmation is required.
list_transformations read-only
List transformations.
get_transformation read-only
Get a transformation.
create_transformation writes
Create a transformation.
update_transformation writes
Update a transformation.
delete_transformation destructive
Delete a transformation; confirmation is required.
list_versions read-only
List headers for all saved versions.
get_latest_version_header read-only
Get the latest saved header, which may differ from the live version.
get_version read-only
Get a saved version and its complete entity collections.
get_live_version read-only
Get the currently published version and its entities.
create_version writes
Create a version from a conflict-free workspace.
publish_version destructive
Publish a selected version; confirmation is required.
update_version writes
Update a saved version's name or description; requires an opt-in tool group.
delete_version destructive
Soft-delete a version; requires an opt-in tool group and confirmation.
undelete_version writes
Restore a soft-deleted version; requires an opt-in tool group and confirmation.
set_latest_version writes
Make a version Latest without publishing; requires an opt-in tool group and confirmation.
revert_workspace_entity destructive
Discard supported workspace entity changes; requires an opt-in tool group and confirmation.

Use cases

Inspect GTM accounts, containers, workspaces, and live versions.
Create or update tags, triggers, variables, templates, and server-container entities in a workspace.
Review workspace changes and conflicts, create a version, and publish it after explicit confirmation.
Audit a container, generate a tracking plan, or plan a safe edit.

Supported clients

Claude Code
Gemini CLIPartial support
CursorPartial support
VS CodePartial support
ChatGPTPartial support
CodexPartial support
Claude on the webPartial support

Listed from the project's documentation, not tested by this site.

Overview

GTM MCP Server connects MCP clients to the Google Tag Manager API. It can inspect containers, create and update workspace entities, create versions, and publish a selected version after explicit confirmation. It supports Streamable HTTP and local stdio with a service account. The project is in maintenance mode with security fixes only; its public hosted endpoint is shut down, so users must self-host.

Similar servers

Source revision d7111940f90a Data synced 2026-12-05 Read the FMRS scoring method Markdown

Maintainer badge: embed FMRS score

Paste this Markdown into your repository README to display a live score badge:

README.md
[![FollowMCP](https://followmcp.com/badges/gtm-mcp-server.svg)](https://followmcp.com/en/servers/gtm-mcp-server)