Google Tag Manager

v1.0.0Marketing & SEOstable

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

aichatgptclaudegolanggoogle-api
Share:
87
Stars
0
Downloads
0
Weekly
0/5

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

Natural language GTM management
Analytics tag configuration
Google API integration for tracking
paolobietolini

Maintainer

LicenseBSD-3-Clause
Languagego
Versionv1.0.0
UpdatedMay 19, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx gtm

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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.com
2

Or 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 -d
3

Configure 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:8080
4

Add 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"
    }
  }
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "gtm": { "command": "npx", "args": ["-y", "gtm"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides