WAS GTM MCP
Manages Google Tag Manager accounts, containers, workspaces, tags, triggers, variables, versions, environments, and destinations via the GTM v2 API.
Click on "Deploy 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., "@WAS GTM MCPList my GTM accounts and containers."
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.
WAS GTM MCP
Manage Google Tag Manager from Claude Desktop, Cursor, Google Antigravity, or any MCP-compatible client using natural language. 19 tools cover the full GTM v2 API: accounts, containers, workspaces, tags, triggers, variables, versions, environments, destinations, and more.
100 percent local. Your credentials stay on your machine. Built by Abdullah Al Masum — Web Analytics Solution (WAS). MIT licensed.
Step 1 — Create Google Cloud OAuth Credentials
Go to the Google Cloud Console Credentials Page.
Create a Project (or select an existing one) and enable the Google Tag Manager API.
Go to OAuth consent screen:
User Type: External -> Create
App name: anything (e.g.
My GTM MCP)User support email: your email
Developer contact email: your email -> Save
Under Test users, click Add Users and add the Google account you will sign in with.
Open Google Credentials Page:
Create credentials -> OAuth client ID
Application type: Desktop app
Name: anything -> Create
Copy the Client ID and Client secret from the dialog.
Related MCP server: Google Tag Manager MCP Server
Step 2 — Connect with one terminal command
Run the interactive setup command in your terminal:
npx -y github:was-member-keramat/was-gtm-mcp authThe tool will:
Ask you to paste your Client ID and Client secret
Open your browser to Google sign-in
After you click Allow, save everything to `~/.was-gtm-mcp/config.jsona on your machine
That's it for setup. No more typing.
Step 3 — Add 4 lines to your AI client config
Open your AI tool config file:
Mac:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Paste this block (merge with any existing mcpServers):
{
"mcpServers: {
"WAS GTM MCP": {
"command": "npx",
"args": ["-y", "github:was-member-keramat/was-gtm-mcp"]
}
}
}What you can ask the AI
Here are example prompts you can use once connected:
Discovery: "List all my GTM accounts and containers."
Tags: "List all tags in my main workspace."
Create Tag: "Create a GA4 Event tag named 'GA4 - Purchase Event' with event name 'purchase'."
Triggers: "Create a Custom Event trigger for event name 'generate_lead'."
Variables: "Create a Data Layer Variable named 'dlv - user_id' for variable 'user_id'."
Raw API: "Use
ngtm_apito GET container version headers."
All tools (19 total)
Category | Tool | Description |
Accounts |
| List all accessible GTM accounts |
Accounts |
| Get details of a specific GTM account |
Containers |
| List containers in an account |
Containers |
| Get container details |
Containers |
| Create a new container (Web, iOS, Android, Server) |
Workspaces |
| List workspaces in a container |
Workspaces |
| Get workspace details |
Workspaces |
| Create a new workspace |
Tags |
| List all tags in a workspace |
Tags |
| Get details of a tag |
Tags |
| Create a new tag (GA4, Custom HTML, Google Tag, etc.) |
Tags |
| Update an existing tag |
Tags |
| Delete a tag from a workspace |
Triggers |
| List all triggers in a workspace |
Triggers |
| Get details of a trigger |
Triggers |
| Create a new trigger (Page View, Custom Event, Click, etc.) |
Variables |
| List user-defined variables in a workspace |
)Variables* |
| Create a user-defined variable (Data Layer, Constant, JS) |
Universal |
| Raw escape-hatch tool to invoke any GTM v2 REST API endpoint |
CLI commands
npx -y github:was-member-keramat/was-gtm-mcp # Start MCP server (stdio)
npx -y github:was-member-keramat/was-gtm-mcp auth # Interactive OAuth login
npx -y github:was-member-keramat/was-gtm-mcp status # View current config status
npx -y github:was-member-keramat/was-gtm-mcp logout # Delete saved credentials
npx -y github:was-member-keramat/was-gtm-mcp help # Display usage instructionsMulti-account setup
You can run multiple GTM setups by specifying environment variables per entry in your AI client config:
{
"mcpServers: {
"GTM Account A": {
"command": "npx",
"args": ["-y", "github:was-member-keramat/was-gtm-mcp"],
"env": {
"GTM_CLIENT_ID": "xxxx.apps.googleusercontent.com",
"GTM_CLIENT_SECRET": "GOCSPX-xxxx",
"GTM_REFRESH_TOKEN": "1//xxxx-token-a"
}
}
}
}Troubleshooting
Windows Script Execution Policy Error
If PowerShell blocks execution (npx.ps1 cannot be loaded), run:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
``a
### Stale `npx` Cache on Windows
If Windows caches an old version after updates are pushed to GitHub, clear the cache:
```powershell
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\npm-cache" -ErrorAction SilentlyContinue
npm cache clean --forceSecurity & Privacy
Stores refresh token locally in
~/.was-gtm-mcp/config.jsonat POSIX mode0600.Runs over standard
stdiotransport. No remote servers, tracking, or proxy middleman.
License
MIT License. Built by Abdullah Al Masum — Web Analytics Solution (WAS).
This server cannot be deployed
Maintenance
Related MCP Connectors
Read and edit GA4, Search Console and Google Tag Manager from any MCP client. 29 tools.
Let AI manage your Google Tag Manager containers — tags, triggers, variables, and more.
Marketo MCP server for AI. 130 tools to operate Marketo from Claude, Cursor, or ChatGPT.
GA4, Google Ads and Search Console in Claude. Read-only OAuth, multi-account for agencies.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables 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.2639 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables 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.182 npm216Apache 2.0
- FlicenseNot gradedqualityDmaintenanceIntegrates Google Tag Manager with Claude to automate the creation and management of tags, triggers, and variables using natural language prompts. It provides specialized tools for GA4 and Facebook Pixel setup, along with automated tracking workflows for ecommerce and lead generation sites.6-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to manage Google Tag Manager accounts, containers, workspaces, tags, triggers, variables, and versions via the Tag Manager API v2.2Apache 2.0