mcp-site-analyst
Provides tools to run custom reports, retrieve realtime data, discover metadata, and access top pages, traffic sources, and demographics from Google Analytics GA4.
Provides tools to query search performance, inspect URLs, list/manage sitemaps, list sites, and access top queries and pages from Google Search Console.
Click on "Deploy 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-site-analyst What are my top pages this week?"
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 Site Analyst
An MCP (Model Context Protocol) server that provides Google Analytics (GA4) and Google Search Console data as tools for AI assistants.
Features
13 tools across two Google services
Google Analytics (GA4): Custom reports, realtime data, metadata discovery, top pages, traffic sources, demographics
Google Search Console: Search analytics, sitemaps, URL inspection, site listing, top queries, top pages
Dual transport: stdio (local) and stateless HTTP (remote)
Flexible auth: Service account key file, inline JSON credentials, Application Default Credentials, or CLI argument
Configurable GA4 Property ID: Set once at server level or per-tool call
Optional Bearer token auth for HTTP mode
Related MCP server: ga4-mcp
Prerequisites
Google Cloud Project with these APIs enabled:
Service Account with a downloaded JSON key file:
Create a service account → Keys → Add Key → JSON
Grant access to the service account:
GA4: Admin > Property Access Management > Add the service account email as Viewer
Search Console: Settings > Users and permissions > Add the service account email
Installation
npm install
npm run buildUsage
stdio mode (Claude Desktop, Gemini CLI, etc.)
# Using CLI argument
node build/index.js --key-file /path/to/key.json
# Using environment variable
GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json node build/index.js
# With a default GA4 Property ID
node build/index.js --key-file /path/to/key.json --property-id 123456789HTTP mode
# Default port 3000
node build/index.js --http --key-file /path/to/key.json
# Custom port
node build/index.js --http --port 8080 --key-file /path/to/key.json
# With Bearer token authentication
MCP_AUTH_TOKEN=my-secret-token node build/index.js --http --key-file /path/to/key.jsonThe HTTP endpoint is available at POST http://localhost:3000/mcp (Streamable HTTP, stateless).
A health check endpoint is available at GET http://localhost:3000/health.
Authentication
The server resolves Google credentials in this order:
Priority | Method | Description |
1 |
| CLI argument pointing to a service account JSON key file |
2 |
| Environment variable containing the full JSON key as a string (useful for containers/CI) |
3 |
| Environment variable pointing to a key file path |
4 | Application Default Credentials | Automatic on Cloud Run, GCE, or when authenticated via |
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"site-analyst": {
"command": "node",
"args": [
"/absolute/path/to/mcp-site-analyst/build/index.js",
"--key-file",
"/absolute/path/to/key.json",
"--property-id",
"YOUR_GA4_PROPERTY_ID"
]
}
}
}Gemini CLI Configuration
Add to your .gemini/settings.json:
{
"mcpServers": {
"site-analyst": {
"command": "node",
"args": [
"/absolute/path/to/mcp-site-analyst/build/index.js",
"--key-file",
"/absolute/path/to/key.json"
]
}
}
}Remote HTTP Configuration
If deployed to a remote server (e.g. Cloud Run), configure your client to use the HTTP endpoint:
{
"mcpServers": {
"site-analyst": {
"httpUrl": "https://your-service-url/mcp",
"headers": {
"Authorization": "Bearer YOUR_AUTH_TOKEN"
}
}
}
}Deploying to Cloud Run
A deployment script is included for Google Cloud Run.
Setup
# Copy the example env file and fill in your values
cp .env.example .env
# Edit .env with your GCP project ID, region, and GA4 property IDSee .env.example for all available configuration options.
Deploy
# Deploy with Cloud Build (no local Docker required)
./deploy.sh --cloud-build
# Deploy with local Docker build
./deploy.sh
# Deploy with Bearer token auth enabled
./deploy.sh --token "my-secret-token"On Cloud Run the server uses Application Default Credentials automatically via the configured service account — no key file is needed.
Tools Reference
Google Analytics (GA4)
Tool | Description |
| Run a custom report with flexible dimensions, metrics, date ranges, filters, and sorting |
| Get real-time active user data (last 30 minutes) |
| Discover all available dimensions and metrics |
| Shortcut: Top pages by pageviews |
| Shortcut: Top traffic sources by sessions |
| Shortcut: User breakdown by country/city/language |
Google Search Console
Tool | Description |
| Query search performance (clicks, impressions, CTR, position) with filters |
| List all submitted sitemaps |
| Get details for a specific sitemap |
| Inspect a URL's index status and mobile usability |
| List all sites accessible by the service account |
| Shortcut: Top search queries by clicks |
| Shortcut: Top pages by clicks in search |
Development
# Run in dev mode (no build step needed)
npx tsx src/index.ts --key-file /path/to/key.json
# Build
npm run build
# Test with MCP Inspector
npx @modelcontextprotocol/inspector node build/index.js --key-file /path/to/key.jsonLicense
MIT
Available Tools
13 toolsga4_get_metadataA
List all available dimensions and metrics for a GA4 property. Use this to discover what fields are available before running reports.
Inputs: filter, propertyId.
ga4_realtime_reportA
Get real-time active users and metrics from GA4. Shows data from the last 30 minutes.
Inputs: limit, metrics, dimensions, propertyId.
ga4_run_reportA
Run a custom GA4 report with flexible dimensions, metrics, and date ranges. Use ga4_get_metadata to discover available dimensions and metrics first.
Inputs: endDate (required), metrics (required), startDate (required), limit, +6 more.
ga4_top_pagesA
Get the top pages by page views for a GA4 property. A convenient shortcut for a common report.
Inputs: limit, endDate, startDate, propertyId.
ga4_top_traffic_sourcesA
Get top traffic sources for a GA4 property, broken down by source/medium.
Inputs: limit, endDate, startDate, propertyId.
ga4_user_demographicsA
Get user demographics breakdown (country, city, or language) for a GA4 property.
Inputs: limit, endDate, dimension, startDate, +1 more.
gsc_get_sitemapB
Get detailed information about a specific sitemap.
Inputs: siteUrl (required), feedpath (required).
gsc_inspect_urlA
Inspect a URL in Google Search Console. Returns indexing status, crawl info, mobile usability, and rich results status. Note: daily quotas apply.
Inputs: siteUrl (required), inspectionUrl (required), languageCode.
gsc_list_sitemapsA
List all sitemaps submitted to Google Search Console for a site.
Inputs: siteUrl (required).
gsc_list_sitesA
List all sites the service account has access to in Google Search Console.
Inputs: no named parameters.
gsc_search_analyticsB
Query Google Search Console search analytics data. Returns clicks, impressions, CTR, and average position. Can be broken down by query, page, country, device, or date.
Inputs: endDate (required), siteUrl (required), startDate (required), type, +5 more.
gsc_top_pagesB
Get top pages by clicks in Google Search for a site. A convenient shortcut.
Inputs: siteUrl (required), limit, endDate, startDate.
gsc_top_queriesB
Get top search queries by clicks for a site. A convenient shortcut for common analysis.
Inputs: siteUrl (required), limit, endDate, startDate.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Tools are cleanly separated by service prefix (ga4_ vs gsc_) and each targets a distinct function. Even the top_pages tools are unambiguous because one is GA4 page views and the other is GSC search clicks, with clear descriptions noting they are conveniences over more general reporting tools.
All tools follow a consistent lower_snake_case pattern with service prefixes, and the action or data focus is clear. While some names omit explicit verbs (e.g., ga4_top_pages), the pattern is uniform across the set, making it easy to infer behavior.
13 tools is well within the ideal range for a focused analytics server, covering both GA4 and GSC without redundancy. Each tool earns its place by providing a distinct, useful capability for site analysis.
The tool surface covers core analytics needs for both GA4 (demographics, realtime, custom reports, metadata, common metrics) and GSC (search performance, sitemaps, URL inspection, site listing). Minor gaps exist, such as no explicit GA4 property listing or advanced GSC sitemap submission, but these do not block typical analysis workflows.
Maintenance
Related MCP Connectors
Read-only Google Search Console MCP server for AI assistants.
Google Search Console, GA4 and PageSpeed MCP server for Claude, ChatGPT and Cursor. Free, hosted.
Read-only Google Analytics 4 MCP server for AI assistants.
Hosted MCP server for GA4, Google Ads and Search Console. Google OAuth, nothing to install.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server that gives AI assistants live access to Google Search Console and Bing Webmaster Tools for search performance, indexing, keyword research, and crawl health analysis directly in the chat.1013 npmMIT
- AlicenseBqualityDmaintenanceAn MCP server integrating Google Analytics 4, Search Console, and Indexing API, enabling AI agents to run reports, inspect URLs, manage properties, and request indexing.16429 npm2MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that connects AI assistants to SEO platforms like Google Search Console, GA4, Bing Webmaster Tools, and Adobe Analytics, enabling natural language queries about SEO performance.1,377 npmMIT
- AlicenseNot gradedqualityDmaintenanceA unified MCP server that gives AI assistants direct access to Google Analytics 4, Google Search Console, Google Ads and Google Merchant Center data using OAuth2 user credentials.MIT