jptb-google-tools
This server lets an AI agent manage Google Tag Manager and read Google Analytics 4 through the user's own Google account, via a JP Agent Tracking Bridge session.
GTM read: list accounts, containers, workspaces, tags, triggers, variables, and versions; resolve GTM-XXXX public IDs; fetch full container/version details.
GTM write: create and update tags, triggers, and variables; create container versions from workspaces (does not publish).
GTM publish: publish a prepared version to live, but only after explicit user approval (privileged action).
GA4 read-only: list GA4 accounts/properties, get property details, list data streams, and run standard or realtime reports; resolve G-XXXX measurement IDs to property/stream.
Session-based auth: connection ID and session token can be provided via environment variables or per tool call; Stop Tagging revokes access immediately.
Safety/verification guidance: realtime GA4 reports are minutes-slow, so empty results are not proof of dropped events; agents should follow the latency checklist.
Provides read-only access to Google Analytics 4, including listing accounts and properties, viewing property details, and running realtime and standard reports.
Enables managing Google Tag Manager containers, workspaces, tags, triggers, variables, and versions, including creating and updating entities, creating container versions, and publishing versions with approval gating.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@jptb-google-tools List the tags in my GTM container and show which fire on pageview."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
JP Agent Tracking Bridge MCP
The JP Agent Tracking Bridge MCP lets a compatible AI agent (Hermes, Claude, Codex) work with Google Analytics and Google Tag Manager through JP Agent Tracking Bridge — using your Google account, never a service account.
AI agent
└─ jptb-google-tools (this MCP server)
└─ HTTPS → JP Agent Tracking Bridge Google Tools gateway (jpro.studio)
├─ validates your active Bridge session
├─ uses YOUR Google OAuth connection (encrypted server-side)
└─ Google Analytics + Google Tag ManagerThe agent never sees your Google tokens, your client secret, or any encryption key.
Requirements
A licensed, installed JP Agent Tracking Bridge site (WordPress or Joomla).
A Google account with access to the site's GA4 property and GTM container.
A compatible agent (Hermes, Claude Desktop, or Codex).
No service account, no JSON credentials, no Google Cloud setup.
Related MCP server: Google Analytics MCP Server
The 5-step customer story
Install/register this MCP once (below).
Connect Google in the site's JP Agent Tracking Bridge admin.
Start Tagging to open a temporary agent connection.
Give the agent the connection (connection id + session token).
Talk to the agent normally — it inspects and configures tracking, and asks before publishing anything to GTM.
Start or install
This command downloads and starts the MCP server:
uvx --from 'git+https://github.com/joomlapro/jp-agent-tracking-bridge-mcp.git' jptb-google-toolsThe process intentionally stays open while the server waits for its MCP client. If you run it manually to verify the setup, press Ctrl+C after the startup banner appears. Your MCP client normally starts and stops this command for you.
For a standalone installation that returns to the prompt, use:
uv tool install 'git+https://github.com/joomlapro/jp-agent-tracking-bridge-mcp.git'Then register it in your agent. See docs/HERMES.md, docs/CLAUDE.md, or docs/CODEX.md
for the exact per-agent setup.
Configuration
The server needs two values for a given job (also passable per tool call):
export JPTB_CONNECTION_ID="<connection id from 'Connect Google'>"
export JPTB_SESSION_TOKEN="<session token from 'Start Tagging'>"Both are shown/generated in the site's JP Agent Tracking Bridge admin and via the Bridge
API. The session_token is revoked by Stop Tagging, which immediately blocks all Google
operations through the MCP.
What the agent can do
GTM read — list accounts/containers/workspaces/tags/triggers/variables/versions.
GTM write — create/update JPTB tags, triggers, variables; create a container version.
GTM publish — publish a prepared version (approval-gated; the agent asks first).
GA4 read-only — list accounts/properties, property details, realtime and standard reports.
Verification — GA4 realtime latency
GA4 realtime is minutes-slow, not seconds-slow. An empty realtime report is not proof an event was dropped. Before declaring an event "dropped":
Wait at least 5 minutes after the last browser event you expect to see.
Or calibrate with a unique direct
/g/collectcanary hit (this measures the current latency instead of guessing).
See docs/GA4-LATENCY.md for the full checklist and the
"never do this" rules (no Custom HTML gtag('event', same-name) recursion, no
dual GA4 loaders, no blaming consent before proving routing).
Security model
Session-bound — Google access is tied to an active Bridge session; Stop Tagging revokes it.
No secrets to the model — tokens, client secret, and the encryption key stay server-side.
No service account — the customer's own Google OAuth authorization is the only credential.
License
MIT.
Available Tools
24 toolsga4_get_propertyA
Get a GA4 property's details (by numeric property id, not measurement id).
Inputs: property_id (required), connection_id, session_token.
ga4_list_accountsA
List GA4 account/property summaries accessible to the connected Google user.
Inputs: connection_id, session_token.
ga4_list_data_streamsC
List data streams for a GA4 property.
Inputs: property_id (required), connection_id, session_token.
ga4_resolveA
Resolve a GA4 measurement id (e.g. G-XXXX) to numeric property_id + stream. Defaults to the customer's configured measurement id.
Inputs: connection_id, session_token, measurement_id.
ga4_run_realtime_reportA
Run a GA4 realtime report (read-only). report = {dimensions:[{name}], metrics:[{name}], ...}.
IMPORTANT: realtime has minutes-scale ingestion latency. An empty result is NOT proof an event was dropped. Wait at least 5 minutes after the last event and/or calibrate with a unique direct /g/collect canary hit before concluding. See docs/GA4-LATENCY.md.
Inputs: report (required), property_id (required), connection_id, session_token.
ga4_run_reportA
Run a GA4 standard report (read-only). report = {dateRanges:[{startDate,endDate}], dimensions, metrics, ...}.
Inputs: report (required), property_id (required), connection_id, session_token.
gtm_create_tagB
Create a GTM tag (full tag object). Use predictable JPTB naming; reuse/update an equivalent existing JPTB tag instead of duplicating.
Inputs: tag (required), account_id (required), container_id (required), workspace_id (required), +2 more.
gtm_create_triggerB
Create a GTM trigger (full trigger object).
Inputs: trigger (required), account_id (required), container_id (required), workspace_id (required), +2 more.
gtm_create_variableC
Create a GTM variable (full variable object).
Inputs: variable (required), account_id (required), container_id (required), workspace_id (required), +2 more.
gtm_create_versionA
Create a GTM container version from a workspace (does NOT publish).
Inputs: account_id (required), container_id (required), workspace_id (required), name, +2 more.
gtm_get_containerB
Get a single GTM container's details.
Inputs: account_id (required), container_id (required), connection_id, session_token.
gtm_get_versionB
Get a single GTM container version's full content.
Inputs: account_id (required), version_id (required), container_id (required), connection_id, +1 more.
gtm_list_accountsC
List GTM accounts accessible to the connected Google user.
Inputs: connection_id, session_token.
gtm_list_containersC
List containers in a GTM account.
Inputs: account_id (required), connection_id, session_token.
gtm_list_tagsA
List tags in a GTM workspace (inspect-first; do not touch unrelated tags).
Inputs: account_id (required), container_id (required), workspace_id (required), connection_id, +1 more.
gtm_list_triggersC
List triggers in a GTM workspace.
Inputs: account_id (required), container_id (required), workspace_id (required), connection_id, +1 more.
gtm_list_variablesC
List variables in a GTM workspace.
Inputs: account_id (required), container_id (required), workspace_id (required), connection_id, +1 more.
gtm_list_versionsA
List version headers (published + drafts) of a GTM container.
Inputs: account_id (required), container_id (required), connection_id, session_token.
gtm_list_workspacesB
List workspaces in a GTM container.
Inputs: account_id (required), container_id (required), connection_id, session_token.
gtm_publish_versionB
Publish a prepared GTM version to live. PRIVILEGED: only call after explicit user approval.
Inputs: account_id (required), version_id (required), container_id (required), connection_id, +1 more.
gtm_resolveA
Resolve a GTM container publicId (e.g. GTM-XXXX) to account_id/container_id/workspace_id. Defaults to the customer's configured container.
Inputs: public_id, connection_id, session_token.
gtm_update_tagC
Update an existing GTM tag by id.
Inputs: tag (required), tag_id (required), account_id (required), container_id (required), +3 more.
gtm_update_triggerB
Update an existing GTM trigger by id.
Inputs: trigger (required), account_id (required), trigger_id (required), container_id (required), +3 more.
gtm_update_variableC
Update an existing GTM variable by id.
Inputs: variable (required), account_id (required), variable_id (required), container_id (required), +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Each tool is scoped by a clear product prefix (gtm_/ga4_) and a specific resource/action, so tags, triggers, variables, versions, and GA4 reporting tools are all easily distinguishable. The two resolve tools are also cleanly separated by domain. There is no meaningful overlap between tools.
Tools overwhelmingly follow a product_verb_noun pattern in snake_case, such as gtm_list_tags, gtm_update_trigger, and ga4_run_report. The only minor deviation is gtm_resolve and ga4_resolve, which omit an explicit noun object, though they are still consistent with each other and easy to understand.
24 tools is above the typical 3-15 sweet spot and feels slightly heavy, but the count is justified by covering two distinct Google products with multiple subresources. Each tool has a specific purpose, so the set is not bloated or redundant.
The GTM toolset covers the core tag/trigger/variable workflow through create, update, version, and publish, and the GA4 toolset covers property lookup and reporting. Minor gaps exist, such as no delete operations for GTM resources and no individual get for tags/triggers/variables, but these can generally be worked around with list operations.
Maintenance
Related MCP Connectors
Read-only Google Search Console and Google Analytics for AI agents.
SEO & marketing toolkit for AI agents: GA4, Search Console, AdSense, GTM, PageSpeed, Trends.
Let AI agents use any website you're logged in to. Sessions stay encrypted on your machine.
OAuth 2.1 short-link tools for AI agents with scoped tokens, approvals, audit logs, and revocation.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to manage Google Tag Manager, Google Search Console, and Google Analytics (GA4) through unified access to tags, search performance data, URL inspection, sitemaps, and analytics reporting.7 npmISC
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Google Analytics 4 data, providing tools for historical reporting, real-time activity monitoring, and property management. It supports secure service account authentication to access metrics like traffic summaries, user acquisition, and custom dimensions.MIT
- AlicenseBqualityCmaintenanceProvides AI agents with hands-on control of Google SEO and analytics tools including Search Console, GA4, Tag Manager, Indexing API, and PageSpeed Insights, with self-configuring OAuth2.3314 npmMIT
- AlicenseAqualityBmaintenanceEnables AI agents to read and write Google Analytics 4, Search Console, and Tag Manager data through MCP tools, with write operations gated behind an explicit flag for safety.207 npmApache 2.0