# google-tag-manager-mcp-server — GTM MCP Remote Connector > Connect Google Tag Manager to MCP clients via an OAuth-backed remote server using mcp-remote + npx. Verified 152★; pushed 2026-05-14. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use ```json { "mcpServers": { "gtm-mcp-server": { "command": "npx", "args": [ "-y", "mcp-remote", "https://gtm-mcp.stape.ai/mcp" ] } } } ``` ## Intro Connect Google Tag Manager to MCP clients via an OAuth-backed remote server using mcp-remote + npx. Verified 152★; pushed 2026-05-14. **Best for:** Marketing/analytics teams who want MCP tooling to read and manage GTM via authenticated OAuth flows **Works with:** Claude Desktop or any MCP client that supports running `npx`; uses remote MCP endpoint + OAuth (per README) **Setup time:** 6-15 minutes ### Key facts (verified) - GitHub: 152 stars · 48 forks · pushed 2026-05-14. - License: Apache-2.0 · owner avatar + repo URL verified via GitHub API. - README-backed entrypoint: `npx -y mcp-remote https://gtm-mcp.stape.ai/mcp`. ## Main - Use a short server name (`gtm-mcp-server`) to avoid client tool-name length limits mentioned in README. - Treat OAuth tokens as secrets: if you share a workstation profile, clear local auth state as needed. - Start with read-only GTM operations to validate account/container selection before making changes. - Keep a changelog: when GTM changes are driven by agents, you want a human-readable trail alongside GTM version history. ### README (excerpt) **MCP Server for Google Tag Manager** [![Trust Score](https://archestra.ai/mcp-catalog/api/badge/quality/stape-io/google-tag-manager-mcp-server)](https://archestra.ai/mcp-catalog/stape-io__google-tag-manager-mcp-server) This is a server that supports remote MCP connections, with Google OAuth built-in and provides an interface to the Google Tag Manager API. ## Access the remote MCP server from Claude Desktop Open Claude Desktop and navigate to Settings -> Developer -> Edit Config. This opens the configuration file that controls which MCP servers Claude can access. Replace the content with the following configuration. Once you restart Claude Desktop, a browser window will open showing your OAuth login page. Complete the authentication flow to grant Claude access to your MCP server. After you grant access, the tools will become available for you to use. ```json { "mcpServers": { "gtm-mcp-server": { "command": "npx", "args": [ "-y", "mcp-remote", "https://gtm-mcp.stape.ai/mcp" ] } } } ``` ### Troubleshooting **MCP Server Name Length Limit** Some MCP clients (like Cursor AI) have a 60-character limit for the combined MCP server name + tool name length. If you use a longer server name in your configuration (e.g., `gtm-mcp-server-your-additional-long-name`), some tools may be filtered out. To avoid this issue: - Use shorter server names in your MCP configuration (e.g., `gtm-mcp-server`) **Clearing MCP Cache** [mcp-remote](https://github.com/geelen/mcp-remote#readme) stores all the credential information inside ~/.mcp-auth (or wherever your MCP_REMOTE_CONFIG_DIR points to). If you're having persistent issues, try running: You can run rm -rf ~/.mcp-auth to clear any locally stored state and tokens. ``` rm -rf ~/.mcp-auth ``` Then restarting your MCP client. ### Source-backed notes - README provides a Claude Desktop MCP config that runs `npx -y mcp-remote https://gtm-mcp.stape.ai/mcp`. - README states OAuth is built-in and an OAuth browser flow runs when the MCP client starts the connector. - README notes some clients have a combined server+tool name length limit and recommends shorter names. ### FAQ - **Do I need to install anything locally?**: README uses `npx` with `mcp-remote`, so Node.js + npx is the main requirement. - **Why does a browser window open?**: README explains OAuth login is part of the connection flow. - **Tools are missing in my client—why?**: README mentions name length limits; use a shorter server name in config. ## Source & Thanks > Created by [stape-io](https://github.com/stape-io). Licensed under Apache-2.0. > > [stape-io/google-tag-manager-mcp-server](https://github.com/stape-io/google-tag-manager-mcp-server) — ⭐ 152 Thanks to the upstream maintainers and contributors for publishing this work under an open license. --- ## Quick Use ```json { "mcpServers": { "gtm-mcp-server": { "command": "npx", "args": [ "-y", "mcp-remote", "https://gtm-mcp.stape.ai/mcp" ] } } } ``` ## Intro 通过 OAuth 远程 MCP Server 把 Google Tag Manager 接入 Claude Desktop/Cursor 等客户端(mcp-remote + npx);已验证 152★,更新于 2026-05-14。 **Best for:** 希望通过 OAuth 安全接入 GTM,并在 MCP 客户端里操作/管理的增长与分析团队 **Works with:** Claude Desktop 或可运行 `npx` 的 MCP 客户端;通过远程端点 + OAuth 授权(见 README) **Setup time:** 6-15 minutes ### Key facts (verified) - GitHub:152 stars · 48 forks;最近更新 2026-05-14。 - 许可证:Apache-2.0;作者头像与仓库链接均已通过 GitHub API 复核。 - README 中可对照的入口:`npx -y mcp-remote https://gtm-mcp.stape.ai/mcp`。 ## Main - 按 README 建议使用更短的 server 名(如 `gtm-mcp-server`),避免部分客户端的名称长度限制导致工具被过滤。 - OAuth 凭据按机密处理:多人共享环境时按需清理本地 auth 状态。 - 先跑只读操作确认账号/容器选择无误,再逐步开放会产生变更的操作。 - 建议维护变更日志:agent 驱动的 GTM 变更应有可读的人工审计轨迹。 ### README (excerpt) **MCP Server for Google Tag Manager** [![Trust Score](https://archestra.ai/mcp-catalog/api/badge/quality/stape-io/google-tag-manager-mcp-server)](https://archestra.ai/mcp-catalog/stape-io__google-tag-manager-mcp-server) This is a server that supports remote MCP connections, with Google OAuth built-in and provides an interface to the Google Tag Manager API. ## Access the remote MCP server from Claude Desktop Open Claude Desktop and navigate to Settings -> Developer -> Edit Config. This opens the configuration file that controls which MCP servers Claude can access. Replace the content with the following configuration. Once you restart Claude Desktop, a browser window will open showing your OAuth login page. Complete the authentication flow to grant Claude access to your MCP server. After you grant access, the tools will become available for you to use. ```json { "mcpServers": { "gtm-mcp-server": { "command": "npx", "args": [ "-y", "mcp-remote", "https://gtm-mcp.stape.ai/mcp" ] } } } ``` ### Troubleshooting **MCP Server Name Length Limit** Some MCP clients (like Cursor AI) have a 60-character limit for the combined MCP server name + tool name length. If you use a longer server name in your configuration (e.g., `gtm-mcp-server-your-additional-long-name`), some tools may be filtered out. To avoid this issue: - Use shorter server names in your MCP configuration (e.g., `gtm-mcp-server`) **Clearing MCP Cache** [mcp-remote](https://github.com/geelen/mcp-remote#readme) stores all the credential information inside ~/.mcp-auth (or wherever your MCP_REMOTE_CONFIG_DIR points to). If you're having persistent issues, try running: You can run rm -rf ~/.mcp-auth to clear any locally stored state and tokens. ``` rm -rf ~/.mcp-auth ``` Then restarting your MCP client. ### Source-backed notes - README 提供 Claude Desktop 的 MCP 配置,使用 `npx -y mcp-remote https://gtm-mcp.stape.ai/mcp` 连接。 - README 说明该远程 MCP Server 内置 OAuth,启动后会走浏览器授权流程。 - README 提醒部分客户端存在 server+tool 名称长度限制,并建议使用更短的 server 名。 ### FAQ - **需要本地安装什么吗?**:README 使用 `npx` + `mcp-remote`,主要需要 Node.js/npx。 - **为什么会弹出浏览器?**:README 说明连接流程包含 OAuth 登录授权。 - **为什么工具显示不全?**:README 提到名称长度限制;把 server 名改短通常能解决。 ## Source & Thanks > Created by [stape-io](https://github.com/stape-io). Licensed under Apache-2.0. > > [stape-io/google-tag-manager-mcp-server](https://github.com/stape-io/google-tag-manager-mcp-server) — ⭐ 152 --- Source: https://tokrepo.com/en/workflows/google-tag-manager-mcp-server-gtm-mcp-remote-connector Author: MCP Hub