analytics-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GOOGLE_OAUTH_CLIENT_ID | Yes | Google OAuth client ID for GA4 and Search Console APIs. | |
| GOOGLE_OAUTH_CLIENT_SECRET | Yes | Google OAuth client secret for GA4 and Search Console APIs. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_connectionsA | List every configured connection (Google account or Clarity project) available to this MCP server. Connections are set up once, outside of the LLM conversation, via the CLI ( Every other tool in this server takes a "connection" argument matching one of the names returned here. Args:
Returns: For JSON format: { "connections": [ { "name": string, "type": "google" | "clarity", "label": string, "createdAt": string } ] } Use when: "What analytics connections do I have set up?" or before calling any ga4_/gsc_/clarity_ tool if the connection name is unknown. |
| ga4_list_propertiesA | List every Google Analytics 4 property the connected Google account can access. Args:
Returns property IDs needed by ga4_run_report and ga4_run_realtime_report. Use when: "What GA4 properties do I have access to?" or to look up a property_id by site name before running a report. |
| ga4_run_reportA | Run a Google Analytics 4 report over a historical date range, similar to a custom report in the GA4 UI. Args:
Full dimension/metric reference: https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema Returns: For JSON: { "dimensionHeaders": string[], "metricHeaders": string[], "rows": object[], "rowCount": number } Use when: "How many sessions did we get last week by channel?" -> dimensions=["sessionDefaultChannelGroup"], metrics=["sessions"], start_date/end_date set accordingly. Don't use when: You need live/last-30-minutes data (use ga4_run_realtime_report instead). Error Handling:
|
| ga4_run_realtime_reportA | Run a Google Analytics 4 realtime report, covering roughly the last 30 minutes of activity. Args:
Note: only a subset of GA4 dimensions/metrics support realtime reporting — see https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema Use when: "How many people are on the site right now?" or "What pages are active users viewing at this moment?" Don't use when: You need historical trends (use ga4_run_report instead). |
| gsc_list_sitesA | List every Search Console property (site or domain) the connected Google account can access. Args:
Returns site URLs (e.g. "https://example.com/" or "sc-domain:example.com") needed by gsc_query_search_analytics and gsc_inspect_url. Use when: "What Search Console properties do I have access to?" |
| gsc_query_search_analyticsA | Query Google Search Console's Search Analytics data: clicks, impressions, CTR, and average position, broken down by dimensions. Args:
Returns: For JSON: { "rows": [{ "keys": string[], "clicks": number, "impressions": number, "ctr": number, "position": number }] } "keys" holds one value per requested dimension, in the same order as the "dimensions" argument. Use when: "What are our top search queries this month?" -> dimensions=["query"] Use when: "Which pages get the most impressions but low CTR?" -> dimensions=["page"], sort client-side on the returned rows. Don't use when: You need page indexing status (use gsc_inspect_url instead). |
| gsc_inspect_urlA | Check a single URL's Google index status via the Search Console URL Inspection API: whether it's indexed, when it was last crawled, and why it might not be indexed. Args:
Use when: "Why isn't this page showing up in Google?" or "Is this URL indexed?" Don't use when: You need aggregate query/click data (use gsc_query_search_analytics instead). |
| clarity_get_insightsA | Fetch Microsoft Clarity's traffic and engagement metrics (sessions, bots, engagement time, scroll depth, rage clicks, quick backs, dead clicks, script errors, and more) for a connected Clarity project, optionally broken down by up to 3 dimensions. Note: Clarity connections authenticate with a per-project API token generated in the Clarity dashboard (Settings > Data Export), not OAuth — Clarity's Data Export API does not support OAuth. Each token is capped at 10 requests/day; this tool caches results for 1 hour to help stay under that limit. Args:
Returns raw per-metric breakdowns as reported by Clarity, e.g. one entry per metric name ("Traffic", "EngagementTime", "ScrollDepth", "DeadClickCount", ...) each with an "information" array of rows for the requested dimension breakdown. Use when: "How is Clarity engagement trending by device over the last 3 days?" -> dimensions=["Device"] Don't use when: You need historical data beyond 3 days (Clarity's export API doesn't support that; use the Clarity dashboard/UI instead). Error Handling:
|
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 8 tools
Each tool targets a distinct service and action combination: connection listing, GA4 property listing, historical GA4 reports, GA4 realtime reports, GSC site listing, URL inspection, search analytics queries, and Clarity insights. The only near-overlap (ga4_run_report vs ga4_run_realtime_report) is clearly disambiguated by time range and explicit 'Don't use when' guidance.
Most tools follow a consistent service-prefix_verb_noun pattern (ga4_list_properties, ga4_run_report, gsc_query_search_analytics, clarity_get_insights). The bare list_connections is a minor deviation, and verbs vary across services (run vs query vs get), but the pattern is still predictable and readable.
Eight tools is well-scoped for an analytics MCP server covering three distinct platforms (GA4, GSC, Clarity). Each tool serves a concrete, necessary purpose without redundancy, and the count stays comfortably within the ideal range.
The server covers the core read/report lifecycle for each integration: property/site discovery, historical and realtime GA4 reports, GSC search analytics and URL inspection, and Clarity insights. Minor gaps exist (no GA4 dimension/metric metadata lookup, no GSC sitemap functionality), but agents can accomplish primary analytics workflows without dead ends.