Google Analytics MCP server for accessing web analytics data
Google analytics mcp server lets Claude, Cursor and other MCP clients work with Google Analytics directly. Google Analytics MCP server for accessing web analytics data.
An MCP server implementation for accessing Google Analytics 4 (GA4) data, built using the Model Context Protocol TypeScript SDK.
Once connected, the assistant can call these 5 tools directly:
runReport — The runReport tool exposed by this servergetPageViews — The getPageViews tool exposed by this servergetActiveUsers — The getActiveUsers tool exposed by this servergetEvents — The getEvents tool exposed by this servergetUserBehavior — The getUserBehavior tool exposed by this serverThe server is distributed via npm as @smithery/cli, so most clients can run it without a manual build step. Add it to your MCP client's configuration and restart the client to pick it up — the copy-paste configs for Claude Desktop, Claude Code and Cursor are on this page.
Before the server will start you need to supply 3 environment variables: GOOGLE_CLIENT_EMAIL, GOOGLE_PRIVATE_KEY, GA_PROPERTY_ID. Keep credentials in your client's env block or a secrets manager rather than committing them.
Developer-tool servers are usually the first ones people connect, because they turn "help me with this code" into an assistant that can actually read the repo and act on it. Google Analytics sits in that group, and the shape of its toolset — runReport, getPageViews, getActiveUsers among others — tells you what it is really for. Worth comparing against the other developer tools servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.
| Tool | What it does |
|---|---|
| runReport | The runReport tool exposed by this server. |
| getPageViews | The getPageViews tool exposed by this server. |
| getActiveUsers | The getActiveUsers tool exposed by this server. |
| getEvents | The getEvents tool exposed by this server. |
| getUserBehavior | The getUserBehavior tool exposed by this server. |
{
"mcpServers": {
"google-analytics": {
"command": "npx",
"args": ["-y", "mcp-server-google-analytics"],
"env": {
"GOOGLE_CLIENT_EMAIL": "your-service-account@project.iam.gserviceaccount.com",
"GOOGLE_PRIVATE_KEY": "your-private-key",
"GA_PROPERTY_ID": "your-ga4-property-id"
}
}
}
}Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| GOOGLE_CLIENT_EMAIL | Configuration value read at startup. | Optional |
| GOOGLE_PRIVATE_KEY | Credential the server authenticates with. | Yes |
| GA_PROPERTY_ID | Configuration value read at startup. | Optional |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.