Skip to main content
Glama
HappyMonkeyAI

ai-google-analytics-mcp

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GA4_KEYMASTER_HINTSNoOptional: Enable keymaster hints (set to 'true').
GA4_DEFAULT_ACCOUNT_IDNoDefault Google Analytics account ID to use when not specified.
GA4_KEYMASTER_DATABASENoOptional: Path to keymaster database for status hints.
GA4_LAUNCHER_REGISTRY_JSONNoOptional: Read launcher registry.json for project integration.
GA4_LAUNCHER_REGISTRY_WRITABLENoOptional: Allow writing to launcher registry (set to 'true' to enable).
GOOGLE_APPLICATION_CREDENTIALSYesPath to the Google service account JSON key file for authentication.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_ga4_auth_setup_instructionsA

Return GCP/GA auth steps. Prefer service account if gcloud ADC shows 'This app is blocked'.

list_ga_account_summariesB

List GA account summaries and child properties (read-only Admin API).

provision_ga4_propertyC

Create a new GA4 property for a project under a GA account. account_id: numeric id only (e.g. 12345678) or accounts/12345678.

create_web_data_streamC

Create a web data stream for a GA4 property. Returns measurement_id (G-XXXXXXXX). property_id: numeric or properties/.

render_ga4_gtag_snippetA

Return HTML gtag snippet for a measurement ID.

inject_ga4_gtag_into_fileB

Inject or update GA4 gtag in a local HTML/layout file (absolute path recommended). Set dry_run=true to preview without writing.

render_ga4_nextjs_componentA

Return a Next.js client component (next/script) for GA4. mode: env (read NEXT_PUBLIC_GA_MEASUREMENT_ID) or inline (embed id). consent_gated: only load gtag after localStorage cookie consent is accepted.

scaffold_ga4_nextjs_trackingB

Scaffold GA4 for a Next.js app: write GoogleAnalytics.tsx, wire layout.tsx, and set NEXT_PUBLIC_GA_MEASUREMENT_ID in .env.local (when mode=env). web_root must be the Next.js package root (directory containing package.json).

save_project_ga4_configB

Write .ga4.config.json in a project root for agents and humans to reference later.

provision_project_ga4_setupA

End-to-end: create property + web stream, optionally save .ga4.config.json and inject gtag. If registry_slug is set and GA4_LAUNCHER_REGISTRY_* env is configured, syncs analytics.ga4 metadata.

get_ga4_integration_statusB

Report optional launcher registry and keymaster hook availability (graceful when unset).

list_registry_projects_for_ga4A

List launcher registry projects with .ga4.config.json and .keymaster hints when registry env is set.

resolve_project_for_ga4C

Resolve registry slug and/or filesystem path for GA4 provisioning (paths, website_url, agent hints).

sync_ga4_to_launcher_registryA

Write GA4 metadata to launcher registry project.analytics.ga4 (requires writable env).

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
workflow_resource

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HappyMonkeyAI/ai-google-analytics-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server