Let AI manage your Google Tag Manager containers — tags, triggers, variables, and more.
gtm ga4 MCP Server
Published by mharnettGTM + GA4 MCP: tag management, consent auditing, workspace versioning, reports.
- CATEGORY
- More to explore
- DEPLOYMENT
- Local package
- LATEST SOURCE VERSION
- 1.3.2
- SOURCE CHECKED
- Nov 27, 2026
Quick answers
How do I add gtm ga4 MCP Server to Claude Code, Cursor or Codex?
Claude CodeCommand
Run this in your terminal:
claude mcp add --env 'GOOGLE_APPLICATION_CREDENTIALS=<your-google-application-credentials>' --env 'GTM_ACCOUNT_ID=<your-gtm-account-id>' --env 'GTM_CONTAINER_ID=<your-gtm-container-id>' --transport stdio gtm-ga4 -- npx -y mcp-gtm-ga4Replace the <your-…> placeholder with your own GOOGLE_APPLICATION_CREDENTIALS and GTM_ACCOUNT_ID and GTM_CONTAINER_ID.
CursorConfig
Add this to ~/.cursor/mcp.json, or to .cursor/mcp.json in a project:
{
"mcpServers": {
"gtm-ga4": {
"command": "npx",
"args": [
"-y",
"mcp-gtm-ga4"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "<your-google-application-credentials>",
"GTM_ACCOUNT_ID": "<your-gtm-account-id>",
"GTM_CONTAINER_ID": "<your-gtm-container-id>"
}
}
}
}Replace the <your-…> placeholder with your own GOOGLE_APPLICATION_CREDENTIALS and GTM_ACCOUNT_ID and GTM_CONTAINER_ID.
CodexCommand
Run this in your terminal:
codex mcp add gtm-ga4 --env 'GOOGLE_APPLICATION_CREDENTIALS=<your-google-application-credentials>' --env 'GTM_ACCOUNT_ID=<your-gtm-account-id>' --env 'GTM_CONTAINER_ID=<your-gtm-container-id>' -- npx -y mcp-gtm-ga4Replace the <your-…> placeholder with your own GOOGLE_APPLICATION_CREDENTIALS and GTM_ACCOUNT_ID and GTM_CONTAINER_ID.
VS CodeConfig
Add this to .mcp.json at the root of your workspace:
{
"mcpServers": {
"gtm-ga4": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-gtm-ga4"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "<your-google-application-credentials>",
"GTM_ACCOUNT_ID": "<your-gtm-account-id>",
"GTM_CONTAINER_ID": "<your-gtm-container-id>"
}
}
}
}Replace the <your-…> placeholder with your own GOOGLE_APPLICATION_CREDENTIALS and GTM_ACCOUNT_ID and GTM_CONTAINER_ID.
Claude DesktopConfig
Add this to claude_desktop_config.json, then restart Claude:
{
"mcpServers": {
"gtm-ga4": {
"command": "npx",
"args": [
"-y",
"mcp-gtm-ga4"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "<your-google-application-credentials>",
"GTM_ACCOUNT_ID": "<your-gtm-account-id>",
"GTM_CONTAINER_ID": "<your-gtm-container-id>"
}
}
}
}Replace the <your-…> placeholder with your own GOOGLE_APPLICATION_CREDENTIALS and GTM_ACCOUNT_ID and GTM_CONTAINER_ID.
ChatGPTNot available
ChatGPT can't add it from its published details: it connects from the cloud and needs a public address, and this server runs on your computer.
ChatGPT setup guideWhich apps can use gtm ga4 MCP Server?
Claude Code, Cursor, Codex, VS Code and Claude Desktop can add it from its published details. ChatGPT can't: it connects from the cloud and needs a public address, and this server runs on your computer.
Does gtm ga4 MCP Server need an API key?
To run it on your computer, set GOOGLE_APPLICATION_CREDENTIALS, GTM_ACCOUNT_ID and GTM_CONTAINER_ID first, with values from the publisher.
Is gtm ga4 MCP Server official?
It's published by mharnett. The Official MCP Registry accepts names under io.github.mharnett only from the GitHub account or organisation mharnett. We last checked its listing on Nov 27, 2026. A listing shows where a server comes from; it isn't a security review.
Published packages
npm · mcp-gtm-ga4@1.3.2