Samarth Gtm MCP
An open-source Model Context Protocol (MCP) server that lets AI assistants such as Claude Desktop, Claude Code and Cursor work with Google Tag Manager and GA4. It covers the full GTM API v2 surface (100+ tools, including server-side containers), the GA4 Admin and Data APIs, a built-in implementation audit, and a second server that crawls a website to check its tags and Consent Mode v2 setup. Built by Samarth…. Its 40 documented tools cover containers, workspace, tags, triggers.
People who work with containers, workspace and tags and want it reachable from Claude, Cursor, VS Code, or another MCP client. The project is written in TypeScript.
VERIFIED ACTIVE
LAST COMMIT 2026-09-22 · ★ 2 · #17 OF 86 MAINTAINED DATA & ANALYTICS · VERIFIED 2026-09-30
MIT · TypeScript servers · how we verify → /methodology
01 · Install Samarth Gtm MCP
before you install - you'll need
Set GOOGLE_DESKTOP_CLIENT_ID, GOOGLE_DESKTOP_CLIENT_SECRET, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_REDIRECT_URI, GOOGLE_SERVICE_ACCOUNT_KEY_FILE, GTM_MCP_ENABLE_WRITES, GTM_MCP_ENABLE_PUBLISH, GTM_MCP_ENABLE_DELETES, GITHUB_TOKEN before connecting.
Claude Code
claude mcp add samarthanalytics-sj-samarth-analytics-mc -- npx -y samarth-gtm-mcp Claude Desktop / Cursor / VS Code - add to config
{
"mcpServers": {
"samarthanalytics-sj-samarth-analytics-mc": {
"command": "npx",
"args": [
"-y",
"samarth-gtm-mcp"
]
}
}
} Same JSON for Cursor. For VS Code, rename the top-level key from `mcpServers` to `servers`.
Using another client? Same JSON, different key
Claude Desktop · mcpServers
Cursor · mcpServers
VS Code · servers
Windsurf · mcpServers
Zed · context_servers
Cline · mcpServers
Roo Code · mcpServers
Continue · mcpServers
LibreChat · mcpServers
Gemini CLI · mcpServers
Codex CLI · mcp_servers
Full setup guides: every client.
02 · Evidence
Security posture
What to check before giving this server access to your agent - from the registry, GitHub, and our own probes. We don't score safety; we show what's verifiable.
runs as local process (stdio) - runs on your machine with your user's permissions
license MIT - declared in the repository
npm package samarth-gtm-mcp - unscoped; check the name against the project README before installing
registry namespace io.github.samarthanalytics-sj is GitHub-verified and matches the repo owner
03 · What Samarth Gtm MCP can do
Prose above is summarized from the project's README and registry record - no invented capabilities.
What you can build
With this server connected, an agent can list all accessible GTM accounts, get a specific account, list containers in an account (auto-paginated), and get a specific container.
Capability map
Tools grouped from the project's README - what Samarth Gtm MCP lets an agent do.
Containers
7 tools - e.g. List containers in an account (auto-paginated); Get a specific container; ✏️ Create a new container
containers_list · containers_get · containers_create · containers_snippet · containers_lookup · containers_combine…
Workspace
5 tools - e.g. Review the change diff (changed entities + merge conflicts) before versioning; ✏️ Sync workspace to latest container version; ✏️ Resolve a merge conflict
workspace_get_status · workspace_sync · workspace_resolve_conflict · workspace_quick_preview · workspace_create_version_and_publish
Tags
5 tools - e.g. List all tags in a workspace; Get a specific tag; ✏️ Create a tag
tags_list · tags_get · tags_create · tags_update · tags_delete
Triggers
5 tools - e.g. List all triggers; Get a specific trigger; ✏️ Create a trigger
triggers_list · triggers_get · triggers_create · triggers_update · triggers_delete
Variables
5 tools - e.g. List all user-defined variables; Get a specific variable; ✏️ Create a variable
variables_list · variables_get · variables_create · variables_update · variables_delete
Folders
5 tools - e.g. List all folders; Get a specific folder; List entities in a folder (auto-paginated)
folders_list · folders_get · folders_entities · folders_create · folders_update
Destinations
3 tools - e.g. List linked destinations (Google tags / GA4) for a container; Get a specific destination; ✏️ Link a destination to a container
destinations_list · destinations_get · destinations_link
Workspaces
3 tools - e.g. List workspaces in a container (auto-paginated); Get a specific workspace; ✏️ Create a new workspace
workspaces_list · workspaces_get · workspaces_create
04 · Who maintains Samarth Gtm MCP
samarth-gtm-mcp is maintained by samarthanalytics-sj. It's the only MCP server we track from this author; the repo dates to May 2026.
05 · Facts
- category
- data & analytics - ranked #17 of 86 actively-maintained data & analytics servers as of 2026-09-30.
- registry
- io.github.samarthanalytics-sj/samarth-gtm-mcp (active, first published 2026-06-12 · 2 versions)
- packages
- npm:samarth-gtm-mcp
06 · Samarth Gtm MCP FAQ
Is Samarth Gtm MCP still maintained?
Yes - as of 2026-09-30, its last commit was 2026-09-22. We re-verify nightly.
What can Samarth Gtm MCP do?
With this server connected, an agent can list all accessible GTM accounts, get a specific account, list containers in an account (auto-paginated), and get a specific container.
How do I install Samarth Gtm MCP?
Run `npx -y samarth-gtm-mcp`. The README documents 10 environment variables (GOOGLE_DESKTOP_CLIENT_ID, GOOGLE_DESKTOP_CLIENT_SECRET, GOOGLE_CLIENT_ID…) to set first. Set GOOGLE_DESKTOP_CLIENT_ID, GOOGLE_DESKTOP_CLIENT_SECRET, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_REDIRECT_URI, GOOGLE_SERVICE_ACCOUNT_KEY_FILE, GTM_MCP_ENABLE_WRITES, GTM_MCP_ENABLE_PUBLISH, GTM_MCP_ENABLE_DELETES, GITHUB_TOKEN before connecting. You can also paste the ready-made client config above.
Does Samarth Gtm MCP run locally?
Yes - it's a stdio server: it runs on your machine (via npx) with your user's permissions. Your data stays local unless the server itself calls external APIs.
07 · Alternatives to Samarth Gtm MCP
Alternatives to Samarth Gtm MCP
Maintained data & analytics servers if Samarth Gtm MCP isn't the fit.
- PostHog MCP Server Official PostHog MCP Server for product analytics, feature flags, experiments, and more. ★ 40,025 · 2026-09-30
- Server Chart A Model Context Protocol server for generating charts using AntV. ★ 4,388 · 2026-08-27
- Google Ads + Meta Ads + SEO/GEO MCP Google Ads, Meta Ads, SEO, GEO & GA4 MCP by Ryze AI - audits, reports, keywords, Search Console. ★ 3,221 · 2026-09-25
- Usertour MCP Server Official Usertour MCP Server for in-app onboarding: flows, checklists, surveys, and analytics. ★ 2,313 · 2026-09-29
- Blitz Give AI agents full control over iOS/macOS development via a native macOS app with 30+ MCP tools. ★ 1,751 · 2026-07-14
- Watermelon UI Search free React, Tailwind, and shadcn components, blocks, and dashboards; get installable source. ★ 593 · 2026-09-30
Pairs well with
Servers that cover what Samarth Gtm MCP doesn't - only shown when the pairing reason fits the companion.
More data & analytics MCP servers · Overte MCP · Google Search Console · Search Console MCP · Datto RMM MCP · HaloPSA MCP
More TypeScript MCP servers · AdGuard Home MCP Server · Authentik MCP Server · Proxmox VE MCP Server · SammaPix - Image & PDF tools for AI agents · Transcriptor MCP · see all