GA4
- typescript
0
GitHub Stars
typescript
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"wonyoungseong-ga4-mcp-server": {
"command": "node",
"args": [
"/path/to/ga4-mcp-server/dist/index.js"
],
"env": {
"GA4_CLIENT_ID": "your-client-id",
"GA4_ACCESS_TOKEN": "your-access-token",
"GA4_CLIENT_SECRET": "your-client-secret",
"GA4_REFRESH_TOKEN": "your-refresh-token"
}
}
}
}You run a Model Context Protocol (MCP) server that enables querying Google Analytics 4 data via the Admin and Data APIs, with built-in support for OAuth-based and service account authentication. This server lets you execute GA4 reports, manage properties, validate GTM parameters, and securely connect from MCP-enabled clients like Claude Desktop for end-to-end GA4 data operations.
How to use
To use the GA4 MCP Server, connect it to your MCP client (such as Claude Desktop) using a local or remote setup. You can authenticate with either OAuth Playground tokens for personal use or a service account for production. After authentication, you can run GA4 Admin API tools to manage accounts and properties, GA4 Data API tools to run standard or realtime reports, and the GTM validation tool to validate GTM event parameters against GA4 registrations. The server is compatible with Claude Desktop and can work in tandem with a GTM MCP Server for end-to-end event validation.
How to install
Prerequisites: Node.js and npm must be installed on your system.
# Install dependencies and build the MCP server
npm install
npm run build
Additional sections
Configuration and startup follow the authentication options and MCP execution paths shown in practical setup examples. You will configure OAuth credentials or service account credentials, then run the server through a standard Node.js runtime. The server exposes a set of tools for Admin API access, Data API access, and GTM parameter validation. The following sections detail practical usage, including configuring your client, starting the server, and running common tasks.
Available tools
ga4_account_summaries
List all GA4 accounts and properties accessible by the user
ga4_property_details
Retrieve detailed information about a specific GA4 property
ga4_google_ads_links
List Google Ads accounts linked to a GA4 property
ga4_property_annotations
List available annotations for a GA4 property (limited scope)
ga4_run_report
Execute a standard GA4 report with defined dimensions, metrics, and date ranges
ga4_run_realtime_report
Run a realtime GA4 report for the last 30 minutes
ga4_custom_dimensions_metrics
Retrieve custom dimensions and metrics defined for a property
ga4_validate_gtm_params
Validate GTM event parameters against GA4 custom dimensions and data collection