A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
An MCP server for Google Tag Manager. Connect it to your LLM, authenticate once, and start managing GTM through natural
Let AI manage your Google Tag Manager containers.
Create tags, audit configurations, generate tracking plans, and publish changes, all through natural conversation with Claude, ChatGPT, Gemini, Cursor, and more.
URL: https://mcp.gtmeditor.com
| Client | Transport | Auth Flow | Status |
|---|---|---|---|
| Claude (Web & Desktop) | Streamable HTTP | OAuth 2.1 + PKCE | Supported |
| Claude Code (CLI) | Streamable HTTP | OAuth 2.1 + PKCE | Supported |
| ChatGPT | Streamable HTTP | OAuth 2.1 + PKCE | Supported |
| Gemini CLI | Streamable HTTP | OAuth 2.1 + PKCE (DCR) | Supported |
| Cursor | Streamable HTTP | OAuth 2.1 + PKCE | Supported |
The server is client-agnostic — any MCP client that supports OAuth 2.1 with PKCE over HTTP transport should work out of the box, including clients that use Dynamic Client Registration (RFC 7591) and those that don't.
Ask your AI assistant to:
No more clicking through the GTM interface. No more copy-pasting configurations. Just describe what you need.
Claude.ai:
https://mcp.gtmeditor.comClaude Code (CLI):
claude mcp add -t http gtm https://mcp.gtmeditor.com
https://mcp.gtmeditor.comgemini mcp add --transport http --url https://mcp.gtmeditor.com gtm
https://mcp.gtmeditor.com/authorizeOr add to your .cursor/mcp.json:
{
"mcpServers": {
"gtm": {
"url": "https://mcp.gtmeditor.com/authorize"
}
}
}
Create and modify any GTM tag type:
Build triggers for any scenario:
Full support for server-side GTM containers:
Import templates from Google's Community Template Gallery:
The AI will search for the template, find the GitHub repository, and import it automatically.
Container Audit "Audit my container for issues" — Analyzes your workspace for:
Tracking Plan Generation "Generate a tracking plan" — Creates markdown documentation of:
GA4 Setup Recommendations "Help me set up GA4 for ecommerce" — Recommends:
Ask AI to create a full GA4 ecommerce implementation from scratch:
Integrate privacy tools like OneTrust with your tracking:
Manage containers at scale:
Create sophisticated tracking logic:
The GTM MCP Server connects AI assistants to the Google Tag Manager API using the Model Context Protocol. When you ask Claude or ChatGPT to manage your GTM, it:
Your credentials are never stored—the server uses token-based authentication that you can revoke anytime from your Google account.
Want to run your own instance?
Self-hosted deployments can use a Google Service Account so the whole team shares access — no individual GTM permissions needed.
How it works:
Setup:
SERVICE_ACCOUNT_API_KEY=$(openssl rand -hex 32) # share this with your team
GOOGLE_SERVICE_ACCOUNT_KEY_JSON=$(cat key.json) # paste JSON content
go run main.go
On GCP (Cloud Run, GKE, Compute Engine): omit GOOGLE_SERVICE_ACCOUNT_KEY_JSON — Workload Identity is used automatically.
Connecting Claude Code:
Add the API key as a pre-configured header so Claude Code uses S2S automatically:
{
"mcpServers": {
"gtm": {
"type": "http",
"url": "http://your-server:8080",
"headers": {
"Authorization": "Bearer your-api-key"
}
}
}
}
Programmatic / API access:
Any HTTP client can call the server directly — no browser, no OAuth:
curl -H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
http://your-server:8080/mcp \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
See examples/gtm_agent.py for a complete Python agent that uses Claude to manage GTM programmatically via the API key.
git clone https://github.com/paolobietolini/gtm-mcp-server.git
cd gtm-mcp-server
# Create .env file
cat > .env << 'EOF'
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret
JWT_SECRET=$(openssl rand -base64 32)
BASE_URL=http://localhost:8080
EOF
# Start the server
docker compose up -d
# Add to Claude
claude mcp add -t http gtm http://localhost:8080
When running behind a reverse proxy (Caddy, nginx, Cloudflare), set TRUST_PROXY=true so the rate limiter uses the client's real IP from X-Forwarded-For instead of the proxy's address:
TRUST_PROXY=true
The Docker Compose setup sets this automatically since the container runs behind Caddy. When running the binary directly without a proxy, leave it unset or false — otherwise clients can spoof IPs to bypass rate limiting.
If another container needs to reach the MCP server via an internal Docker network alias, add ALLOWED_HOSTS to your .env:
ALLOWED_HOSTS=gtm-mcp:8080
This enables dynamic URL resolution for trusted internal hostnames while keeping the server secure against host header injection.
https://claude.ai/api/mcp/auth_callback
https://claude.com/api/mcp/auth_callback
https://chatgpt.com/connector_platform_oauth_redirect
https://your-domain.com/oauth/callback
| Tool | Description |
|---|---|
list_accounts | List all GTM accounts |
list_containers | List containers in an account |
list_workspaces | List workspaces in a container |
list_tags | List all tags in a workspace |
get_tag | Get tag details by ID |
list_triggers | List all triggers |
get_trigger | Get trigger details by ID |
list_variables | List all variables |
get_variable | Get variable details by ID |
list_folders | List folders in a workspace |
get_folder_entities | Get tags/triggers/variables in a folder |
list_built_in_variables | List enabled built-in variables in a workspace |
| Tool | Description |
|---|---|
ping | Test server connectivity |
auth_status | Check authentication status |
| Tool | Description |
|---|---|
update_account | Rename a GTM account |
create_container | Create a new container in an account |
update_container | Rename a container (preserves usage context, domain, notes) |
delete_container | Remove a container (requires confirmation) |
create_workspace | Create a new workspace in a container |
create_tag | Create a new tag |
update_tag | Modify an existing tag |
delete_tag | Remove a tag (requires confirmation) |
create_trigger | Create a new trigger |
update_trigger | Modify an existing trigger |
delete_trigger | Remove a trigger (requires confirmation) |
create_variable | Create a new variable |
update_variable | Modify an existing variable |
delete_variable | Remove a variable (requires confirmation) |
enable_built_in_variables | Enable built-in variable types in a workspace |
disable_built_in_variables | Disable built-in variable types (requires confirmation) |
| Tool | Description |
|---|---|
list_clients | List all clients in a workspace |
get_client | Get client details by ID |
create_client | Create a new client |
update_client | Modify an existing client |
delete_client | Remove a client (requires confirmation) |
list_transformations | List all transformations in a workspace |
get_transformation | Get transformation details by ID |
create_transformation | Create a new transformation |
update_transformation | Modify an existing transformation |
delete_transformation | Remove a transformation (requires confirmation) |
| Tool | Description |
|---|---|
get_workspace_status | Check pending changes and merge conflicts before versioning |
list_versions | List all container versions with tag/trigger/variable counts |
create_version | Create a version from workspace changes |
publish_version | Publish a version (requires confirmation) |
| Tool | Description |
|---|---|
get_tag_templates | Get GA4/HTML tag parameter examples |
get_trigger_templates | Get trigger configuration examples |
list_templates | List custom templates in a workspace |
get_template | Get template details including template code |
create_template | Create a custom template from .tpl code |
update_template | Modify an existing template |
delete_template | Remove a template (requires confirmation) |
import_gallery_template | Import a template from the Community Gallery |
Access GTM data via structured URIs:
gtm://accounts
gtm://accounts/{id}/containers
gtm://accounts/{id}/containers/{id}/workspaces
gtm://accounts/.../workspaces/{id}/tags
gtm://accounts/.../workspaces/{id}/triggers
gtm://accounts/.../workspaces/{id}/variables
| Prompt | Description |
|---|---|
audit_container | Comprehensive container analysis |
generate_tracking_plan | Markdown documentation generator |
suggest_ga4_setup | GA4 implementation recommendations |
find_gallery_template | Guide to find and import Community Gallery templates |
The server provides two resources to help AI assistants use it more effectively — one for any LLM or agent, and one specifically for Claude Code users.
The server hosts an llms.txt file at its root that any LLM or agent can fetch for context. It documents the GTM hierarchy, all available tools, common workflows, safety rules, and the GA4 parameter format.
https://mcp.gtmeditor.com/llms.txt
This follows the llms.txt standard. Agent frameworks that support llms.txt will pick this up automatically. You can also fetch it manually or include it as a system prompt for custom integrations.
For Claude Code users, install the GTM MCP skill for guided workflows, anti-patterns to avoid, and step-by-step task patterns:
# One-liner install
curl -sL https://github.com/paolobietolini/gtm-mcp-server/archive/main.tar.gz | tar xz && \
mkdir -p ~/.claude/skills && \
cp -r gtm-mcp-server-main/skills/gtm-mcp ~/.claude/skills/ && \
rm -rf gtm-mcp-server-main
Or clone and copy:
git clone https://github.com/paolobietolini/gtm-mcp-server.git
cp -r gtm-mcp-server/skills/gtm-mcp ~/.claude/skills/
The skill teaches Claude how to discover IDs, create tags with the correct parameter format, follow the publish workflow, and avoid common mistakes.
For deeper API context (parameter schemas, validation rules, request templates for all entity types), install the GTM API skill:
Claude Code:
curl -sL https://github.com/paolobietolini/gtm-api-for-llms/archive/main.tar.gz | tar xz && \
mkdir -p ~/.claude/skills && \
cp -r gtm-api-for-llms-main/skills/gtm-api ~/.claude/skills/ && \
rm -rf gtm-api-for-llms-main
OpenAI Codex:
curl -sL https://github.com/paolobietolini/gtm-api-for-llms/archive/main.tar.gz | tar xz && \
mkdir -p ~/.codex/skills && \
cp -r gtm-api-for-llms-main/skills/gtm-api ~/.codex/skills/ && \
rm -rf gtm-api-for-llms-main
The GTM API for LLMs repository provides LLM-optimized documentation: request templates, validation rules, workflow algorithms, and complete schemas for all GTM entity types including server-side containers.
autoEventFilter silently dropped by Google Tag Manager APIWhen creating or updating linkClick, click, or formSubmission triggers via the API, the autoEventFilter field (used for "Some Link Clicks"/"Some Form Submissions" conditions) is silently dropped by the Google Tag Manager API. The API returns 200 OK with a new fingerprint but does not persist the autoEventFilter.
This has been confirmed by HTTP-level debugging: the correct JSON is sent in the request body, but Google's response omits the field. The filter and customEventFilter fields work correctly.
Workaround: Configure autoEventFilter conditions manually through the GTM web interface. The MCP server can read triggers that have autoEventFilter set via the UI.
Status: #33
Paolo Bietolini
A Jetbrains IDE IntelliJ plugin aimed to provide coding agents the ability to leverage intelliJ's indexing of the codeba
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnos
Run Claude Code as an MCP server so any agent can delegate coding tasks to it