Connect Google Analytics and Search Console to Slab agents
Slab can expose Google Analytics 4 and Google Search Console as native, read-only tools. OAuth credentials and refresh tokens remain encrypted in the control plane; agents receive only a short-lived, run-scoped MCP credential.
Google Cloud setup
Create or select a Google Cloud project, then configure an OAuth 2.0 Web application. Add the exact callback shown by Slab:
https://your-slab-host/api/integrations/google/callback
This is the workspace's shared Google callback for Gmail, Analytics, Search Console, and Google Calendar. A reused OAuth client only needs this one Slab redirect URI.
For Google Analytics, enable:
- Google Analytics Data API
- Google Analytics Admin API
For Search Console, enable:
- Search Console API
If the OAuth consent screen is in testing mode, add every Google account that will connect Slab as a test user. The connecting account must already have access to the relevant GA4 properties or Search Console sites.
Connect and assign
- Open Integrations.
- Choose Google Analytics or Google Search Console.
- Enter the OAuth client ID and secret.
- Copy the displayed callback into the Google OAuth application.
- Select the tools each agent may use and save.
- Choose Connect Google and complete consent.
- Use Test from the active integration row.
Changes to assignments or integration configuration apply to the next run. An active run keeps the exact integration version and tool allowlist captured when it started.
Agent tools
Google Analytics:
google_analytics_list_propertiesgoogle_analytics_search_metadatagoogle_analytics_run_reportgoogle_analytics_run_realtime_report
Search Console:
search_console_list_sitessearch_console_query_performancesearch_console_list_sitemapssearch_console_inspect_url
All eight tools explicitly declare read-only, non-destructive, idempotent, and open-world MCP annotations. Queries have timeouts, response limits, concurrency limits, and bounded row counts.
Security model
- OAuth uses authorization code flow with PKCE and a single-use state.
- Only
analytics.readonlyorwebmasters.readonlyis requested, plus OpenID email solely to identify the connected account. - Client secrets, access tokens, and refresh tokens are encrypted server-side.
- Secrets are not returned by integration APIs or placed in prompts, run events, tool schemas, profiling, or capability snapshots.
- The MCP endpoint authenticates a random run credential stored only as a hash, verifies the run is active, and enforces the captured tool allowlist.
- Configuration version changes invalidate the old run capability instead of silently serving a new definition.