Samarth Gtm MCP server
io.github.samarthanalytics-sj/samarth-gtm-mcp·v1.19.0·2 starsGoogle Tag Manager + read-only GA4 MCP server. Read-only by default, gated writes, audits.
2 stars343 downloads/wk
Reviews
Write oneNobody has reviewed Samarth Gtm yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Samarth Gtm tools (78, 26 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
accounts_getGet details of a specific GTM account.
accounts_listList all GTM accounts accessible to the authenticated user.
audit_containerInspect a GTM workspace for common analytics implementation issues.
built_in_variables_disable[DELETE] Disable one or more built-in variables in a GTM workspace.
built_in_variables_enable[WRITE] Enable one or more built-in variables in a GTM workspace.
built_in_variables_listList all currently enabled built-in variables in a GTM workspace.
built_in_variables_revert[WRITE] Revert changes to a built-in variable in the workspace to the original container version.
containers_combine[WRITE] Combine (merge) another container into this one.
containers_createwrite action[WRITE] Create a new GTM container. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.
containers_getGet details of a specific GTM container.
containers_listList all GTM containers within a GTM account. Automatically follows pagination to return all containers.
containers_lookupLook up a GTM container by its linked destination ID (e.g. a GA4 measurement ID or tag ID).
containers_move_tag_id[WRITE] Move a Tag ID out of a container into a new container.
containers_snippetGet the GTM installation snippet (HTML/JS tagging code) for a container.
destinations_getGet details of a specific GTM destination.
destinations_link[WRITE] Link a destination (Google tag / GA4 destination) to a GTM container.
destinations_listList all destinations (linked Google tags / GA4 destinations) for a GTM container.
environments_createwrite action[WRITE] Create a new GTM environment. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.
environments_deletewrite action[DELETE] Delete a GTM environment. Requires GTM_MCP_ENABLE_DELETES=true and confirm=true.
environments_getGet details of a specific GTM environment.
environments_listList all environments in a GTM container. Automatically follows pagination.
environments_reauthorize[PUBLISH] Re-generate the authorization code for a GTM environment.
environments_updatewrite action[WRITE] Update an existing GTM environment. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.
export_containerExport a full GTM workspace summary as structured JSON.
folders_createwrite action[WRITE] Create a GTM folder. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.
folders_deletewrite action[DELETE] Delete a GTM folder. Requires GTM_MCP_ENABLE_DELETES=true and confirm=true. Contents of the folder will be unfoldered, not deleted.
folders_entitiesList all entities (tags, triggers, variables) within a specific GTM folder.
folders_getGet a specific GTM folder.
folders_listList all GTM folders in a workspace. Automatically follows pagination to return all folders.
folders_move_entities[WRITE] Move tags/triggers/variables into a folder. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.
folders_updatewrite action[WRITE] Update a GTM folder. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.
ga4_account_summaries_listList GA4 account summaries accessible to the authenticated user. Each
ga4_custom_dimensions_listList custom dimensions configured on a GA4 property (parameter name,
ga4_custom_metrics_listList custom metrics configured on a GA4 property (parameter name,
ga4_data_retention_getGet the data retention settings for a GA4 property (event data retention
ga4_data_streams_listList data streams for a GA4 property (web, Android, iOS). Web streams
ga4_enhanced_measurement_getGet the enhanced measurement settings for a specific WEB data stream
ga4_google_ads_links_listList Google Ads links for a GA4 property (linked customer ID,
ga4_key_events_listList key events (formerly "conversion events") for a GA4 property — the
ga4_properties_listList GA4 properties under a given parent account. Returns full property
ga4_property_getGet a single GA4 property by ID, including display name, time zone,
ga4_run_realtime_reportwrite actionRun a read-only GA4 Data API Realtime report (events in roughly the last
ga4_run_reportwrite actionRun a read-only GA4 Data API report for a property over a date range.
tags_createwrite action[WRITE] Create a new GTM tag. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.
tags_deletewrite action[DELETE] Delete a GTM tag. Requires GTM_MCP_ENABLE_DELETES=true and confirm=true.
tags_getGet details of a specific GTM tag.
tags_listList all GTM tags in a workspace. Automatically follows pagination to return all tags.
tags_updatewrite action[WRITE] Update an existing GTM tag. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.
triggers_createwrite action[WRITE] Create a GTM trigger. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.
triggers_deletewrite action[DELETE] Delete a GTM trigger. Requires GTM_MCP_ENABLE_DELETES=true and confirm=true.
triggers_getGet a specific GTM trigger.
triggers_listList all GTM triggers in a workspace. Automatically follows pagination to return all triggers.
triggers_updatewrite action[WRITE] Update a GTM trigger. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.
user_permissions_createwrite action[WRITE] Grant a user access to a GTM account (and optionally containers).
user_permissions_deletewrite action[DELETE] Revoke a user's access to a GTM account.
user_permissions_getGet a specific user permission record for a GTM account.
user_permissions_listList all user permissions for a GTM account. Automatically follows pagination.
user_permissions_updatewrite action[WRITE] Update a user's account and/or container access levels.
variables_createwrite action[WRITE] Create a GTM variable. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.
variables_deletewrite action[DELETE] Delete a GTM variable. Requires GTM_MCP_ENABLE_DELETES=true and confirm=true.
variables_getGet a specific GTM variable.
variables_listList all user-defined GTM variables in a workspace. Automatically follows pagination to return all variables.
variables_updatewrite action[WRITE] Update a GTM variable. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true.
versions_createwrite action[WRITE] Create a new GTM container version from a workspace (checkpoint).
versions_deletewrite action[DELETE] Delete a GTM container version.
versions_getGet the full contents of a specific GTM container version. Pass "live" as containerVersionId to get the currently live version.
versions_listList all container version headers (summary) for a GTM container.
versions_publishwrite action[PUBLISH] Publish a specific GTM container version to live.
versions_set_latest[WRITE] Set a specific container version as the "latest" (synchronizes the default workspace with this version).
versions_undelete[WRITE] Undelete a previously deleted GTM container version.
workspace_create_version_and_publishwrite action[PUBLISH] Create a new container version from a workspace and immediately publish it.
workspace_get_statusGet the status of a GTM workspace: the list of changed entities (workspaceChange)
workspace_quick_previewGenerate a quick-preview (debug) link for a GTM workspace.
workspace_resolve_conflictResolve a merge conflict for a workspace entity.
workspace_syncSyncs a workspace to the latest container version by updating all unmodified workspace entities.
workspaces_createwrite action[WRITE] Create a new workspace. Requires GTM_MCP_ENABLE_WRITES=true.
workspaces_getGet details of a specific GTM workspace.
workspaces_listList all workspaces within a GTM container. Automatically follows pagination to return all workspaces.
Public scan report
scanner v0.1.9 · 2026-09-27 · same rubric, same numbers if you re-run it
- Code scan63 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitystatic API keys via environment variables6/15
- Maintenancelast push 5 days ago15/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How Samarth Gtm compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 83/100
- higher than 65% of 48,255 servers
- Tools
- 78
- the typical server has 7
- Tools that change things
- 33%
- typical: 0%. Fewer write tools means less an agent can break
- GitHub stars
- 2
- more than 75% of 28,688 servers
- Downloads a week
- 343
- more than 83% of 12,191 servers with a package
What its tools let an agent do: 50 read · 23 change · 5 run or deploy
Install Samarth Gtm in Claude Code, Cursor or VS Code
Runs npx -y samarth-gtm-mcp on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add samarth-gtm-mcp -- npx -y samarth-gtm-mcp
What the publisher says
From the Samarth Gtm repository's README, as published. We do not edit it. Read it on GitHub
Samarth Analytics 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 Analytics for our own client work and released under the MIT license for the analytics community.
Read-only by default. Creating, updating, publishing and deleting are each behind a separate environment flag, every write also requires confirm=true, and a dry-run mode simulates writes without touching the API. See Guardrails.
Use it at your own risk, and start on a dummy container. The server acts with your Google credentials, so every change it makes is yours. Try it first on a sandbox GTM container and a test GA4 property, keep the write flags off until you have watched how it behaves, and review the container's version history after any write session. We run it in production, but your setup is not ours.
Three ways to use it
The repo also ships Samarth Desktop, a local Electron app with a chat UI that embeds this server (Quick Start), and a browser-based customer portal in apps/portal/ that runs live, read-only QC audits.
Contributions are welcome. Bug reports with a reproducible container setup are the most useful thing you can send. Read CONTRIBUTING.md first; CI runs on every pull request.
Table of Contents
- Features
- Quick Start
- Google Cloud OAuth Setup
- Service Account Limitations
- Environment Variables Reference
- Guardrails
- Available Tools
- Cloud Deployment
- Security Notes
- Development
- Releases
- Troubleshooting
Features
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Samarth Gtm: common questions
- Is Samarth Gtm MCP server safe?
- Mostly: it is graded B (83/100). Read the Samarth Gtm safety report
- How do I install Samarth Gtm?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Samarth Gtm need an API key?
- Yes. The registry entry asks for
GOOGLE_OAUTH_CLIENT_SECRET. - Is Samarth Gtm maintained?
- The last commit was 43 days ago (2026-09-22). The latest release is v1.19.0.
- What can I use instead of Samarth Gtm?
- Servers from other publishers that do the same job: AdLoop MCP server, SSH — policy-gated remote access MCP server and SSH Manager MCP server. Compare all Samarth Gtm alternatives.
- How does Samarth Gtm compare with other MCP servers?
- safety score 83/100 (higher than 65% of 48,255 servers); tools 78 (the typical server has 7); tools that change things 33% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.
Alternatives to Samarth Gtm
Same job from other publishers: the closest match first, then the best rated.
- AdLoopGoogle Ads, Reddit Ads, GA4 and Tag Manager in your AI client, with a preview before every change.not reviewedEstablishedA
- SSH — policy-gated remote accessPolicy-gated, audited SSH for Linux and Windows hosts: roles, approvals, and an audit log.not reviewedEstablishedB
- SSH ManagerSSH for AI agents: commands, files, backups and health, with approval, a vault and an audit trailnot reviewedEstablishedA