samarth-gtm-mcp

v1.19.0
io.github.samarthanalytics-sj/samarth-gtm-mcp Checked 2 hours ago Published 5 months ago

Google Tag Manager + read-only GA4 MCP server.

Values you need

VariableWhat it is
GOOGLE_OAUTH_CLIENT_IDrequired Your Google OAuth 2.0 client ID (Desktop app type)
GOOGLE_OAUTH_CLIENT_SECRETrequired secret Your Google OAuth 2.0 client secret
GTM_MCP_ENABLE_WRITESoptional Set to 'true' to allow create/update operations (default: read-only)
GTM_MCP_ENABLE_PUBLISHoptional Set to 'true' to allow publish operations (default: disabled)
GTM_MCP_ENABLE_DELETESoptional Set to 'true' to allow delete operations (default: disabled)

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add samarth-gtm-mcp -e 'GOOGLE_OAUTH_CLIENT_ID=<GOOGLE_OAUTH_CLIENT_ID>' -e 'GOOGLE_OAUTH_CLIENT_SECRET=<GOOGLE_OAUTH_CLIENT_SECRET>' -- npx -y samarth-gtm-mcp@1.19.0
Add to claude_desktop_config.json
{
  "mcpServers": {
    "samarth-gtm-mcp": {
      "args": [
        "-y",
        "samarth-gtm-mcp@1.19.0"
      ],
      "command": "npx",
      "env": {
        "GOOGLE_OAUTH_CLIENT_ID": "<GOOGLE_OAUTH_CLIENT_ID>",
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "samarth-gtm-mcp": {
      "args": [
        "-y",
        "samarth-gtm-mcp@1.19.0"
      ],
      "command": "npx",
      "env": {
        "GOOGLE_OAUTH_CLIENT_ID": "<GOOGLE_OAUTH_CLIENT_ID>",
        "GOOGLE_OAUTH_CLIENT_SECRET": "<GOOGLE_OAUTH_CLIENT_SECRET>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "GOOGLE_OAUTH_CLIENT_ID",
      "id": "google-oauth-client-id",
      "password": true,
      "type": "promptString"
    },
    {
      "description": "GOOGLE_OAUTH_CLIENT_SECRET",
      "id": "google-oauth-client-secret",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "samarth-gtm-mcp": {
      "args": [
        "-y",
        "samarth-gtm-mcp@1.19.0"
      ],
      "command": "npx",
      "env": {
        "GOOGLE_OAUTH_CLIENT_ID": "${input:google-oauth-client-id}",
        "GOOGLE_OAUTH_CLIENT_SECRET": "${input:google-oauth-client-secret}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.samarth-gtm-mcp]
command = "npx"
args = ["-y", "samarth-gtm-mcp@1.19.0"]
env = { "GOOGLE_OAUTH_CLIENT_ID" = "<GOOGLE_OAUTH_CLIENT_ID>", "GOOGLE_OAUTH_CLIENT_SECRET" = "<GOOGLE_OAUTH_CLIENT_SECRET>" }

For AI agents

  1. Ask the user for: GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: accounts_list, accounts_get, containers_list, containers_get, containers_create, containers_snippet, containers_lookup, containers_combine, ….
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json