ga4-mcp

ga4-mcp

An MCP server integrating Google Analytics 4, Search Console, and Indexing API, enabling AI agents to run reports, inspect URLs, manage properties, and request indexing.

Category
Visit Server

README

ga4-mcp

npm version npm downloads License: MIT

GA4 + Google Search Console MCP server. Works with Claude, Copilot, Cursor, Codex, Gemini, and any MCP-compatible AI agent.

16 tools for Google Analytics 4, Search Console, and the Indexing API — run reports, inspect URLs, submit sitemaps, manage properties, and request indexing, all from your AI agent.

Quick Start

npx -y ga4-mcp

Or install globally for faster startup:

npm install -g ga4-mcp
ga4-mcp

Prerequisites

Authenticate with Google (includes all required scopes):

gcloud auth application-default login \
  --scopes="https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/analytics.edit,https://www.googleapis.com/auth/webmasters,https://www.googleapis.com/auth/indexing"

Or set GOOGLE_APPLICATION_CREDENTIALS to a service account JSON key file.

Agent Configuration

Claude Code

{
  "mcpServers": {
    "ga4-analytics": {
      "command": "npx",
      "args": ["-y", "ga4-mcp"]
    }
  }
}

Cursor / Windsurf / Continue

Add to .cursor/mcp.json or equivalent:

{
  "mcpServers": {
    "ga4-analytics": {
      "command": "npx",
      "args": ["-y", "ga4-mcp"]
    }
  }
}

Load only specific tool groups

{
  "mcpServers": {
    "ga4-analytics": {
      "command": "npx",
      "args": ["-y", "ga4-mcp", "--tools", "ga4,gsc"]
    }
  }
}

CLI Options

ga4-mcp [options]

--tools <groups>     Tool groups to enable: ga4, gsc, indexing, admin, all (default: all)
                     "ga4" = read-only analytics. "admin" = write/delete mega-tool.
--transport <type>   Transport: stdio (default) or http (Streamable HTTP)
--port <number>      HTTP port (default: 3000)
--version            Show version
--help               Show help

Environment variables: GA4_MCP_TOOLS, GA4_MCP_TRANSPORT, GA4_MCP_PORT

Tools (16 total)

Utility (1 tool)

Tool Description
ping Health check — returns pong (always registered)

GA4 Analytics (6 tools) — group: ga4

Tool Description
get_account_summaries List all GA4 accounts and properties
get_property_details Property details (name, timezone, currency)
run_report Run GA4 Data API reports
run_realtime_report Run GA4 realtime reports
get_custom_dimensions_and_metrics Custom dimensions and metrics
list_google_ads_links Google Ads links for a property

GA4 Admin (1 mega-tool, 14 actions) — group: admin

Tool Description
ga4_admin Create/update/delete properties, streams, key events, audiences

Google Search Console (6 tools) — group: gsc

Tool Description
gsc_list_sites List all GSC properties
gsc_search_analytics Query search analytics (impressions, clicks, CTR, position)
gsc_inspect_url URL inspection (index status, crawl info, mobile usability)
gsc_list_sitemaps List submitted sitemaps
gsc_add_site Add a site to GSC
gsc_submit_sitemap Submit a sitemap

Indexing API (2 tools) — group: indexing

Tool Description
indexing_notify Notify Google to crawl/remove a URL
indexing_status Check notification status for a URL

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured