Aerostack
electrical_services

Google Analytics MCP Server — Hosted Monitoring Integration

MCP Server language Hosted language Public

Run reports, query real-time data, list dimensions and metrics from Google Analytics 4 — AI-native web analytics access.

aerostack @aerostack verified
v0.1.0 MIT Updated Jun 28, 2026
robot_2

Use with AI AssistantsMCP

Connect Claude, Cursor, or any MCP-compatible client — then call tools directly

① Add This MCP Server

Paste into your AI client config — then all its tools are available instantly.

.claude/mcp.json
{
  "mcpServers": {
    "google-analytics": {
      "url": "https://mcp.aerostack.dev/s/aerostack/mcp-google-analytics",
      "headers": {
        "Authorization": "Bearer YOUR_AEROSTACK_TOKEN"
      }
    }
  }
}

Replace YOUR_AEROSTACK_TOKEN with your API token from the dashboard.

② Call a Tool

Ask your AI assistant to call a specific tool, or send raw JSON-RPC:

+7 more

Natural Language Prompt

“Use the _ping tool to verify google tasks credentials by calling a lightweight read endpoint. used internally by aerostack to validate credentials

Using a Workspace?

Add this MCP to your Workspace — your team shares one token, secrets are stored securely, and every AI agent in the workspace can call it without per-user setup.

add_circleAdd to Workspace

description Overview

mcp-google-analytics — Google Analytics 4 MCP Server

Run reports, query real-time data, list dimensions and metrics from Google Analytics 4 — AI-native web analytics access.

Give your AI agents full access to Google Analytics 4. Run standard reports with dimensions, metrics, date ranges, and filters. Query real-time active users, discover available dimensions/metrics, analyze funnels, and create pivot tables — all through natural language.

Live endpoint: https://mcp.aerostack.dev/s/aerostack/mcp-google-analytics


What You Can Do

  • Run standard GA4 reports with any combination of dimensions and metrics
  • Query real-time data — active users, pages, countries right now
  • Discover all available dimensions and metrics for your property (including custom ones)
  • Analyze user funnels with drop-off rates across conversion steps
  • Create pivot reports for cross-tabulated analytics breakdowns
  • Filter, sort, and paginate report results

Available Tools

Tool Description
_ping Verify GA4 connectivity by fetching property metadata
run_report Run a standard report with dimensions, metrics, date ranges, filters, and ordering
get_realtime_report Get real-time data — active users, pages, countries from the last 30 minutes
get_metadata List all available dimensions and metrics for the property (with optional text filter)
run_funnel_report Analyze user drop-off across a sequence of funnel steps
run_pivot_report Create a cross-tabulation pivot table of dimensions and metrics

Configuration

Variable Required Description How to Get
GOOGLE_SERVICE_ACCOUNT_JSON Yes Full JSON key file content for a GCP service account with Analytics access console.cloud.google.com → IAM & Admin → Service Accounts → Create → Keys → Add Key → JSON
GA4_PROPERTY_ID Yes GA4 property ID (numeric, e.g. "123456789") analytics.google.com → Admin → Property Settings → Property ID

Required roles: Add the service account email as a Viewer on the GA4 property: analytics.google.com → Admin → Property Access Management → Add User.

Quick Start

Add to Aerostack Workspace
  1. Go to aerostack.dev → Your Project → MCPs
  2. Search for "Google Analytics" and click Add to Workspace
  3. Add GOOGLE_SERVICE_ACCOUNT_JSON (paste the full JSON) and GA4_PROPERTY_ID under Project → Secrets
Example Prompts
"How many active users did my site get in the last 7 days?"
"Show me the top 10 pages by pageviews this month"
"What countries are my users coming from? Break down by device category"
"How many users are on my site right now? Show by page"
"What dimensions and metrics are available for my property?"
"Show me a funnel from page_view → add_to_cart → purchase for the last 30 days"
"Create a pivot report of sessions by country and device category"
"Compare organic vs paid traffic sources for the last 14 days"
Direct API Call
curl -X POST https://mcp.aerostack.dev/s/aerostack/mcp-google-analytics \
  -H 'Content-Type: application/json' \
  -H 'X-Mcp-Secret-GOOGLE-SERVICE-ACCOUNT-JSON: {"type":"service_account",...}' \
  -H 'X-Mcp-Secret-GA4-PROPERTY-ID: 123456789' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"run_report","arguments":{"metrics":["activeUsers","sessions"],"dimensions":["date"],"start_date":"7daysAgo","end_date":"today"}}}'

Security Notes

  • Service account credentials are injected at the Aerostack gateway layer — never stored in the worker
  • Uses analytics.readonly OAuth scope — this MCP cannot modify your GA4 configuration
  • Report results are limited to 10,000 rows maximum per call
  • Real-time reports cover the last 30 minutes of activity only

License

MIT

terminal Tools (13)

Available tools on this MCP server. Each tool can be called directly from any AI agent.

terminal
_ping #1

Verify Google Tasks credentials by calling a lightweight read endpoint. Used internally by Aerostack to validate credentials.

terminal
list_task_lists #2

List all task lists for the authenticated user

terminal
get_task_list #3

Get a specific task list by ID

terminal
create_task_list #4

Create a new task list

terminal
update_task_list #5

Update a task list title

terminal
delete_task_list #6

Delete a task list

terminal
list_tasks #7

List tasks in a task list

terminal
get_task #8

Get a specific task

terminal
create_task #9

Create a new task in a task list

terminal
update_task #10

Update an existing task

terminal
complete_task #11

Mark a task as completed

terminal
delete_task #12

Delete a task

terminal
clear_completed_tasks #13

Clear all completed tasks from a task list

Details

upgrade Version 0.1.0
gavel License MIT
wifi Transport streamable-http
lock Access Public
category Category Monitoring
terminal Tools 13

language Live Endpoint

https://mcp.aerostack.dev/s/aerostack/mcp-google-analytics

Sub-50ms globally · Zero cold start

Publisher

aerostack
@aerostack verified

Pre-built functions for the most common MCP tool patterns. Clone, extend, and deploy.

Tags

Browse more servers

More in Monitoring

Browse Monitoring MCPs →

Frequently asked questions

What is the Google Analytics MCP server and what can it do? +

The Google Analytics MCP server is hosted on Aerostack and exposes these tools to your AI agent: `_ping`, `list_task_lists`, `get_task_list`, `create_task_list`, `update_task_list`. You get one hosted URL — no self-hosting — that works from Claude, Cursor, ChatGPT, Gemini, VS Code, or any MCP-compatible client, and you can share it with your team or combine it with other MCP servers in a workspace.

Is the Google Analytics MCP server hosted, or do I have to run it myself? +

It's hosted on Aerostack's edge infrastructure — you don't deploy or maintain anything. Add it to a workspace and you get one authenticated URL, with secrets encrypted, that any AI agent or editor can connect to. Use it solo or share the same URL across your whole team.

Which AI agents and editors can use the Google Analytics MCP server? +

Any MCP client: Claude and Claude Code, Cursor, ChatGPT, Gemini, Windsurf, Cline, VS Code, and custom agents. Because it's one hosted URL, the same Google Analytics MCP server works everywhere — and you can compose it with other MCP servers, skills, and functions behind a single workspace URL.

How do I install the Google Analytics MCP server in Claude Desktop? +

Add the following to your Claude Desktop config (`claude_desktop_config.json`): ```json { "mcpServers": { "@aerostack/mcp-google-analytics": { "command": "npx", "args": ["-y", "@aerostack/@aerostack/mcp-google-analytics"] } } } ``` Then restart Claude Desktop and the tools will appear automatically.

How do I use the Google Analytics MCP server in Cursor? +

In Cursor, open **Settings → MCP** and add: ```json { "name": "@aerostack/mcp-google-analytics", "command": "npx", "args": ["-y", "@aerostack/@aerostack/mcp-google-analytics"] } ``` Save and reload Cursor. The MCP tools will be available in Agent mode.

Does Google Analytics MCP require authentication? +

Yes. Google Analytics requires authentication. Check the MCP's documentation for the required credentials.