
Google Tag管理器的MCP服务器:读取标记/触发/可变,发布容器,并通过克洛德/格米尼进行审核更改.
概览
Google Tag 管理器 API v2 的 MCP 服务器 。 提供GTM账户,容器,工作空间,标签,触发器,变量以及版本管理的程序访问. - Node.js 18.0.0+ - 有 Tag 管理器 API 启用的 Google Cloud 工程 - OAuth 2.0 证书(Desktop 应用程序类型) 1. Google Cloud Console 2. 启用标签管理器API 创建 OAuth 2.0 证书(Desktop应用程序) 3. 下载证书 JSON 4. 保存为证书.json in gtm-mcp 目录 如果在全球安装, 请直接使用二进制 : 请参看MCP SETUP.md 特定平台指令. Token被保存到象征中 Json和自动更新。 99个可用操作(95个API操作+4个工作流程帮助). 完整参考见Operations.md.
概述(AI 翻译)
Google Tag 管理器 API v2 的 MCP 服务器 。 提供GTM账户,容器,工作空间,标签,触发器,变量以及版本管理的程序访问.
□ 要求
- 节点.js 18.0.0+
- 启用标签管理器 API 的谷歌云项目
- OAuth 2.0证书(Desktop应用程序类型)
□ 安装
从 npm 安装( 建议)
或者在本地安装 :
QQ 从源头安装
□ 谷歌云设置
- 在 Google Cloud Console 中启用标签管理器 API
- 创建 OAuth 2.0 证书( Desktop 应用程序)
- 下载JSON证书
- 在 [[T1] 目录中另作[[T0]
□ 配置
使用 npm 软件包
如果在全球安装, 请直接使用二进制 :
如果在当地安装,使用npx:
使用源安装
平台专用指令参见[[T3].
□ 认证
使用 npm 软件包
如果在全球安装:
或用 npx 表示:
使用源安装
Token 保存到 token.json并自动刷新.
□ 操作
99个可用操作(95个API操作+4个工作流程帮助). 完整参考见Operations.md。
• 类别
- 账户: 列表、 获取、 更新账户
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Google Tag Manager MCP Server
MCP server for Google Tag Manager API v2. Provides programmatic access to GTM accounts, containers, workspaces, tags, triggers, variables, and version management.
Requirements
- Node.js 18.0.0+
- Google Cloud Project with Tag Manager API enabled
- OAuth 2.0 credentials (Desktop application type)
Installation
Install from npm (Recommended)
npm install -g gtm-mcp
Or install locally:
npm install gtm-mcp
Install from source
git clone https://github.com/pouyanafisi/gtm-mcp.git
cd gtm-mcp
npm install
npm run build
Google Cloud Setup
- Enable Tag Manager API in Google Cloud Console
- Create OAuth 2.0 credentials (Desktop application)
- Download credentials JSON
- Save as
credentials.jsoningtm-mcpdirectory
Configuration
Using npm package
If installed globally, use the binary directly:
{
"mcpServers": {
"gtm": {
"command": "gtm-mcp",
"env": {
"GTM_CREDENTIALS_FILE": "/absolute/path/to/credentials.json",
"GTM_TOKEN_FILE": "/absolute/path/to/token.json"
}
}
}
}
If installed locally, use npx:
{
"mcpServers": {
"gtm": {
"command": "npx",
"args": ["gtm-mcp"],
"env": {
"GTM_CREDENTIALS_FILE": "/absolute/path/to/credentials.json",
"GTM_TOKEN_FILE": "/absolute/path/to/token.json"
}
}
}
}
Using source installation
{
"mcpServers": {
"gtm": {
"command": "node",
"args": ["/absolute/path/to/gtm-mcp/dist/index.js"],
"env": {
"GTM_CREDENTIALS_FILE": "/absolute/path/to/gtm-mcp/credentials.json",
"GTM_TOKEN_FILE": "/absolute/path/to/gtm-mcp/token.json"
}
}
}
}
See MCP_SETUP.md for platform-specific instructions.
Authentication
Using npm package
If installed globally:
gtm-mcp-auth
Or with npx:
npx gtm-mcp-auth
Using source installation
npm run auth
Token saved to token.json and auto-refreshed.
Operations
99 operations available (95 API operations + 4 workflow helpers). See OPERATIONS.md for complete reference.
Categories
- Accounts: List, get, update accounts
- Containers: List, get, create, update, delete, snippet, lookup, combine, move tag ID
安装
npx gtm-mcp配置
{
"mcpServers": {
"gtm": {
"command": "gtm-mcp",
"env": {
"GTM_CREDENTIALS_FILE": "/absolute/path/to/credentials.json",
"GTM_TOKEN_FILE": "/absolute/path/to/token.json"
}
}
}
}