npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp-gtm

v0.8.1

Published

MCP server for Google Tag Manager container JSON files. Zero auth, fully offline.

Downloads

746

Readme

mcp-gtm

CI License: MIT npm version

An MCP (Model Context Protocol) server that lets LLMs interact with Google Tag Manager through exported JSON container files. Zero auth setup, fully offline.

Quick Start

npm install
npm run dev

Or configure in your MCP client:

{
  "mcpServers": {
    "gtm": {
      "command": "npx",
      "args": ["tsx", "/path/to/mcp-gtm/src/index.ts"],
      "env": {
        "GTM_CONTAINER_FILE": "/path/to/your-container.json"
      }
    }
  }
}

Tools (47 total)

Container

| Tool | Description | |------|-------------| | gtm_load_container | Load a GTM container JSON file | | gtm_get_container_info | Get container metadata | | gtm_get_container_state | Get summary counts |

Tags

| Tool | Description | |------|-------------| | gtm_list_tags | List tags with trigger assignments and consent settings | | gtm_get_tag | Get tag by ID or name | | gtm_create_tag | Create a new tag | | gtm_update_tag | Update metadata, firing/blocking triggers, and additional consent checks | | gtm_delete_tag | Delete a tag | | gtm_find_tags_by_type | Find tags by type (e.g. gaawe) |

Triggers

| Tool | Description | |------|-------------| | gtm_list_triggers | List all triggers | | gtm_get_trigger | Get trigger by ID or name | | gtm_create_trigger | Create a new trigger | | gtm_update_trigger | Update a trigger | | gtm_delete_trigger | Delete a trigger |

Variables

| Tool | Description | |------|-------------| | gtm_list_variables | List user-defined variables | | gtm_get_variable | Get variable details | | gtm_create_variable | Create a variable | | gtm_update_variable | Update a variable | | gtm_delete_variable | Delete a variable | | gtm_list_builtin_variables | List built-in variables |

Folders

| Tool | Description | |------|-------------| | gtm_list_folders | List folders | | gtm_get_folder | Get folder details | | gtm_create_folder | Create a new folder | | gtm_delete_folder | Delete a folder | | gtm_move_tag_to_folder | Move a tag to/from a folder | | gtm_move_trigger_to_folder | Move a trigger to/from a folder | | gtm_move_variable_to_folder | Move a variable to/from a folder |

Analysis

| Tool | Description | |------|-------------| | gtm_get_tag_dependencies | Show tag trigger dependencies | | gtm_find_unused_entities | Find unused tags/triggers/variables | | gtm_find_orphaned_triggers | Find triggers not used by any tag | | gtm_validate_container | Run full Zod validation |

Lifecycle

| Tool | Description | |------|-------------| | gtm_analyze_tag_firing_order | Deterministic firing order, sequencing deps, conflicts | | gtm_analyze_consent_setup | Consent analysis aware of Google built-in checks, explicit checks, and GTM built-in triggers | | gtm_get_tag_lifecycle | Per-tag lifecycle phase, consent relationships, issues |

Server-Side GTM

| Tool | Description | |------|-------------| | gtm_list_zones | List all zones | | gtm_get_zone | Get zone details | | gtm_list_clients | List all clients | | gtm_get_client | Get client details | | gtm_list_transformations | List all transformations | | gtm_get_transformation | Get transformation details | | gtm_list_custom_templates | List all custom templates | | gtm_get_custom_template | Get custom template details |

Export

| Tool | Description | |------|-------------| | gtm_export_container | Export container state while preserving version or workspace JSON format | | gtm_diff_containers | Compare version or workspace container files |

Search

| Tool | Description | |------|-------------| | gtm_search | Full-text search across entity names and notes |

Undo/Redo

| Tool | Description | |------|-------------| | gtm_undo | Undo the last mutation | | gtm_redo | Redo the last undone mutation |

Resources (4 total)

Read-only MCP resources for container state snapshots:

| Resource | URI | Description | |----------|-----|-------------| | container_state | gtm://container/state | Entity counts and metadata | | container_tags | gtm://container/tags | Full tag listing | | container_triggers | gtm://container/triggers | Full trigger listing | | container_variables | gtm://container/variables | Full variable listing |

Prompts (5 total)

Pre-built prompt templates for common workflows:

| Prompt | Description | |--------|-------------| | inspect_container | List all entities with resolved names | | audit_container | Find unused/orphaned/disabled entities | | debug_tag | Debug why a specific tag isn't firing | | compare_containers | Compare two container files | | audit_consent | Audit consent setup, firing order, and tag lifecycle |

Why JSON Files?

  • Zero auth (no GCP project, no service account)
  • Fully offline and testable
  • Diffable and version-controllable
  • Import back into GTM with one click

Configuration

| Environment Variable | Description | |---|---| | GTM_CONTAINER_FILE | Path to a GTM export JSON file. Auto-loaded on startup. | | GTM_READ_ONLY | Set to any value to disable all write tools (create, update, delete, move, export). Only read and analysis tools will be available. |

Development

npm test        # Run tests
npm run dev     # Run server
npm run build   # TypeScript check
npm run lint    # Biome lint
npm run format  # Biome format

License

MIT