Gtm Mcp Server

data-ai MCP Server

An MCP server for Google Tag Manager. Connect it to your LLM, authenticate once, and start managing GTM through natural language.

Verified
data-aidata-aigcp
6 views163 stars33 forksBSD-3-Clause

Why This Matters

Discovered via github-topic:mcp and last synced 1w ago.

Verified
Source
github-topic:mcp
Stars
163
Last synced
1w ago
Install
Check source

Install

Install instructions not detected yet

Check the source repository for the latest setup steps.

View source instructions
134
Tools
0
Resources
0
Prompts
Standard I/O
Transport

Available Tools (134)

Client

Transport

update_account

Rename an account

Supported

The server does not require a specified client. Each MCP client that has OAuth 2.1 with PKCE on an HTTP transport can connect to the server. This includes clients with Dynamic Client Registration (RFC 7591) and clients without it. --- ## What You Can Do Give these instructions to your AI assistant: - *"List all my GTM containers"* - *"Create a GA4 event tag for form submissions"* - *"Examine this container for problems and duplicates"* - *"Write a tracking plan document for the marketing team"* - *"Set up ecommerce tracking for purchases"* - *"Publish the changes"* You do not use the GTM interface for these tasks. You do not copy configurations manually. You give the instruction in usual language. --- ## Quick Start ### Claude (Web and Desktop) For Claude.ai: 1. Select **Settings**, then **Connectors**, then **Add Custom Connector**. 2. Type this URL: `https://mcp.gtmeditor.com` 3. Click **Add**. 4. Sign in with your Google account. For Claude Code (CLI), use this command: ```bash claude mcp add -t http gtm https://mcp.gtmeditor.com ``` ### ChatGPT 1. Go to the [OpenAI Apps Platform](https://platform.openai.com/apps). 2. Add an MCP integration with this URL: `https://mcp.gtmeditor.com` 3. Give permission with your Google account. ### Gemini CLI ```bash gemini mcp add --transport http --url https://mcp.gtmeditor.com gtm ``` ### Cursor 1. Open **Settings**, then **MCP**. 2. Click **Add new MCP server**. 3. Set the type to **URL**. 4. Type this URL: `https://mcp.gtmeditor.com/authorize` 5. Give permission with your Google account. As an alternative, add this configuration to your `.cursor/mcp.json` file: ```json { "mcpServers": { "gtm": { "url": "https://mcp.gtmeditor.com/authorize" } } } ``` --- ## Functions ### Tag Control The server creates and changes all GTM tag types: - **GA4 configuration and events.** Set up Google Analytics 4 with the correct measurement IDs. - **Ecommerce tracking.** Use purchase, add-to-cart, and view-item events. - **Custom HTML.** Add scripts, pixels, and custom code. - **Custom image.** Add tracking pixels with cache prevention. ### Trigger Control The server creates triggers for these conditions: - Page views on all pages or on specified URLs - Custom dataLayer events - Clicks - Form submissions - Timers - Trigger groups for complex conditions ### Container Operations - Read accounts, containers, and workspaces. - Create a version from the changes in a workspace. - Publish a version to make it live. - Put items in folders. - Enable or disable the built-in variables. ### Server-Side Containers The server has full support for server-side GTM containers: - **Clients.** Create, change, and delete server-side clients. The GA4 client is an example. - **Transformations.** Control event parameters with allow, exclude, and augment rules. ### Community Template Gallery The server imports templates from the Google Community Template Gallery. Give instructions such as these: - *"Import the iubenda cookie consent template"* - *"Add Cookiebot to my container"* - *"Set up Facebook Pixel with the gallery template"* The AI assistant finds the template and its GitHub repository. Then the assistant imports the template automatically. ### AI Workflows **Container examination.** Give the instruction *"Examine my container for problems"*. The assistant examines the workspace for these conditions: - Names that do not agree - Tags that occur more than once - Triggers that no tag uses - Risks to security - Configurations that do not obey the best practices **Tracking plan.** Give the instruction *"Write a tracking plan"*. The assistant writes a markdown document with this content: - All events and their triggers - The necessary dataLayer values - The definitions of the variables - Notes about the implementation **GA4 recommendations.** Give the instruction *"Help me set up GA4 for ecommerce"*. The assistant recommends the tags, the triggers, the necessary variables, and the dataLayer code. --- ## Examples of Use ### Make a Complete Tracking Setup The assistant can make a full GA4 ecommerce implementation. Give the instruction *"Set up GA4 ecommerce tracking for my store"*. The assistant then does these steps: 1. It creates 12 tags or more. These include the configuration tag and all the ecommerce event tags. 2. It creates one trigger for each dataLayer event. 3. It creates dataLayer variables for the items, the currency, the value, and the transaction ID. 4. It obeys the Google recommendations for event names and parameters. ### Add Consent Control You can connect privacy tools such as OneTrust to your tracking. Give the instruction *"Make GA4 fire only when the user gives consent for analytics"*. The assistant then does these steps: 1. It creates the variables that read the consent. 2. It creates the related triggers. 3. It changes the applicable tags. ### Change Many Items You can control containers that have many items. Give instructions such as these: - *"Add the prefix 'ecom -' to all ecommerce triggers"* - *"Change all tags to use a measurement ID variable"* The assistant can change or move many items in one operation. ### Make Custom Variables You can make complex tracking logic. Give instructions such as these: - *"Create a variable that gives the local time"* - *"Add a custom parameter to the purchase tag"* The assistant makes custom JavaScript variables and dataLayer variables. ### Use by an Agency - Control the containers of more than one client. - Use the same implementation for all clients. - Set up a new project quickly. - Make a version and publish the changes safely. --- ## How the Server Operates The server connects AI assistants to the Google Tag Manager API. It uses the [Model Context Protocol](https://modelcontextprotocol.io). When you give an instruction, the server does these steps: 1. It authenticates you with your Google account through OAuth 2.1. 2. It reads the configuration of your container. 3. It makes the changes that you request. 4. It asks for your approval before a destructive operation. The server does not keep your Google password. The server uses tokens. You can cancel a token at any time from your Google account. --- ## Safety Functions - The server asks for approval before a deletion or a publication. - The server changes only the workspace. No change is live until you publish it. - The server makes a version before each publication. - The server writes a log of the changes. --- ## Comparison with Other GTM MCP Servers More than one MCP server for Google Tag Manager is available. The most usual alternative is [stape-io/google-tag-manager-mcp-server](https://github.com/stape-io/google-tag-manager-mcp-server). The two projects are different in their design. This section gives the facts. It does not say that one project is better than the other. Use the facts to select the server that agrees with your conditions. The data is correct on 21 August 2026. ### Design and Distribution

list_accounts

List accessible GTM accounts

auth_status

Check whether the current request is authenticated

list_containers

List containers and their public IDs and settings

list_tags

List workspace tags

get_folder_entities

List tags, triggers, and variables assigned to a folder

update_variable

Update a variable with fingerprint-based concurrency control

create_container

Create a web, app, AMP, or server container

delete_trigger

Delete a trigger; requires `confirm: true`

create_client

Create a client

create_template

Create a custom template from `.tpl` code

create_trigger

Create a trigger

create_variable

Create a variable

delete_variable

Delete a variable; requires `confirm: true`

list_transformations

List transformations

get_client

Get a client

delete_client

Delete a client; requires `confirm: true`

create_version

Create a version from a conflict-free workspace

get_transformation

Get a transformation

update_template

Update template code

suggest_ga4_setup

Recommend a GA4 structure from stated goals

get_variable

Get complete variable details

get_trigger

Get complete trigger details

ping

Test MCP connectivity

import_gallery_template

Import a Community Template Gallery template

list_variables

List workspace variables

delete_container

Permanently delete a container; requires `confirm: true`

list_triggers

List workspace triggers

create_tag

Create a tag

list_workspaces

List workspaces in a container

list_folders

List workspace folders

update_container

Rename a container while preserving its other settings

update_trigger

Update a trigger with fingerprint-based concurrency control

list_versions

List all saved version headers across every result page

get_tag_templates

Return compact GA4 and Custom HTML input examples

audit_container

Review tags, triggers, and variables for quality problems

Tool

Purpose

list_clients

List server-container clients

create_transformation

Create a transformation

publish_version

Publish a selected version; requires `confirm: true`

find_gallery_template

Guide Community Gallery discovery and import

update_tag

Update a tag with fingerprint-based concurrency control

update_client

Update a client

get_trigger_templates

Return compact trigger input examples

Prompt

Purpose

disable_built_in_variables

Disable built-in variable types; requires `confirm: true`

get_template

Get template metadata and template code

generate_tracking_plan

Build a Markdown tracking plan from a workspace

get_tag

Get complete tag details

list_built_in_variables

List enabled built-in variables

delete_tag

Delete a tag; requires `confirm: true`

enable_built_in_variables

Enable built-in variable types

list_templates

List custom templates

create_workspace

Create a workspace

update_transformation

Update a transformation

delete_template

Delete an unused template; requires `confirm: true`

delete_transformation

Delete a transformation; requires `confirm: true`

best_practices_review

Score a workspace against embedded guidance

plan_safe_edit

Produce a staged edit/version/publish plan

Language

Go

Distribution

One binary, or a Docker image

Transports

Streamable HTTP

License

BSD-3-Clause

Item

Current state

50

18

Example

`create_tag`, `list_tags`, `delete_tag`

Tools

Yes

Resources

16

Prompts

6

0

This server supplies GTM rules as MCP resources at `gtm://best-practices`. An AI assistant can read these rules before it makes a change. The topics are names and organization, the safe-edit workflow, GA4 and consent, and server-side containers. The stape-io server supplies tools only. ### Authentication

Yes

Not supplied

get_workspace_status

Show pending changes and merge conflicts

Transport

MCP Streamable HTTP

lookup_container

Find a container by destination ID or GTM public tag ID

get_container_snippet

Get a web install snippet or server-container configuration

combine_containers

Merge a source container into a target; requires `confirm: true`

move_tag_id

Move a tag ID into a new container; requires confirmation and terms acceptance

get_workspace

Get workspace metadata and its current fingerprint

update_workspace

Update selected workspace fields

delete_workspace

Delete a workspace; requires `confirm: true`

get_folder

Get complete folder metadata

create_folder

Create a folder

list_environments

List all container environments across every result page

get_environment

Get environment configuration and authorization metadata

create_environment

Create a user environment

link_destination

Move a destination to a container; requires `confirm: true`

list_google_tag_configs

List Google tag configurations in a workspace

get_google_tag_config

Get a Google tag configuration

get_latest_version_header

Get the latest saved header, which may differ from live

get_version

Get a saved version and its complete entity collections

set_latest_version

Make a version Latest without publishing; requires `confirm: true`

revert_workspace_entity

Discard workspace changes to a built-in variable, client, tag, template, transformation, trigger, variable, or zone; requires `confirm: true`

Variable

Default

TOKEN_STORE_PATH

empty

SERVICE_ACCOUNT_API_KEY

empty

GOOGLE_SERVICE_ACCOUNT_KEY_JSON

empty

quick_preview_workspace

Compile an ephemeral preview without saving or publishing

update_folder

Update a folder with fingerprint protection

list_zones

List all zones across every result page

update_environment

Update selected fields with fingerprint concurrency control

create_google_tag_config

Create a Google tag configuration

get_live_version

Get the currently published version and its entities

URI

Content

PORT

`8080`

ALLOWED_HOSTS

empty

bulk_update_workspace

Apply multiple entity changes; requires `confirm: true`

resolve_workspace_conflict

Replace a conflict with a resolved entity; requires `confirm: true`

move_entities_to_folder

Move tags, triggers, and variables; requires `confirm: true`

create_zone

Create a workspace zone

update_zone

Update selected fields with fingerprint concurrency control

delete_environment

Delete a user environment; requires `confirm: true`

delete_google_tag_config

Delete a configuration; requires `confirm: true`

update_version

Update a saved version's name or description

GOOGLE_CLIENT_ID

empty

GOOGLE_CLIENT_SECRET

empty

LOG_LEVEL

`info`

GTM_TOOL_GROUPS

current groups

sync_workspace

Synchronize with the latest container version; requires `confirm: true`

delete_folder

Delete a folder; requires `confirm: true`

revert_folder

Discard workspace folder changes; requires `confirm: true`

get_zone

Get boundary, child-container, and type-restriction configuration

delete_zone

Delete a zone; requires `confirm: true`

reauthorize_environment

Rotate the authorization code; requires `confirm: true`

list_destinations

List Google tag destinations linked to a container

update_google_tag_config

Update a configuration with fingerprint protection

delete_version

Soft-delete a version; requires `confirm: true`

BASE_URL

`http://localhost:8080`

ACCESS_TOKEN_TTL

`8h`

TRUST_PROXY

`false`

get_destination

Get a destination by its link ID

undelete_version

Restore a soft-deleted version; requires `confirm: true`

AUTH_AUTO_REFRESH_MAX_AGE

`168h`