MCP Server for Google Tag Manager
About
Manage Google Tag Manager accounts, containers, and tags via its API, with built-in Google OAuth.
Details
- License
- Apache-2.0
Explore
- Remote MCP connection support
- Built-in Google OAuth authentication
- Interfaces with the Google Tag Manager API
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MCP Server for Google Tag ManagerCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Copy the example file and fill in the values from the previous step:
cp apps/worker/.dev.vars.example apps/worker/.dev.vars
.dev.varsis git-ignored — it's only used locally and never committed.
npm run buildcompiles the core package the Worker bundles against;npm run devstarts the Worker onhttp://localhost:8788.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mcp server for google tag manager": {
"gtm-mcp-server": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://gtm-mcp.stape.ai/mcp"
]
}
}
}
}
McpServers
{
"gtm-mcp-server": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://gtm-mcp.stape.ai/mcp"
]
}
}
An interface to the Google Tag Manager API over MCP, in two flavours: a hosted server with Google OAuth built in, and a local CLI that runs on your own credentials.
npm workspace with one app and two published packages:
Tools reach Google through aGtmAuthProvider(getAccessToken(): Promise<string>) rather than through any particular session, which is what lets the same tool set back both servers — and a private one with your own auth. See thecore package README.
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.
{ "mcpServers": { "gtm-mcp-server": { "command": "npx", "args": [ "-y", "mcp-remote", "https://gtm-mcp.stape.ai/mcp" ] } } }
No OAuth flow and no data through anyone else's server — you supply a service account key or a refresh token:
{ "mcpServers": { "gtm-mcp-server": { "command": "npx", "args": ["-y", "google-tag-manager-mcp-server"], "env": { "GOOGLE_SERVICE_ACCOUNT_KEY": "{\"type\":\"service_account\", ... }" } } } }
See theCLI READMEfor the credential options.
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.
- Use shorter server names in your MCP configuration (e.g.,gtm-mcp-server)
You can run the hosted server on your own machine against your own Google Cloud OAuth credentials instead ofgtm-mcp.stape.ai. This is useful for testing changes before they're deployed.
- In theGoogle Cloud Console, create or select a project, then enable theTag Manager API.
- Go toAPIs & Services > OAuth consent screenand configure it (External is fine). While the app is inTestingpublishing status, only accounts listed as test users can log in.
- Go toAudience, underTest usersadd your own Google account.
- Go toAPIs & Services > Credentials > Create Credentials > OAuth client ID, typeWeb application.
- UnderAuthorized redirect URIs, addhttp://localhost:8788/callback. (You can leaveAuthorized JavaScript originsempty — this flow is server-side only, no browser JS calls Google directly.)
- Save, then copy the generatedClient IDandClient secret.
2. Configure local environment variables
Copy the example file and fill in the values from the previous step:
cp apps/worker/.dev.vars.example apps/worker/.dev.vars
.dev.varsis git-ignored — it's only used locally and never committed.
npm run buildcompiles the core package the Worker bundles against;npm run devstarts the Worker onhttp://localhost:8788.
4. Point your MCP client at the local server
Same as theClaude Desktop config above, but pointing atlocalhostinstead of the hosted URL:
{ "mcpServers": { "gtm-mcp-server-local": { "command": "npx", "args": ["-y", "mcp-remote", "http://localhost:8788/mcp"] } } }
Restart Claude Desktop. A browser window will open for the Google OAuth flow; log in with the account you added as a test user in step 1.
Note:if you've previously connected to the hosted server (or switch back and forth between local and hosted), clear mcp-remote's cache first (see "Clearing MCP Cache" above) and fully restart your MCP client, otherwise it may reuse a stale/cached connection.
Versions and changelogs are managed withChangesets. Along with a change that should ship, add:
On merge tomainthe release workflow opens a "Version Packages" PR; merging that PR publishes to npm, core first and then the CLI that depends on it. The Worker is private and never published — it deploys frommainon every push.
npm install npm run build # core, then the CLI, then the Worker's generated version npm run typecheck npm run lint npm run smoke # starts the built CLI and runs an MCP handshake against it
Pull requests run all of the above plus a Worker bundle check, and flag changes to a published package that arrive without a changeset.
Both@modelcontextprotocol/sdkandagentsare pinned to exact versions inapps/worker. The SDK identifies tool schemas withinstanceof, so the whole workspace has to resolve a single copy, andagentsreleases pin the SDK version they were built against. Bump them together and deploy deliberately.
A managed AI marketing agent that plugs into all your AI tools. Ask about your marketing in natural language — get synthesized insights from GA4, Google Ads, Search Console, WooCommerce, and more.
Read-only, multi-tenant access to Google Analytics 4, Google Ads, Search Console and Meta Ads: one connector per client plus a master connector spanning every client of an agency.
Create, preview, publish, and measure landing pages from Claude, Codex, or any MCP client.
SEO, GEO & AI Visibility — research, write, optimize, publish & monitor content. 95 tools, 9 agent skills, 11 prompts, 7 workflows. Built-in CMS hosting.
Access the Google Analytics Data API to retrieve and analyze website traffic data.
MCP server for Google Analytics 4 — reports, realtime, and admin (Rust)
A read-only MCP server for querying live Google Analytics data using LLMs. Powered by CData.
Connect Google Search Console to Claude or ChatGPT via Two Minute Reports MCP. Analyze top-performing queries, pages, and SEO trends to grow search visibility.
Integrates Google Tag Manager to automate GTM configuration and component creation through natural language prompts.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



