ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

Samarth Gtm MCP

โดย samarthanalytics-sjรุ่น 1.19.0i★ –iรันบนเครื่อง
ชื่อใน registryio.github.samarthanalytics-sj/samarth-gtm-mcp

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

Google Tag Manager + read-only GA4 MCP server. Read-only by default, gated writes, audits.

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: อื่น ๆ
  • ต้องใส่ค่าเหล่านี้: GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

  • ผลตรวจเบื้องต้น: ผ่าน 1 จาก 1 ข้อ
  • รันในเครื่องคุณด้วยสิทธิ์ของผู้ใช้คุณ (ไฟล์ อินเทอร์เน็ต แอปต่าง ๆ)
  • ค่าที่คุณต้องใส่เอง: GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET, GTM_MCP_ENABLE_WRITES, GTM_MCP_ENABLE_PUBLISH, GTM_MCP_ENABLE_DELETES

ค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต

ต้องเตรียมก่อน

  • npmติดตั้ง Node.js (มีคำสั่ง npx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "samarth-gtm": {
      "command": "npx",
      "args": [
        "-y",
        "samarth-gtm-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_ID": "ใส่ค่าของคุณ",
        "GOOGLE_OAUTH_CLIENT_SECRET": "ใส่ค่าของคุณ",
        "GTM_MCP_ENABLE_WRITES": "ใส่ค่าของคุณ",
        "GTM_MCP_ENABLE_PUBLISH": "ใส่ค่าของคุณ",
        "GTM_MCP_ENABLE_DELETES": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add samarth-gtm --env GOOGLE_OAUTH_CLIENT_ID='ใส่ค่าของคุณ' --env GOOGLE_OAUTH_CLIENT_SECRET='ใส่ค่าของคุณ' --env GTM_MCP_ENABLE_WRITES='ใส่ค่าของคุณ' --env GTM_MCP_ENABLE_PUBLISH='ใส่ค่าของคุณ' --env GTM_MCP_ENABLE_DELETES='ใส่ค่าของคุณ' -- npx -y samarth-gtm-mcp

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "samarth-gtm": {
      "command": "npx",
      "args": [
        "-y",
        "samarth-gtm-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_ID": "ใส่ค่าของคุณ",
        "GOOGLE_OAUTH_CLIENT_SECRET": "ใส่ค่าของคุณ",
        "GTM_MCP_ENABLE_WRITES": "ใส่ค่าของคุณ",
        "GTM_MCP_ENABLE_PUBLISH": "ใส่ค่าของคุณ",
        "GTM_MCP_ENABLE_DELETES": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "samarth-gtm": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "samarth-gtm-mcp"
      ],
      "env": {
        "GOOGLE_OAUTH_CLIENT_ID": "ใส่ค่าของคุณ",
        "GOOGLE_OAUTH_CLIENT_SECRET": "ใส่ค่าของคุณ",
        "GTM_MCP_ENABLE_WRITES": "ใส่ค่าของคุณ",
        "GTM_MCP_ENABLE_PUBLISH": "ใส่ค่าของคุณ",
        "GTM_MCP_ENABLE_DELETES": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • GOOGLE_OAUTH_CLIENT_ID จำเป็น env
    Your Google OAuth 2.0 client ID (Desktop app type)
  • GOOGLE_OAUTH_CLIENT_SECRET ความลับ จำเป็น env
    Your Google OAuth 2.0 client secret
  • GTM_MCP_ENABLE_WRITES env
    Set to 'true' to allow create/update operations (default: read-only)
  • GTM_MCP_ENABLE_PUBLISH env
    Set to 'true' to allow publish operations (default: disabled)
  • GTM_MCP_ENABLE_DELETES env
    Set to 'true' to allow delete operations (default: disabled)

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 8 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub samarthanalytics-sj ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด อื่น ๆi

  • ดาวมากกว่า 0% ของอีก 18490 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 10% ของอีก 18490 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 18490 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

Samarth Gtm MCP ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

ต้องใส่ค่าเหล่านี้: GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (1.19.0) เข้า registry 5 เดือนที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Spec Driven Development, Remote Desktop Commander, Talexio MCP by usefulapi

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:↓ ดาวน์โหลดต่อสัปดาห์i★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Spec Driven Development

MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.

โดย formulahendryเริ่มต้น↓ 66/สัปดาห์★ 440อัปเดต 14 เดือนที่ผ่านมา

รันบนเครื่อง

Remote Desktop Commander

Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.

โดย desktop-commanderกำลังโต★ 211อัปเดต 3 วันที่ผ่านมา

รันบนคลาวด์✓ desktopcommander.app

Talexio MCP by usefulapi

Read employees, approved pay lines, approved time off and shift templates in Talexio.

โดย m190เริ่มต้นอัปเดต วันนี้

รันบนคลาวด์✓ usefulapi.io

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

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

What you getWhere to start

| Hosted, no install | Our community instance at https://mcp.samarthanalytics.com/mcp. Sign in with your own Google account; it only sees your containers and properties, and it is locked to read-only. Shared, best-effort, no uptime promise. | Add it to your MCP client with mcp-remote: {"mcpServers":{"samarth-gtm":{"command":"npx","args":["mcp-remote@next","https://mcp.samarthanalytics.com/mcp"]}}} | | Local | The server on your machine over stdio, with your own Google OAuth client, and the write flags under your control. | Quick Start and Google Cloud OAuth Setup | | Self-hosted | The MCP server, the web-audit server and the capture worker as one docker-compose stack behind your own token. | docs/SELF_HOSTING_DOCKER.md and Cloud Deployment |

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

  1. Features
  2. Quick Start
  3. Google Cloud OAuth Setup
  4. Service Account Limitations
  5. Environment Variables Reference
  6. Guardrails
  7. Available Tools
  8. Cloud Deployment
  9. Security Notes
  10. Development
  11. Releases
  12. Troubleshooting

Features

  • Full GTM API v2 surface — accounts, containers, workspaces, tags, triggers, variables, folders, built-in variables, versions, sync, publish, preview
  • Server-side & advanced GTM coverage — environments, user permissions, destinations, clients, transformations, zones, custom templates, gtag config, plus container snippet/lookup/combine/move-tag-id and workspace change-diff status
  • GA4 coverage — GA4 Admin tools (ga4_*) plus GA4 Data API reporting (ga4_run_report, ga4_run_realtime_report) for intent-vs-reality reconciliation. Reads and reporting need only analytics.readonly; the GA4 Admin write tools are off by default behind GA4_MCP_ENABLE_WRITES / GA4_MCP_ENABLE_DELETES and additionally need analytics.edit
  • Automatic pagination — every paginated list tool transparently follows nextPageToken to return all results, with optional maxPages/pageToken bounds
  • Retry with exponential backoff + jitter — transient Google API failures (HTTP 408/429/5xx, network errors) on read requests are retried automatically; mutations are never auto-retried (tunable via GTM_MCP_RETRY_*)
  • Two transport modes: stdio (local, for Claude Desktop/Cursor) and Streamable HTTP (cloud/team)
  • Guardrails by default: read-only unless explicitly enabled; publish and delete gated separately
  • Dry-run mode: simulate all writes without touching the API
  • `confirm=true` required on all write/delete/publish operations
  • Audit tool: inspects workspace for common GA4/GTM implementation issues
  • Export tool: full workspace dump as structured JSON
  • Zod schema validation on all inputs
  • Detailed Google API error messages surfaced to the MCP client

Quick Start

The way to run Samarth is the desktop app - a local Electron app with a chat UI that embeds the MCP server in-process. Multi-account Google sign-in, per-account LLM keys (OpenAI / Anthropic / Gemini), secrets in the OS keychain. Nothing to configure by hand: the Google OAuth client and your LLM key are entered in the app on first run.

You need: Node.js 18 or newer, Git, and a free Google "Desktop app" OAuth client - two values you create once in your Google Cloud project (exact click-by-click steps).

git clone https://github.com/samarthanalytics-sj/samarth-analytics-mcp.git

cd samarth-analytics-mcp/apps/desktop npm install # downloads the Electron binary (~100 MB first time) npm run dev

The window opens; paste your OAuth client ID + secret and an LLM API key when asked, sign in to Google, and start chatting with your GTM / GA4 setup.

Prefer a config file over typing in the app? Put the OAuth client in a .env file instead - the app reads it on launch (values typed in the app and real shell variables always take precedence):

GOOGLE_DESKTOP_CLIENT_ID=your-client-id.apps.googleusercontent.com

GOOGLE_DESKTOP_CLIENT_SECRET=your-client-secret

Save it as apps/desktop/.env or at the repo root (already gitignored - never commit it). A repo-root .env using the server's GOOGLE_OAUTH_CLIENT_ID / GOOGLE_OAUTH_CLIENT_SECRET names works too, so one file can serve both the app and the MCP server. A packaged install reads .env from its data directory instead (%APPDATA% on Windows).

Your everyday launch afterwards is just:

cd samarth-analytics-mcp/apps/desktop && npm run dev

Full guide - Windows/macOS specifics, first-run setup, building a real .exe/.dmg installer, and the Error: Electron uninstall fix: apps/desktop/INSTALL.md.


Google Cloud OAuth Setup

Step 1: Enable the GTM API
  1. Go to Google Cloud Console
  2. Select or create a project
  3. Navigate to APIs & Services → Library
  4. Search for "Tag Manager API" and click Enable
  5. Search for "Google Analytics Admin API" and click Enable (required for the read-only ga4_* Admin tools)
  6. Search for "Google Analytics Data API" and click Enable (required for ga4_run_report / ga4_run_realtime_report)
Step 2: Create OAuth 2.0 Credentials
  1. Go to APIs & Services → Credentials
  2. Click Create Credentials → OAuth 2.0 Client ID
  3. Choose application type:
  • Desktop app — simplest for local stdio use (no redirect URI needed)
  • Web application — for the HTTP server (add your redirect URI)
  1. Download the JSON or copy the Client ID and Client Secret
  2. Add to .env:
   GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com

GOOGLE_CLIENT_SECRET=your-client-secret GOOGLE_REDIRECT_URI=http://localhost:3001/oauth/callback

Step 3: Configure OAuth Consent Screen
  1. Go to APIs & Services → OAuth consent screen
  2. Choose External (or Internal if you have Google Workspace)
  3. Fill in App name, support email
  4. Add scopes:
  • https://www.googleapis.com/auth/tagmanager.readonly
  • https://www.googleapis.com/auth/tagmanager.edit.containers
  • https://www.googleapis.com/auth/tagmanager.edit.containerversions
  • https://www.googleapis.com/auth/tagmanager.manage.accounts
  • https://www.googleapis.com/auth/tagmanager.manage.users
  • https://www.googleapis.com/auth/tagmanager.publish
  • https://www.googleapis.com/auth/analytics.readonly (read-only GA4 Admin and Data API tools)
  • https://www.googleapis.com/auth/analytics.edit (GA4 Admin write tools — gated by GA4_MCP_ENABLE_WRITES)
  • https://www.googleapis.com/auth/analytics.manage.users (GA4 access-binding write tools)
  1. Add your Google account as a test user (while the app is in "testing" mode)

Note: For personal/agency use, keeping the app in "Testing" mode is fine. You will need to re-authorize every 7 days unless you publish the app or get it verified.

Step 4: Run OAuth Setup
npm run auth:google

Or, if you prefer the older paste-the-code helper:

npm run oauth:setup

Service Account Limitations

Short version: Service accounts do NOT work with GTM by default. Use OAuth 2.0.

The Google Tag Manager API is a user-data API — it manages resources owned by individual Google accounts. Service accounts are not Google users and are not automatically granted access to GTM containers.

Option A: Add the service account as a GTM user (simplest)

If you still want to use a service account:

  1. Get the service account email (e.g., my-sa@project.iam.gserviceaccount.com)
  2. In GTM, go to Admin → User Management at the account or container level
  3. Add the service account email with the appropriate role (Read, Edit, Approve, Publish)
  4. Set GOOGLE_SERVICE_ACCOUNT_KEY_FILE=/path/to/key.json in .env

Caveats: This only works if the GTM container is associated with a Google account, not a Google Workspace that restricts external sharing.

Option B: Domain-Wide Delegation (Google Workspace only)

For Google Workspace organizations:

  1. Create a service account with a JSON key
  2. Enable Domain-Wide Delegation on the service account in Google Cloud Console
  3. In Google Workspace Admin Console → Security → API Controls → Domain-wide Delegation:
  • Add the service account client ID
  • Add scopes: https://www.googleapis.com/auth/tagmanager.edit.containers (and others as needed)
  1. In .env, set:
   GOOGLE_SERVICE_ACCOUNT_KEY_FILE=/path/to/key.json
  1. The server will impersonate the user automatically if you set a subject in buildGoogleAuth()

Caveats: Requires a paid Google Workspace account. Only available for your own domain.


Environment Variables Reference

VariableDefaultDescription
GOOGLE_OAUTH_CLIENT_ID—OAuth client ID (preferred). Falls back to GOOGLE_CLIENT_ID.
GOOGLE_OAUTH_CLIENT_SECRET—OAuth client secret (preferred). Falls back to GOOGLE_CLIENT_SECRET.
GOOGLE_OAUTH_REDIRECT_URIhttp://localhost:3001/oauth/callbackOAuth redirect URI. Falls back to GOOGLE_REDIRECT_URI.
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET / GOOGLE_REDIRECT_URI—Legacy names, still supported.

| SAMARTH_GOOGLE_OAUTH_CLIENT_ID | — | Hosted-only. Samarth-owned public OAuth client. Takes precedence over the self-hosted va

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx