MCP Analytics for GA4

Track your MCP server in Google Analytics.

See which tools get called, which AI assistants use them, and how often. Add an open source Java library to your server. The reports live in your own GA4 account.

Open sourceJava 17+Apache 2.0
Example Google Analytics report for an MCP server Illustrative data: 1,284 requests split across reported agents Claude, ChatGPT and Cursor. MCP Analytics for GA4 sends events to your own Google Analytics account. Google Analytics Example report MCP server activity Requests by reported agent 1,284 requests ClaudeChatGPTCursor 646420218 Illustrative data ยท Reports live in your Google Analytics
An illustrative report with example data. Create request, tool, agent and source reports in Google Analytics using the included guide.
Your MCP serverJava libraryYour GA4 account

Know how your server is used.

Keep MCP activity alongside the rest of your analytics, without running another dashboard or hosted collector.

How much traffic?

Count MCP requests over time and by method. Notifications are counted separately, so they do not inflate request totals.

Which tools?

Break down tool calls by name. Track outcomes and duration to understand what gets used and where calls fail.

Which AI assistants?

Compare reported agents such as Claude, ChatGPT and Cursor, with recognized bots and health checks identified separately.

Where did they come from?

Record explicit source and campaign tags or available referrer evidence. When discovery information is missing, it stays unknown.

Agent names are reported metadata, not verified identities or visitor counts. Optional application hooks also record searches, link opens and attributed orders. See metric coverage.

A dependency.
A small request hook.

Use your existing Java MCP server. Events leave through a bounded background queue, keeping network calls off the request thread.

Follow the Google Analytics setup guide

Install with Gradle

repositories { mavenCentral() }

dependencies {
    implementation 'io.github.shanifdhanani:mcp-analytics-ga4:0.1.1'
}
  1. Configure your GA4 measurement ID and private API secret on the server.
  2. Add the request hook, then verify received events in Google Realtime.
  3. Create the saved reports using the guide, or give it to Claude or ChatGPT with authorized Chrome access.

Built with Nobi.
Shared with everyone.

We built this while measuring how AI assistants use Nobi and Shop Nobi. It is now a standalone open source library for anyone running a Java MCP server.

Made by Locusive, the team behind focused software for search, commerce and forecasting. Contributions are welcome on GitHub.