Auth Login
Run the Google Analytics OAuth browser flow and cache credentials for the ga-mcp-full MCP server.
/ga-mcp-full:auth-login
Authenticate the ga-mcp-full MCP server against your Google Analytics account.
What this does
Runs ga-mcp-full auth login, which:
- Resolves the OAuth client (env var override →
~/.config/ga-mcp/client_secrets.json→ bundled public Desktop client). - Opens your default browser to Google's consent screen with the
analytics.editscope. - Starts a local HTTP server on
127.0.0.1bound to a random free port (no pre-registration needed — Google's installed-app OAuth accepts any loopback port). - Completes a PKCE-protected (S256) authorization code exchange.
- Caches credentials at
~/.config/ga-mcp/credentials.json(mode0600).
Subsequent Claude Code sessions reuse the cached refresh token automatically — you never need the client ID/secret at runtime after this step.
Steps
-
Run the login command with
Bash:ga-mcp-full auth login -
Report the result to the user. If the command exits non-zero with
client_not_configured, point them at/ga-mcp-full:setupso they can install the CLI or provide a custom OAuth client. -
If the browser does not open automatically, the command prints the auth URL to stderr — surface that URL to the user so they can open it manually.
Notes
- The MCP server does NOT need to be restarted after login — the next tool call will load the new credentials from disk.
- If a cached refresh token has been revoked, tool calls surface
"GA auth required: run /ga-mcp-full:auth-login ..."— rerun this command to re-authenticate.