Supports analyzing Google Ads campaign performance and multi-touch attribution modeling within the analytics workflow.
Provides comprehensive tools for Google Analytics 4, including advanced reporting (real-time, funnel, and pivot reports), configuration management for properties and custom dimensions, and compliance features like GDPR-compliant data deletion.
Enables connectivity to BigQuery for data warehouse analysis and provides management for multi-platform data streams.
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., "@MCP Google Analytics 4 ServerShow me the top 10 traffic sources and their conversion rates for the last 30 days"
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.
MCP Google Analytics 4 Server
A comprehensive Model Context Protocol (MCP) server for Google Analytics 4 integration, providing advanced analytics capabilities for AI applications.
๐ฏ Overview
This MCP server enables AI applications to interact with Google Analytics 4 through a standardized protocol. It supports data retrieval, configuration management, compliance features, and business intelligence automation.
Compatibility: Works with Cursor, Claude Desktop, and any MCP-compatible AI platform.
๐ Features
Phase 1: Advanced Reporting (8 tools)
Basic Metrics: Core GA4 metrics and KPIs
Traffic Analysis: Sources, pages, and user behavior
Real-time Reports: Live data (up to 29 minutes for standard properties)
Pivot Reports: Cross-dimensional analysis
Funnel Analysis: Conversion path tracking
Batch Processing: Multiple reports automation
Phase 2: Configuration Management (13 tools)
Custom Dimensions: Create, read, update, archive
Custom Metrics: Complete lifecycle management
Conversion Events: Configure and manage goals
Property Settings: Comprehensive configuration access
Phase 3: Platform Integrations (15 tools)
Google Ads: Campaign performance and attribution
BigQuery: Data warehouse connectivity
Data Streams: Multi-platform tracking setup
Measurement Protocol: Server-side event tracking
Phase 4: Compliance & Privacy (10 tools)
GDPR Compliance: Automated data subject rights
User Deletion: Privacy-compliant data removal
Data Retention: Automated lifecycle management
Access Control: Permission and audit management
Phase 5: Business Intelligence (8 tools)
Attribution Modeling: Multi-touch attribution analysis
Audience Management: Automated segmentation
Predictive Analytics: ML-powered insights
Custom Dashboards: Automated reporting
Total: 54 specialized tools across 5 phases
๐ง Installation
Prerequisites
Python 3.8+
Google Analytics 4 property
Google Cloud project with Analytics API enabled
Quick Setup
Install the package:
Configure authentication:
Add to your MCP client:
For Cursor (.cursor/mcp.json):
For Claude Desktop (claude_desktop_config.json):
๐ Usage Examples
Basic Analytics Query
Real-time Monitoring
Conversion Analysis
Configuration Management
GDPR Compliance
๐ API Coverage
This server implements comprehensive coverage of Google Analytics APIs:
API | Coverage | Tools |
Analytics Data API | Complete | 15 tools |
Analytics Admin API | Complete | 27 tools |
Analytics Measurement Protocol | Complete | 8 tools |
User Deletion API | Complete | 4 tools |
Total API Coverage: 54 specialized tools
๐ Security & Permissions
Required OAuth Scopes
https://www.googleapis.com/auth/analytics.readonly- Data accesshttps://www.googleapis.com/auth/analytics.edit- Configuration managementhttps://www.googleapis.com/auth/analytics.manage.users- User management
Data Privacy
No data stored locally
Direct API communication only
GDPR-compliant data handling
Audit logging for compliance
๐งช Testing & Validation
The server includes comprehensive testing:
Unit Tests: All 54 tools tested individually
Integration Tests: Real API validation
Success Rate: 92.3% (50/54 tools passing)
Error Handling: Graceful fallbacks and detailed error messages
Run tests:
๐ Documentation
Complete API Reference
Tool Documentation - All 54 tools detailed
Configuration Guide - Setup and customization
Examples - Common use cases
Troubleshooting - Common issues
Development
Contributing Guide - How to contribute
Architecture - Technical design
Testing - Test suite details
๐ Comparison with Other Solutions
Feature | This Server | Google Official MCP | Basic Packages |
Total Tools | 54 | 6 | 2-3 |
Platform Support | Universal MCP | Gemini only | Varies |
Real-time Data | โ Advanced | โ Basic | โ |
Configuration Management | โ Complete | โ | โ |
GDPR Compliance | โ Built-in | โ | โ |
Business Intelligence | โ Automated | โ | โ |
Write Permissions | โ Full | โ Read-only | Varies |
Multi-touch Attribution | โ Advanced | โ | โ |
Testing Coverage | โ 92.3% | Unknown | Minimal |
๐ค Contributing
Contributions are welcome! Please see our Contributing Guide for details.
Development Setup
๐ License
MIT License - see LICENSE file for details.
๐ Links
๐ Support
Documentation: docs/
Issues: GitHub Issues
Discussions: GitHub Discussions
Note: This is an independent implementation. For the official Google Analytics MCP server, see googleanalytics/google-analytics-mcp.