Google Tag Manager
An MCP server for Google Tag Manager. Connect it to your LLM, authenticate once, and start managing GTM through natural language.
What is Google Tag Manager?
Google Tag Manager is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server for google tag manager. connect it to your llm, authenticate once, and start managing gtm through natural language.
An MCP server for Google Tag Manager. Connect it to your LLM, authenticate once, and start managing GTM through natural language.
This server falls under the Marketing & SEO category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- An MCP server for Google Tag Manager. Connect it to your LLM
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx gtmConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Google Tag Manager
The GTM MCP Server is a Model Context Protocol server for Google Tag Manager that lets you manage your entire GTM account through natural language via any MCP-compatible LLM client. It exposes 40+ tools covering read and write operations across tags, triggers, variables, containers, workspaces, and server-side GTM setups, as well as version control and publishing workflows. You can authenticate once via OAuth and then create GA4 event tags, audit containers for duplicates, configure ecommerce tracking, and publish changes — all by chatting with Claude or another LLM, without touching the GTM UI.
Prerequisites
- A Google account with access to one or more Google Tag Manager containers
- Docker installed (for self-hosted deployment) OR direct access to the hosted service at https://mcp.gtmeditor.com
- An MCP-compatible client: Claude Desktop, Claude Code CLI, Cursor, or Gemini CLI
- Go 1.21+ if building from source
Add the hosted GTM MCP Server to Claude Code (easiest)
The server is available as a hosted HTTP service. Add it to Claude Code CLI in one command.
claude mcp add -t http gtm https://mcp.gtmeditor.comOr run it self-hosted with Docker
Clone the repository and start the server with Docker Compose. You will need to configure OAuth credentials and a JWT secret in a .env file.
git clone https://github.com/paolobietolini/gtm-mcp-server.git
cd gtm-mcp-server
# Create .env file with required variables
docker compose up -dConfigure self-hosted environment variables
If running self-hosted, create a .env file with your Google OAuth credentials and server settings. Google Client ID and Secret come from the Google Cloud Console.
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
JWT_SECRET=your_jwt_secret
BASE_URL=http://localhost:8080Add to Claude Desktop configuration
For the hosted version, configure Claude Desktop to use the GTM MCP Server as an HTTP transport server.
{
"mcpServers": {
"gtm": {
"type": "http",
"url": "https://mcp.gtmeditor.com"
}
}
}Authenticate with Google
On first use, the server will prompt you to authenticate with your Google account via OAuth. Follow the link provided and grant access to your GTM containers.
Google Tag Manager Examples
Client configuration
Claude Desktop configuration using the hosted GTM MCP Server endpoint.
{
"mcpServers": {
"gtm": {
"type": "http",
"url": "https://mcp.gtmeditor.com"
}
}
}Prompts to try
Natural-language GTM management commands to use after authentication.
- "List all my GTM containers and their IDs."
- "Create a GA4 event tag that fires on form submission triggers."
- "Audit my GTM container for duplicate tags or broken triggers."
- "Set up ecommerce tracking for purchase events in workspace 'Production'."
- "Show me all variables defined in my main GTM workspace."
- "Publish the changes in the current workspace with a version note 'Added GA4 events'."Troubleshooting Google Tag Manager
OAuth authentication fails or redirects to a broken URL
For self-hosted deployments, verify that BASE_URL in your .env matches the actual URL the server is reachable at, including port number. Google OAuth redirect URIs must be registered in the Google Cloud Console to match exactly.
Server returns 'permission denied' for write operations
The Google account used for OAuth must have Edit or Publish permissions on the GTM container. Check container permissions in the GTM UI under Admin → User Management.
HTTP transport not supported by my MCP client
Some older MCP client versions only support stdio transport. Update your client to a version that supports HTTP MCP servers, or use Claude Code CLI which natively supports HTTP transport via 'claude mcp add -t http'.
Frequently Asked Questions about Google Tag Manager
What is Google Tag Manager?
Google Tag Manager is a Model Context Protocol (MCP) server that mcp server for google tag manager. connect it to your llm, authenticate once, and start managing gtm through natural language. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Google Tag Manager?
Follow the installation instructions on the Google Tag Manager GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Google Tag Manager?
Google Tag Manager works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Google Tag Manager free to use?
Yes, Google Tag Manager is open source and available under the BSD-3-Clause license. You can use it freely in both personal and commercial projects.
Google Tag Manager Alternatives — Similar Marketing & SEO Servers
Looking for alternatives to Google Tag Manager? Here are other popular marketing & seo servers you can use with Claude, Cursor, and VS Code.
TopRank
★ 2.6kGoogle Ads analysis and operations — read performance, manage keywords, bids, and campaigns.
Open SEO
★ 2.1kOpen source alternative to Semrush and Ahrefs
ASO Skills
★ 1.4kAI agent skills for App Store Optimization (ASO) and app marketing. Built for indie developers, app marketers, and growth teams who want Cursor, Claude Code, or any Agent Skills-compatible AI assistant to help with keyword research, metadata optimiza
Google Meta Ads GA4
★ 994MCP server for Google Ads, Meta Ads & GA4 — works with ChatGPT, Claude, Cursor, n8n, Windsurf & more. 250+ tools for campaign management, analytics & optimization.
Meta Ads
★ 923A Model Context Protocol server that allows AI models to access, analyze, and manage Meta advertising campaigns, enabling LLMs to retrieve performance data, visualize ad creatives, and provide strategic insights for Facebook and Instagram platforms.
Google Search Console
★ 882Connects Google Search Console with Claude AI to enable SEO professionals to analyze their SEO data through natural language conversations, providing access to property information, search analytics, URL inspection, and sitemap management.
Browse More Marketing & SEO MCP Servers
Explore all marketing & seo servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Google Tag Manager in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Google Tag Manager?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.