Installation guide
How to install Google Analytics MCP Server
In Claude, ChatGPT, Gemini, Microsoft Copilot, Perplexity, Cursor and Claude Code, with what to check before you start and the first prompts to run.
This is a local install. You run Google's open-source `analytics-mcp` server on your own machine with `pipx`, and it reads GA4 through the Google Analytics Admin API and Data API. Authentication uses Google Application Default Credentials (ADC), not a hosted sign-in. The tools cover account and property details, standard, funnel, conversions and realtime reports, and custom dimensions and metrics.
Have a analytics or marketing-ops owner do this, using a Google account (or a service account to impersonate) that already has read access to the GA4 properties in scope. A developer with access to a Google Cloud project will need to enable the two APIs. Keep it read-only: the write tools only appear if you pass `--allow-write`, so leave that flag off until a supervised task needs it.

Before you start
- A Google Cloud project where you can enable the Google Analytics Admin API and the Google Analytics Data API
- A Google user (or service account for impersonation) with access to the GA4 accounts or properties you want to query
pipxinstalled, and thegcloudCLI for creating Application Default Credentials- An OAuth desktop or web client
JSONfile if you log in with user credentials (see the vendor's Manage OAuth Clients link) - Your Google Cloud project ID, for the
GOOGLE_CLOUD_PROJECTsetting theREADMErecommends
- How it runs
- Local, runs on your machine
- Access
- Read-only
- Server address
- Copy it from the vendor documentation
Google Analytics MCP Server in Claude
- The
READMEdoes not cover Claude Desktop, so this uses the standard local-server config. Complete the credentials setup first: enable both APIs, then rungcloud auth application-default login --scopes https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/cloud-platform --client-id-file=YOUR_CLIENT_JSON_FILE. - Copy the path printed after
Credentials saved to file:. You will use it asPATH_TO_CREDENTIALS_JSON. - In Claude Desktop, open
Settings > Developer > Edit Configto openclaude_desktop_config.json. - Add the
analytics-mcpentry from the snippet undermcpServers, replacingPATH_TO_CREDENTIALS_JSONandYOUR_PROJECT_ID. - Do not add
--allow-writefor now. Fully quit and reopen Claude Desktop. - Start a new chat and run the verify prompts below. The Claude.ai web connector UI takes remote URLs only, so it cannot use this local setup.
{
"mcpServers": {
"analytics-mcp": {
"command": "pipx",
"args": [
"run",
"analytics-mcp"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_CREDENTIALS_JSON",
"GOOGLE_CLOUD_PROJECT": "YOUR_PROJECT_ID"
}
}
}
}
Google Analytics MCP Server in ChatGPT
- The
READMEdoes not cover ChatGPT. ChatGPT custom MCP connectors (Developer mode) connect to a remote URL, so the default localpipxsetup cannot be added directly. - The
READMEdoes describe self-hosting overHTTP:pipx run analytics-mcp --transport http --stateless-http --oauth --host 0.0.0.0 --port 8080, withGOOGLE_OAUTH_CLIENT_ID,GOOGLE_OAUTH_CLIENT_SECRETandANALYTICS_MCP_ISSUER_URLset. It also has a Dockerfile and Cloud Run instructions. - Deploy that service on
HTTPSinfrastructure you control. Have a developer review theREADME's multi-tenant section first, including the note that OAuth state is held in process memory. - In ChatGPT, enable Developer mode in the settings and add a custom connector, entering the public URL of your own deployment. Take the exact path from the vendor documentation, because this listing does not state it.
- Compatibility of this server with ChatGPT is not confirmed in the docs, so test with a read-only Google account first.
- Run the verify prompts below.
Google Analytics MCP Server in Gemini
- Gemini is the client the
READMEdocuments. Install Gemini CLI or Gemini Code Assist, and installpipx. - Enable the Google Analytics Admin API and Google Analytics Data API in your Google Cloud project.
- Run
gcloud auth application-default loginwith thehttps://www.googleapis.com/auth/analytics.readonlyscope (andcloud-platform), using either--client-id-file=YOUR_CLIENT_JSON_FILEor--impersonate-service-account=SERVICE_ACCOUNT_EMAIL. Copy the path shown afterCredentials saved to file:. - Create or edit
~/.gemini/settings.jsonand add theanalytics-mcpentry from the snippet, replacingPATH_TO_CREDENTIALS_JSONandYOUR_PROJECT_ID. - Leave
--allow-writeout ofargsfor read-only use. - Launch Gemini CLI or Code Assist and type
/mcp.analytics-mcpshould be listed.
{
"mcpServers": {
"analytics-mcp": {
"command": "pipx",
"args": [
"run",
"analytics-mcp"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_CREDENTIALS_JSON",
"GOOGLE_CLOUD_PROJECT": "YOUR_PROJECT_ID"
}
}
}
}
Google Analytics MCP Server in Microsoft Copilot
- The
READMEdoes not cover GitHub Copilot or Copilot Studio. For GitHub Copilot in VS Code, use the standard local-server format in.vscode/mcp.json. - Complete the credentials setup first: enable both APIs and run
gcloud auth application-default loginwith theanalytics.readonlyscope. Note the credentials file path it prints. - Create or open
.vscode/mcp.jsonin your workspace and add theanalytics-mcpentry from the snippet, replacingPATH_TO_CREDENTIALS_JSONandYOUR_PROJECT_ID. - Save the file and start the server from the inline control VS Code shows in
mcp.json, then open Copilot Chat in agent mode and confirm the tools appear. - Copilot Studio needs a remote endpoint. You would have to self-host the
HTTPmode described in theREADMEand follow Microsoft's steps for adding an MCP tool by URL. The docs do not cover that path.
{
"servers": {
"analytics-mcp": {
"command": "pipx",
"args": [
"run",
"analytics-mcp"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_CREDENTIALS_JSON",
"GOOGLE_CLOUD_PROJECT": "YOUR_PROJECT_ID"
}
}
}
}
Google Analytics MCP Server in Perplexity
- The
READMEdoes not cover Perplexity, so no tested configuration exists for it. - Complete the credentials setup first: enable both APIs, run
gcloud auth application-default loginwith theanalytics.readonlyscope, and note the credentials file path. - In the Perplexity desktop app, open the connectors or MCP settings and check whether it can add a local command server. Check Perplexity's own documentation for the current requirements.
- If it accepts a local command, use
pipxwith the argumentsrun analytics-mcp, and setGOOGLE_APPLICATION_CREDENTIALSandGOOGLE_CLOUD_PROJECTas environment variables. - If it only accepts remote URLs, you would need to self-host the
HTTPmode described in theREADMEand enter your own deployment URL. - Run the verify prompts below.
Google Analytics MCP Server in Cursor
- The
READMEdoes not cover Cursor, so this uses Cursor's standard local MCP config. - Enable both Google APIs, then run
gcloud auth application-default loginwith theanalytics.readonlyscope. Copy the path printed afterCredentials saved to file:. - Open
Cursor Settings > MCPand add a new server. This opensmcp.json. You can also edit.cursor/mcp.jsonin a project. - Paste the
analytics-mcpentry from the snippet, replacingPATH_TO_CREDENTIALS_JSONandYOUR_PROJECT_ID. - Leave
--allow-writeout ofargsfor read-only use. - Return to
Cursor Settings > MCP, confirmanalytics-mcpshows as enabled, then run the verify prompts.
{
"mcpServers": {
"analytics-mcp": {
"command": "pipx",
"args": [
"run",
"analytics-mcp"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_CREDENTIALS_JSON",
"GOOGLE_CLOUD_PROJECT": "YOUR_PROJECT_ID"
}
}
}
}
Google Analytics MCP Server in Claude Code
- Install
pipxand enable the Google Analytics Admin API and Google Analytics Data API in your Google Cloud project. - Run
gcloud auth application-default loginwith thehttps://www.googleapis.com/auth/analytics.readonlyscope (pluscloud-platform), using--client-id-file=YOUR_CLIENT_JSON_FILEor--impersonate-service-account=SERVICE_ACCOUNT_EMAIL. - Copy the path printed after
Credentials saved to file:. - Run the
claude mcp addcommand from the snippet, replacingPATH_TO_CREDENTIALS_JSONandYOUR_PROJECT_ID. TheREADMEuses--scope user. - Do not append
--allow-writeto the command unless you need a supervised write task. - Start
claude, run/mcp, and confirmanalytics-mcpis connected.
claude mcp add analytics-mcp \
--scope user \
-e "GOOGLE_APPLICATION_CREDENTIALS=PATH_TO_CREDENTIALS_JSON" \
-e "GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID" \
-- pipx run analytics-mcpCheck that it works
Start with questions that only read data. If these answer from your real account, the connection is good.
- Which Google Analytics properties can you see? Use get_account_summaries and list them by account.
- What are the most popular events in my Google Analytics property in the last 180 days?
- What are the custom dimensions and custom metrics in my property?
Troubleshooting
+The server is listed but returns permission or API errors. What should I check?
Confirm the Google Analytics Admin API and Google Analytics Data API are both enabled in the project named in `GOOGLE_CLOUD_PROJECT`. Then check that the credentials belong to a user or service account with access to the GA4 property, and that they include the `analytics.readonly` scope. Re-run the `gcloud auth application-default login` command if you changed scopes.
+My client does not list analytics-mcp or shows no tools. What now?
Check that `pipx` is on the PATH the client uses, since GUI apps often see a different PATH than your terminal. Confirm the JSON is valid and that `GOOGLE_APPLICATION_CREDENTIALS` points to the file `gcloud` printed. Restart the client fully. In Gemini CLI or Claude Code, run `/mcp` to check status.
+Why can't I create custom dimensions or key events?
Write tools are off by default. They need the `--allow-write` flag, credentials that include the `https://www.googleapis.com/auth/analytics.edit` scope, and a suitable role on the property (Editor for custom dimensions, Marketer or Editor for key events). Enable them only for supervised tasks. For other problems, see the project's `TROUBLESHOOTING.md`.
Written Nov 27, 2026 from the vendor documentation. Exact menus, addresses and commands change; the official documentation is the source of truth.
Questions and answers
Questions readers and searchers ask about installing Google Analytics MCP Server, answered by the site editor from the vendor documentation, plus reader experience. Every comment is reviewed before it appears.