How to set up the Model Context Protocol (MCP) server for Google Tag Manager
Updated Jul 16, 2025
The following guide demonstrates setting up an MCP server for GTM. You can alternatively configure the MCP server for Stape.
Requirements for setting up MCP server for GTM
For the MCP to connect and operate correctly, please make sure that:
- Your node.js version is up to date (v18 or higher).
- AI app or agent (in our case, it is the Claude app).
Guide to configuring MCP server for GTM
1. Open your AI app and add the config. In this example, we’ll use the Claude app.
Open the Claude desktop app → Settings → Developer tab → Edit Config → open desktop JSON file called claude_desktop_config → paste the code below.
Please make sure to replace your_path_to_file with the actual path that leads to your configuration files.
{
"mcpServers": {
"google-tag-manager-mcp-server": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://gtm-mcp.stape.ai/sse"
]
}
}
}
Once done, save the file → close and reopen the Claude app.
2. 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.


You're all set! You can now begin typing your requests for managing Google Tag Manager containers in your AI app.
Testing the GTM MCP server setup
To check that everything works as intended, simply enter a request in your AI app and see if it’s completed correctly within Google Tag Manager’s containers.
MCP remote 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:
rm -rf ~/.mcp-auth
It will clear any locally stored state and tokens. Then restart your MCP client.
Comments