mcp-gtm
Allows interaction with Google Tag Manager through exported JSON container files, providing tools for managing tags, triggers, variables, folders, and performing container analysis and validation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-gtmfind unused tags and triggers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-gtm
An MCP (Model Context Protocol) server that lets LLMs interact with Google Tag Manager through exported JSON container files. Zero auth setup, fully offline.
Quick Start
npm install
npm run devOr configure in your MCP client:
{
"mcpServers": {
"gtm": {
"command": "npx",
"args": ["tsx", "/path/to/mcp-gtm/src/index.ts"],
"env": {
"GTM_CONTAINER_FILE": "/path/to/your-container.json"
}
}
}
}Related MCP server: Google Tag Manager MCP Server
Tools (47 total)
Container
Tool | Description |
| Load a GTM container JSON file |
| Get container metadata |
| Get summary counts |
Tags
Tool | Description |
| List tags with trigger assignments and consent settings |
| Get tag by ID or name |
| Create a new tag |
| Update metadata, firing/blocking triggers, and additional consent checks |
| Delete a tag |
| Find tags by type (e.g. gaawe) |
Triggers
Tool | Description |
| List all triggers |
| Get trigger by ID or name |
| Create a new trigger |
| Update a trigger |
| Delete a trigger |
Variables
Tool | Description |
| List user-defined variables |
| Get variable details |
| Create a variable |
| Update a variable |
| Delete a variable |
| List built-in variables |
Folders
Tool | Description |
| List folders |
| Get folder details |
| Create a new folder |
| Delete a folder |
| Move a tag to/from a folder |
| Move a trigger to/from a folder |
| Move a variable to/from a folder |
Analysis
Tool | Description |
| Show tag trigger dependencies |
| Find unused tags/triggers/variables |
| Find triggers not used by any tag |
| Run full Zod validation |
Lifecycle
Tool | Description |
| Deterministic firing order, sequencing deps, conflicts |
| Consent analysis aware of Google built-in checks, explicit checks, and GTM built-in triggers |
| Per-tag lifecycle phase, consent relationships, issues |
Server-Side GTM
Tool | Description |
| List all zones |
| Get zone details |
| List all clients |
| Get client details |
| List all transformations |
| Get transformation details |
| List all custom templates |
| Get custom template details |
Export
Tool | Description |
| Export container state while preserving version or workspace JSON format |
| Compare version or workspace container files |
Search
Tool | Description |
| Full-text search across entity names and notes |
Undo/Redo
Tool | Description |
| Undo the last mutation |
| Redo the last undone mutation |
Resources (4 total)
Read-only MCP resources for container state snapshots:
Resource | URI | Description |
|
| Entity counts and metadata |
|
| Full tag listing |
|
| Full trigger listing |
|
| Full variable listing |
Prompts (5 total)
Pre-built prompt templates for common workflows:
Prompt | Description |
| List all entities with resolved names |
| Find unused/orphaned/disabled entities |
| Debug why a specific tag isn't firing |
| Compare two container files |
| Audit consent setup, firing order, and tag lifecycle |
Why JSON Files?
Zero auth (no GCP project, no service account)
Fully offline and testable
Diffable and version-controllable
Import back into GTM with one click
Configuration
Environment Variable | Description |
| Path to a GTM export JSON file. Auto-loaded on startup. |
| Set to any value to disable all write tools (create, update, delete, move, export). Only read and analysis tools will be available. |
Development
npm test # Run tests
npm run dev # Run server
npm run build # TypeScript check
npm run lint # Biome lint
npm run format # Biome formatLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseBqualityCmaintenanceEnables comprehensive management of Google Tag Manager accounts, containers, workspaces, tags, triggers, and variables through OAuth2 authentication, allowing users to create, update, and publish GTM configurations via natural language.26
- Alicense-qualityCmaintenanceEnables interaction with Google Tag Manager through its API with built-in Google OAuth authentication. Allows managing GTM containers, tags, triggers, and variables through natural language.64202Apache 2.0
- Alicense-qualityDmaintenanceEnables natural language management of Google Tag Manager accounts, containers, tags, triggers, variables, and versions, including creation, update, and publishing.Creative Commons Zero v1.0 Universal
- Alicense-qualityDmaintenanceEnables AI agents to manage Google Tag Manager accounts, containers, workspaces, tags, triggers, variables, and versions via the Tag Manager API v2.2Apache 2.0
Related MCP Connectors
SEO research, audits, backlinks, GSC, and content workflow tools for AI agents.
Generate 18 AI readiness files (llms.txt, ai.txt, RAG indexes, schema) for any website.
60+ Meta Ads tools for AI agents: audits, campaign management, audiences and CAPI tracking.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jamestomasino/mcp-gtm'
If you have feedback or need assistance with the MCP directory API, please join our Discord server