MCP Server for Google Tag Manager

by stape-io

180 stars
451 downloads
Not rated
GitHub Website

About

Manage Google Tag Manager accounts, containers, and tags via its API, with built-in Google OAuth.

Details

Author
stape-io
GitHub stars
180
Downloads
451
Categories
Productivity, Marketing, Other

- 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:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Server for Google Tag Manager
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Configure your MCP client (e.g., Claude Desktop) with the command npx -y mcp-remote and the URL https://gtm-mcp.stape.ai/mcp. After restarting the client, a browser window will open for Google OAuth authentication; once granted, the server's tools become available.

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 a`GtmAuthProvider`(`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 the[core 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": ](https://github.com/stape-io/google-tag-manager-mcp-server/blob/HEAD/packages/core/README.md)[ "-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 the[CLI 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`) ](https://github.com/stape-io/google-tag-manager-mcp-server/blob/HEAD/packages/cli/README.md)[mcp-remotestores 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 the hosted server on your own machine against your own Google Cloud OAuth credentials instead of`gtm-mcp.stape.ai`. This is useful for testing changes before they're deployed. - In the](https://github.com/geelen/mcp-remote#readme)[Google Cloud Console, create or select a project, then enable the**Tag Manager API**. - Go to**APIs & Services > OAuth consent screen**and configure it (External is fine). While the app is in**Testing**publishing status, only accounts listed as test users can log in. - Go to**Audience**, under**Test users**add your own Google account. - Go to**APIs & Services > Credentials > Create Credentials > OAuth client ID**, type**Web application**. - Under**Authorized redirect URIs**, add`http://localhost:8788/callback`. (You can leave**Authorized JavaScript origins**empty — this flow is server-side only, no browser JS calls Google directly.) - Save, then copy the generated**Client ID**and**Client 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.vars`is git-ignored — it's only used locally and never committed. `npm run build`compiles the core package the Worker bundles against;`npm run dev`starts the Worker on`http://localhost:8788`. ### 4. Point your MCP client at the local server Same as the](https://console.cloud.google.com/)[Claude Desktop config above, but pointing at`localhost`instead of the hosted URL: ``` `{ "mcpServers": { "gtm-mcp-server-local": { "command": "npx", "args": ](#use-the-hosted-server)["-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 with[Changesets. Along with a change that should ship, add: On merge to`main`the 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 from`main`on 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/sdk`and`agents`are pinned to exact versions in`apps/worker`. The SDK identifies tool schemas with`instanceof`, so the whole workspace has to resolve a single copy, and`agents`releases 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.](https://github.com/changesets/changesets)
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.