Query Analytics
Click on "Install 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., "@Query Analyticssessions and bounce rate by country for last month"
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.
Stop wrestling with analytics API syntax.
Query Analytics is an MCP server that turns plain parameters into valid GA4 API requests, resolves human-readable date ranges, formats raw metric values, parses filter expressions, and aggregates response rows. No more digging through the GA4 reference docs mid-session.
Quick Start
Add this to your Claude Desktop or MCP client config:
{
"mcpServers": {
"query-analytics": {
"url": "https://query-analytics-YOUR_HASH-uc.a.run.app/mcp"
}
}
}Replace YOUR_HASH with the Cloud Run service URL from your deployment.
Related MCP server: Google Analytics MCP Server
Before / After
Before: Hand-building a GA4 request body at 2am.
// What you used to write by hand:
{
"dimensions": [{"name": "date"}, {"name": "country"}],
"metrics": [{"name": "sessions"}, {"name": "bounceRate"}],
"dateRanges": [{"startDate": "2026-03-06", "endDate": "2026-04-02"}],
"limit": 1000,
"orderBys": [{"metric": {"metricName": "sessions"}, "desc": true}]
}After: One tool call.
build_ga4_query(
metrics: ["sessions", "bounceRate"],
dimensions: ["date", "country"],
date_range: "last_28_days",
order_by_metric: "sessions"
)Output:
{
"query": {
"dimensions": [{"name": "date"}, {"name": "country"}],
"metrics": [{"name": "sessions"}, {"name": "bounceRate"}],
"dateRanges": [{"startDate": "2026-03-06", "endDate": "2026-04-02"}],
"limit": 1000,
"orderBys": [{"metric": {"metricName": "sessions"}, "desc": true}]
},
"resolvedDateRange": {
"startDate": "2026-03-06",
"endDate": "2026-04-02",
"daysCount": 28
}
}Tools
Tool | What it does |
| Build a valid GA4 Data API runReport request body from plain parameters |
| Convert named periods (last_28_days, this_month, etc.) to start/end date strings |
| Format raw numbers into human-readable strings (62.34%, 2m 14s, $1,234.00) |
| Convert plain-text filter strings into GA4 filterExpression JSON |
| Roll up GA4 response rows by a dimension with metric summation and top-N |
Who is this for?
Analytics engineers who are tired of re-reading the GA4 API docs to remember the exact filterExpression schema.
Product developers building dashboards who need clean, formatted metric values without writing formatting helpers from scratch.
AI agents and automations that need to construct valid GA4 queries programmatically without hallucinating API structure.
Health Check
Both endpoints return the same JSON:
GET /
GET /health{
"status": "ok",
"server": "query-analytics",
"version": "1.0.0",
"tools": 5
}Use /health for Cloud Run liveness probes.
MCP Endpoint
POST /mcpHandles all MCP protocol requests (tools/list, tools/call) via StreamableHTTP transport.
Built by Mastermind HQ
MIT License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceEnables interaction with Google Analytics 4 data through the Google Analytics Data API. Built using Google ADK UI and deployed on Google Cloud Platform with proper service account authentication for GA4 data access.Last updated
- Alicense-qualityDmaintenanceEnables interaction with Google Analytics APIs to fetch reports, manage properties, data streams, conversion events, and custom dimensions/metrics through OAuth2 authentication.Last updated1776MIT
- FlicenseAqualityDmaintenanceEnables interaction with Google Analytics 4 to manage accounts, run standard or realtime reports, and validate event parameters. It supports dual authentication methods and integrates with GTM for end-to-end data collection orchestration.Last updated8
- Alicense-qualityFmaintenanceEnables LLMs to interact with Google Analytics 4 data through the Google Analytics Data API, supporting standard reports, real-time data, and metadata retrieval.Last updated19MIT
Related MCP Connectors
Read-only Yandex Metrika MCP. Query visits, sources, geo, devices and more in plain language.
100+ read/write tools: GA4, Search Console, Google/Meta Ads, Shopify, WooCommerce, Shopware. BYOK.
Ask your app anything — revenue, errors, read-cost, growth — and get rendered charts back.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/josephtandle/google-analytics-mcp-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server