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 all tags |
| Get tag by ID or name |
| Create a new tag |
| Update an existing tag |
| 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 pattern detection, issue classification, recommendations |
| 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 to JSON |
| Compare two 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.
Latest Blog Posts
- 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