
Samarth Analytics MCP Server: Setup for Claude, Cursor and Other Apps
Lets Claude, Cursor and other assistants read and, if you allow it, edit Google Tag Manager containers and GA4 properties.
This community server connects your assistant to Google Tag Manager and Google Analytics 4 with your own Google sign-in. It is read-only by default: creating, publishing and deleting are each off until you switch them on, and every write needs a confirm flag. You can use the author's hosted version, which is locked to read-only, or run it on your machine with your own Google OAuth client. Try any write on a test container first, because changes use your Google account.
Good for
- Analytics engineers who audit GTM containers and GA4 setups
- Marketers who want GA4 numbers and tag checks in plain chat
- Agencies managing many containers who need a read-only way in
Works in
14 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports hosted MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports hosted MCP servers.
Install Samarth Analytics MCP
Claude Code
- 1
Copy this prompt.
Add the Samarth Analytics MCP server to Claude Code. Run this command: claude mcp add samarth-gtm -- npx mcp-remote@next https://mcp.samarthanalytics.com/mcp Ask me for GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET and only put the values in that config, nowhere else. Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
Read-only mode: Read-only is the default. Do not set GTM_MCP_ENABLE_WRITES, GTM_MCP_ENABLE_PUBLISH or GTM_MCP_ENABLE_DELETES. The hosted version is always read-only.
Hosted is the quick route: you sign in with Google and it is locked to read-only. The README gives the mcp-remote config for it; other apps use the same command in their own config format. The local method needs your own Google OAuth client (create a Desktop app client in Google Cloud and enable the Tag Manager and Analytics APIs), then a one-time Google sign-in with the package's sign-in script before first use.
Built from the package data we hold. Not yet tested by us. Source.
Tools
Lists the Google Tag Manager accounts you can reach
Returns every GTM account your Google sign-in can access, which is the usual first step before looking inside a container.
Try: “Which GTM accounts do I have?”
Network ·
accounts_listLists the containers in a GTM account
Returns all containers under one account, following every page of results automatically.
Try: “List the containers in my main GTM account.”
Network ·
containers_listGets the install snippet for a container
Returns the code a website pastes in to load the container.
Try: “Give me the GTM snippet for the shop container.”
Network ·
containers_snippetLists workspaces in a container
Shows the draft workspaces in a container, where tag changes are staged before a version is made.
Try: “Show the workspaces in the shop container.”
Network ·
workspaces_listShows pending changes and merge conflicts in a workspace
Returns the changed items and any merge conflicts so you can review a draft before it becomes a version.
Try: “What has changed in my default workspace?”
Network ·
workspace_get_statusLists every tag in a workspace
Returns all tags with their type, trigger links and settings.
Try: “List all tags in the shop workspace.”
Network ·
tags_listLists every trigger in a workspace
Returns the triggers that decide when tags fire.
Try: “Which triggers fire on form submissions?”
Network ·
triggers_listLists user-defined variables
Returns the variables you created in a workspace, not the built-in ones.
Try: “Show the variables in this workspace.”
Network ·
variables_listLists published and saved container versions
Returns version headers so you can see what went live and when.
Try: “What is the latest published version of this container?”
Network ·
versions_listChecks a workspace for common GTM and GA4 setup problems
Inspects the workspace and reports typical implementation issues found in the tags and triggers.
Try: “Audit my workspace for broken or duplicate tags.”
Network ·
audit_containerExports a workspace as structured JSON
Returns a full dump of the workspace so it can be reviewed or kept as a backup.
Try: “Export the shop workspace as JSON.”
Network ·
export_containerLists your GA4 accounts and their properties
The starting point for GA4: returns each account with a summary of its properties.
Try: “Which GA4 properties do I have access to?”
Network ·
ga4_account_summaries_listLists GA4 data streams and their measurement IDs
Returns web, Android and iOS streams for a property, including each web stream's measurement ID.
Try: “What is the measurement ID for the website stream?”
Network ·
ga4_data_streams_listLists GA4 key events
Returns the events marked as key events, which used to be called conversions.
Try: “Which key events are set up in this property?”
Network ·
ga4_key_events_listRuns a GA4 report over a date range
Runs a Data API report with the dimensions and metrics you ask for, such as event counts by event name, with limits and ordering.
Try: “How many purchase events did we get by day last week?”
Network ·
ga4_run_reportShows GA4 events from roughly the last 30 minutes
Runs a realtime report, useful for checking that a tag you just changed is sending events.
Try: “Are page_view events arriving right now?”
Network ·
ga4_run_realtime_reportCreates a tag in a workspace
Adds a new tag to the draft workspace. It only works when writes are turned on, and needs confirm=true on each call.
Try: “Add a GA4 event tag for the signup button.”
Write ·
tags_createChanges an existing tag
Edits a tag in the draft workspace. Needs writes turned on and confirm=true.
Try: “Change the purchase tag to also send the currency.”
Write ·
tags_updateCreates a trigger in a workspace
Adds a new trigger to the draft workspace. Needs writes turned on and confirm=true.
Try: “Create a trigger for clicks on the signup button.”
Write ·
triggers_createSaves a workspace as a container version
Creates a version checkpoint from the draft workspace without making it live. Needs writes turned on.
Try: “Create a version from my workspace called "Add signup event".”
Write ·
versions_createPublishes a version to the live site
Makes a saved version live. This is the highest-risk action and stays off unless publishing is enabled.
Try: “Publish version 42.”
Write ·
versions_publishCreates a version and publishes it in one step
Saves the workspace as a version and makes it live in a single call. Needs both writes and publishing turned on.
Try: “Version and publish my workspace now.”
Write ·
workspace_create_version_and_publishDeletes a tag
Removes a tag from the draft workspace. Stays off unless deletes are enabled and confirm=true is passed.
Try: “Delete the old Facebook pixel tag.”
Delete ·
tags_deleteDeletes a container version
Deletes a saved version. Stays off unless deletes are enabled.
Try: “Delete version 17.”
Delete ·
versions_deleteGrants a person access to an account or container
Gives a user access levels in GTM. Needs writes turned on.
Try: “Give jo@example.com read access to the shop container.”
Write ·
user_permissions_createRevokes a person's access
Removes a user's access to an account or container. Stays off unless deletes are enabled.
Try: “Remove access for ex-employee@example.com.”
Delete ·
user_permissions_delete
Read from the source code
Permissions
medium risk · 5 things to watch
Medium risk
By default it only reads your tag and analytics data. If you turn on writes, publishing or deletes, the assistant can change or take down tags on your live site, so test on a dummy container first.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only modeHow to turn it on
Watch out for
Writes and publishing exist behind env flags
With the write, publish and delete flags on, the assistant can change tags and make a version live on your site. Keep them off, and test on a dummy container first. github.com
It can change who has access to your containers
The user permission tools can grant or revoke access when writes or deletes are enabled. Leave those flags off unless you need them. github.com
Hosted version sends your data through a third party
The hosted instance at mcp.samarthanalytics.com is a shared, best-effort community service. Use the local install if your data must not leave your machine. github.com
Your Google tokens are stored locally
The local install keeps OAuth tokens in a file or environment variables. Keep them out of git and revoke access in your Google account if needed. github.com
The repo is not an official Google project
The README says to use it at your own risk and start on a dummy container. github.com
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Turning on read-only | Read-only is the default. Writes, publishing and deletes each need their own env flag (GTM_MCP_ENABLE_WRITES, GTM_MCP_ENABLE_PUBLISH, GTM_MCP_ENABLE_DELETES). The hosted version is locked to read-only. |
|---|---|
| Talks to | Google Tag Manager and Analytics APIs. mcp.samarthanalytics.com, only if you use the hosted version |
| Sign-in and keys | Google OAuth tokens in a local token file or environment variables; the hosted version signs you in with your Google account. |
| Scopes |
|
Questions
Is Samarth Analytics MCP official?
No. It is a community project by samarthanalytics-sj, not made by Google. Google makes Tag Manager and Analytics.
What is the Samarth Analytics MCP server URL?
The author's hosted instance is https://mcp.samarthanalytics.com/mcp. You sign in with your own Google account, it only sees your containers and properties, and it is locked to read-only.
Is it read-only?
Yes by default. Creating, updating, publishing and deleting each need their own setting, and every write also needs confirm=true. A dry-run mode simulates writes without calling Google.
Do I need a Google Cloud project?
Only for the local install. You create a free Desktop app OAuth client and enter its ID and secret. The hosted version needs only your Google sign-in.
Can it publish or delete things?
Only if you switch those on. Publishing and deleting are off by default, and the README calls publishing the highest-risk action.
Does it cover GA4?
Yes. It reads GA4 Admin settings such as properties, data streams and key events, and runs GA4 Data API reports. The GA4 Admin write tools are off by default behind their own flag.
How many tools does it have?
More than 100, covering the full GTM API plus GA4. The list on this page is partial.
How do I add it to Claude Desktop?
Use the Claude Desktop tab in the install box above. The hosted method uses a small bridge because Claude Desktop config runs local programs only.
Information
updated Nov 2, 2026
- Publisher
- Community
- Package
samarth-gtm-mcp- Registry
- npm
- Transport
- stdio, Streamable HTTP
- Auth
- OAuth
- Version
- 1.494.0
- License
- MIT
- Last commit
- Oct 31, 2026
- Open issues
- 0
- Listed in
- Official MCP registry
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 1Hide
- github.com · github.com