If you’ve ever found yourself toggling between Google Analytics, Search Console, and whatever AI tool you’re using to make sense of it all, this guide is for you. The setup we’re about to walk through lets you ask your AI assistant things like “which pages lost organic traffic in the last 30 days and why?” or “what are my top-performing search queries for this month compared to last?” — and get actual answers pulled directly from your own data, in real time, without copying a single CSV.

Stop switching tabs, copy pasting and fumbling with filters and custom dashboards. Simply start asking questions and getting real answers from your own data, and get back control of your business intelligence.

This is made possible by MCP — Model Context Protocol — an open standard that lets AI tools connect to external data sources as first-class tools. We’ll be using two MCPs in particular: the official Google Analytics MCP (maintained by Google’s own analytics team) and mcp-gsc (the most widely adopted open-source Google Search Console connector, now with over 300 stars on GitHub). Both use permanent service account credentials, so nothing expires and nothing needs re-authenticating.

By the end of this guide you’ll have both MCPs running inside Cursor, VS Code, and Claude Desktop.

Why This Is Worth Your Time

The honest answer is that most people don’t get nearly enough value out of Google Analytics or Search Console — not because the data isn’t there, but because turning raw numbers into actionable insight requires a lot of manual work. You have to know which reports to look at, remember to look at them, and then do the mental work of connecting the dots across two separate platforms.

Connecting them to an AI assistant changes that completely. Once the MCPs are running, you can:

  • Ask for a plain-English summary of what happened to your traffic last month and get a diagnosis, not just a number
  • Cross-reference GSC keyword data with GA4 session and conversion data in a single conversation
  • Run content decay audits — pages that used to rank but are slipping — without building a spreadsheet
  • Spot quick wins: keywords where you’re ranking in positions 5–15 with decent impressions but low CTR
  • Get answers at 11pm without logging into anything

And because these MCPs are read-only and use service accounts scoped to just the analytics APIs, your data stays exactly where it is — there’s no export, no third-party ingestion, no training data risk.

What You’ll Need Before You Start

This guide assumes you’re on Windows (the paths use backslashes) but the same approach works on Mac and Linux with adjusted paths. You’ll need:

  • Python 3.10 or later — check with python --version in a terminal
  • pipx — install with pip install pipx if you don’t have it
  • uv / uvx — install with pip install uv , which gives you the uvx runner
  • A Google Cloud account with access to the projects linked to your GA4 and GSC properties
  • At least one of: Cursor, VS Code, or Claude Desktop
One GCP project per website is the cleanest setup. If you’re managing analytics for multiple websites, create a separate service account for each one. This keeps credentials isolated and makes it easy to revoke access for one project without affecting the others.

Part 1 — Google Cloud Setup (Do This Once Per Website)

Step 1: Create a Service Account

A service account is essentially a credential that belongs to an application rather than a person. Unlike the OAuth flow you might be used to (where you click “Allow” in a browser and get a token that expires), a service account key is a JSON file that lives on your machine permanently and never needs renewal.

  1. Go to console.cloud.google.com and select your GCP project (create one if you don’t have one yet — the free tier is sufficient)
  2. In the left sidebar, click IAM & AdminService Accounts
  3. Click + Create Service Account
  4. Give it a descriptive name like analytics-mcp-reader — the email address will be auto-generated
  5. On the next screen, skip the “Grant access” step — GA4 and GSC permissions are set in their own admin panels, not in GCP IAM
  6. Click Done

Step 2: Download the JSON Key

  1. Click on the service account you just created
  2. Go to the Keys tab
  3. Click Add KeyCreate new keyJSON
  4. Save the downloaded file somewhere permanent and predictable — something like C:\credentials\my-project\analytics-mcp-service-account.json
Keep this file private. Anyone with this JSON key can query your analytics data. Don’t commit it to a git repository, don’t paste it in Slack, and don’t store it in a public Dropbox folder.

Step 3: Enable the Required APIs

In your GCP project, go to APIs & ServicesLibrary and enable both of these:

  • Google Analytics Data API
  • Google Analytics Admin API

The Search Console API does not need to be enabled separately — the mcp-gsc server handles that through the service account credentials directly.

Part 2 — Grant the Service Account Access to Your Data

Google Analytics 4

GA4 manages user access separately from GCP. You need to add the service account email address as a user inside GA4 itself.

  1. Go to analytics.google.com
  2. Click the gear icon (Admin) at the bottom left
  3. Under the Property column, click Property Access Management
  4. Click the + button → Add users
  5. Paste the service account email (it looks like analytics-mcp-reader@your-project.iam.gserviceaccount.com )
  6. Set the role to Viewer or higher
  7. Click Add

Google Search Console

  1. Go to search.google.com/search-console
  2. Select your property
  3. Click Settings in the left sidebar
  4. Click Users and permissionsAdd user
  5. Paste the same service account email
  6. Set permission to Full
  7. Click Add
If you manage multiple websites, repeat these two sections for each one — creating a separate service account and JSON key per project is the recommended approach.

Part 3 — Install the MCP Servers

Both MCPs can be run on demand using pipx and uvx — there’s no global install step needed. The AI tool’s config file handles launching the server process automatically when needed. That said, you can verify the packages are accessible first:

# Check analytics-mcp is reachable via pipx
pipx run analytics-mcp --help
# Check mcp-gsc is reachable via uvx
uvx mcp-gsc --help

If either command returns an error, make sure pipx and uv are installed and on your system PATH.

Part 4 — Adding the MCPs to Your AI Tools

The configuration pattern is the same across all tools: you’re telling the application where to find the MCP server process and which environment variables to pass it. The only thing that changes between tools is the format of the config file.

In all the examples below, replace the credential paths with the actual locations where you saved your JSON key files.

Cursor

Cursor stores global MCP configuration at ~/.cursor/mcp.json (that’s C:\Users\YourName\.cursor\mcp.json on Windows). Open it in any text editor and add the following inside the "mcpServers" object:

"analytics-mcp-mysite": {
"command": "pipx",
"args": ["run", "analytics-mcp"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "C:\\credentials\\mysite\\analytics-mcp-service-account.json",
"GOOGLE_PROJECT_ID": "your-gcp-project-id"
}
},
"gsc-mcp-mysite": {
"command": "uvx",
"args": ["mcp-gsc"],
"env": {
"GSC_CREDENTIALS_PATH": "C:\\credentials\\mysite\\analytics-mcp-service-account.json",
"GSC_SKIP_OAUTH": "true"
}
}

If you’re managing multiple websites, duplicate each block and change the key name and credential path for each one — for example "analytics-mcp-site1" and "analytics-mcp-site2" . Restart Cursor after saving.

VS Code

VS Code’s MCP configuration lives at %APPDATA%\Code\User\mcp.json . The format uses a "servers" key (not "mcpServers" ) and requires an explicit "type": "stdio" field on each entry:

"analytics-mcp-mysite": {
"type": "stdio",
"command": "pipx",
"args": ["run", "analytics-mcp"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "C:\\credentials\\mysite\\analytics-mcp-service-account.json",
"GOOGLE_PROJECT_ID": "your-gcp-project-id"
}
},
"gsc-mcp-mysite": {
"type": "stdio",
"command": "uvx",
"args": ["mcp-gsc"],
"env": {
"GSC_CREDENTIALS_PATH": "C:\\credentials\\mysite\\analytics-mcp-service-account.json",
"GSC_SKIP_OAUTH": "true"
}
}

Restart VS Code after saving. The MCP servers will appear in the Copilot agent panel.

Claude Desktop

Claude Desktop’s config is at %APPDATA%\Claude\claude_desktop_config.json . The format is the same as Cursor’s "mcpServers" structure:

{
"mcpServers": {
"analytics-mcp-mysite": {
"command": "pipx",
"args": ["run", "analytics-mcp"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "C:\\credentials\\mysite\\analytics-mcp-service-account.json",
"GOOGLE_PROJECT_ID": "your-gcp-project-id"
}
},
"gsc-mcp-mysite": {
"command": "uvx",
"args": ["mcp-gsc"],
"env": {
"GSC_CREDENTIALS_PATH": "C:\\credentials\\mysite\\analytics-mcp-service-account.json",
"GSC_SKIP_OAUTH": "true"
}
}
}
}

Quit and reopen Claude Desktop completely after saving — a simple refresh isn’t enough for MCP changes to take effect.

Claude CLI (claude-code)

If you use the Claude Code CLI, run these commands once in your terminal — no config file editing needed:

claude mcp add analytics-mcp-mysite \
-e GOOGLE_APPLICATION_CREDENTIALS="C:\credentials\mysite\analytics-mcp-service-account.json" \
-e GOOGLE_PROJECT_ID="your-gcp-project-id" \
-- pipx run analytics-mcp
claude mcp add gsc-mcp-mysite \
-e GSC_CREDENTIALS_PATH="C:\credentials\mysite\analytics-mcp-service-account.json" \
-e GSC_SKIP_OAUTH="true" \
-- uvx mcp-gsc

Part 5 — Testing That Everything Works

Once you’ve restarted your tool of choice, open a new conversation and try a few queries to confirm the connections are live:

  • “List all the Google Analytics properties you have access to” — this calls get_account_summaries and should return your property names and IDs
  • “Show me the top 10 pages by sessions for the last 30 days” — this runs a GA4 report
  • “What are the top search queries driving impressions on my site this month?” — this queries Search Console

If a query fails with an authentication error, double-check that the service account email was added correctly to both the GA4 property and the GSC property, and that both Analytics APIs are enabled in your GCP project.

Tip: The GA4 MCP’s get_account_summaries tool returns the property IDs you’ll need for more targeted queries. Ask your AI to list them first, then use the specific property ID in follow-up questions when you have multiple websites.

What You Can Ask Once It’s Running

Here are some example prompts that work well once both MCPs are connected:

Goal Example prompt
Traffic overview “Summarise my website traffic for the last 28 days vs the same period last year”
Content decay “Which pages had significant drops in organic clicks compared to 3 months ago?”
Quick wins “Find keywords where I’m ranking between position 5 and 15 with more than 500 impressions this month”
Channel attribution “Break down my sessions by channel for the last 30 days and highlight anything unusual”
Landing page analysis “Which landing pages have the highest bounce rate and what’s their organic search volume?”
Indexing check “Are there any pages with impressions in GSC that have zero sessions in GA4?”

A Note on Data Privacy

Everything described in this guide keeps your analytics data local to your machine. The MCP servers run as local processes — there’s no cloud relay, no third-party ingestion, and no data leaving your environment. The AI model receives query results as part of your conversation context, the same way it would if you pasted numbers into a chat window yourself.

That said, if you’re using a commercial AI service (Claude, GPT-4, etc.), your conversation content — including analytics figures — does pass through their servers. If that’s a concern for your business, keep reading.

Need Your AI to Know Everything About Your Business — Without Sharing Any of It?

Connecting GA4 and Search Console to your AI assistant is a useful first step. But the full picture of your business lives in a lot more places: your CRM, your sales pipeline, your support tickets, your inventory system, your financial data. Most companies are sitting on a goldmine of operational data they never actually use, because the tools that could make sense of it all are either too expensive, too generic, or too dependent on sending your data to someone else’s servers.

At Shambix, we build private AI systems that run entirely on your own infrastructure. That means a custom LLM setup — tuned to your business context, connected to your actual data sources, and completely isolated from commercial AI providers. Your competitors don’t see your queries. Your customers’ data doesn’t leave your environment. You get a business intelligence layer that knows your company as well as your best analyst does, available around the clock.

We handle everything: model selection and deployment, MCP server configuration, data source integration, access controls, and ongoing maintenance. Whether you’re a growing SME that wants to stop paying for tools that don’t quite fit, or a larger organisation with serious data governance requirements, we can put together a solution that works for your specific situation.

If you’re curious about what that looks like for your business, we’re happy to have a conversation — no pitch deck, no obligation.

Talk to Us About a Custom AI Setup


The MCPs referenced in this guide are open source: google-analytics-mcp (Apache 2.0, maintained by Google) and mcp-gsc (MIT). Neither is affiliated with Shambix.

Have a custom AI system in mind for your company?
If you want a private, business-intelligence ready AI, you are in the right place.

Name
We work with flexible budgets, and welcome all kinds of projects, small to massive. It helps us tailor the best solution to your specific needs.