connectors: add google-analytics-4 (Admin + Data + Realtime + Funnel)#243
Merged
Conversation
… Funnel) Mirrors the 7 tools the upstream googleanalytics/google-analytics-mcp server exposes — split into 8 here because their `get_custom_dimensions _and_metrics` is two separate Admin endpoints, easier to call as two distinct tools than to merge in our request shape. Single adapter, dual-host (analyticsadmin.googleapis.com for metadata + analyticsdata.googleapis.com for reports) via the absolute-URL support already in the REST engine. Auth: OAuth2 with user refresh_token against the standard Google token endpoint. Service-account JWT (RS256) NOT supported yet — documented in the instructions with a workaround (dedicated automation Google account). Adding RS256 to the engine would unlock all other Google product APIs (Drive, Sheets, BigQuery, Calendar) — deferring until we see actual demand for GA4. Tools: ga4_get_account_summaries (Admin v1beta) ga4_get_property_details (Admin v1beta) ga4_list_google_ads_links (Admin v1beta) ga4_list_custom_dimensions (Admin v1beta) ga4_list_custom_metrics (Admin v1beta) ga4_run_report (Data v1beta) ga4_run_realtime_report (Data v1beta) ga4_run_funnel_report (Data v1alpha) Tested: validate-adapters.mjs OK, 2143/2143 jest tests pass including the new spec that asserts: dual-host routing, OAuth2 token URL, tool naming, full tool set coverage. Catalog regenerated (168 total).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New `google-analytics-4` adapter mirroring the 7 tools the upstream googleanalytics/google-analytics-mcp server exposes. Catalog grows 167 → 168.
Single adapter, dual host (analyticsadmin + analyticsdata) via the absolute-URL support already in the REST engine.
Auth
User OAuth2 with refresh token against `oauth2.googleapis.com/token`. Already supported by the engine — same flow as Zoho/Pinterest/FreshBooks/Sage.
Service account JWT (RS256) intentionally not supported in v1 — would require new engine code (~1-2 days). Documented in the connector `instructions` with a workaround (dedicated automation Google account). I'll add RS256 to the engine when there's enough demand to justify it; that work unlocks Drive/Sheets/BigQuery/Calendar too.
Vendor-MCP-already-exists situation
Yes — Google ships an official Python MCP server. Same value-add reasoning as our HubSpot / Atlassian audit (PR #232 era):
Verification
```
$ node scripts/validate-adapters.mjs
Validated 168 adapters: 168 passed, 0 failed.
$ npx jest --testPathPatterns='google-analytics-4|catalog.spec' --silent
Test Suites: 2 passed
Tests: 2143 passed, 2143 total
```
Live spec asserts:
Test plan