Skip to main content
Glama

Google Cloud & GA4 MCP Server

A full-featured Model Context Protocol (MCP) server for managing Google Cloud Platform resources and pulling Google Analytics 4 (GA4) data. This server allows AI agents (like Claude Desktop or Antigravity) to seamlessly interface with your GCP projects and web analytics.

Features

This server exposes 33 powerful tools across 4 domains:

1. πŸ“Š Google Analytics 4 (GA4)

Pull comprehensive web analytics for configured sites without leaving your AI environment.

  • ga4_discover_properties: Probe GA4 property IDs to verify access and metadata.

  • ga4_list_configured_sites: Show current site-to-property mappings.

  • ga4_set_site_property: Save a property ID for a specific site.

  • ga4_audience_overview: Get users, sessions, pageviews, bounce rate, and engagement.

  • ga4_top_pages: View the highest traffic pages for a site.

  • ga4_traffic_sources: Break down traffic by channel (organic, direct, referral, etc.).

  • ga4_traffic_over_time: View trends over days, weeks, or months.

  • ga4_device_breakdown: Compare desktop, mobile, and tablet usage.

  • ga4_geo_breakdown: See traffic distributed by country and city.

  • ga4_realtime_users: Check live active users on the site right now.

  • ga4_compare_all_sites: Get a quick side-by-side comparison of all configured sites.

  • ga4_run_custom_report: Run custom queries using any dimensions and metrics.

2. πŸ—οΈ GCP Projects Management

  • gcp_list_projects, gcp_get_project

  • gcp_create_project, gcp_update_project, gcp_delete_project

  • gcp_get_operation

3. πŸ” Identity and Access Management (IAM)

  • Service Accounts: gcp_list_service_accounts, gcp_create_service_account, gcp_delete_service_account, gcp_enable_service_account, gcp_disable_service_account, gcp_list_service_account_keys

  • IAM Policies: gcp_get_project_iam_policy, gcp_add_project_iam_binding, gcp_remove_project_iam_binding, gcp_list_roles

4. βš™οΈ GCP Service APIs

  • gcp_list_apis, gcp_enable_apis, gcp_disable_api, gcp_get_api, gcp_get_api_operation


Related MCP server: GCP MCP Server

Configuration

1. Service Account Authentication

This server uses a Google Cloud Service Account for authentication.

  1. Create a service account in GCP and download the JSON key file.

  2. Ensure the service account has the necessary GCP IAM roles (e.g., Project Creator, Security Admin, etc. depending on which tools you use).

  3. To use GA4 tools, you must also add the service account email as a Viewer inside your GA4 property's Property access management settings.

  4. Set the path to your JSON key file using the GOOGLE_APPLICATION_CREDENTIALS environment variable when running the server.

2. GA4 Sites Configuration

Your site property IDs are stored in sites.config.json in the root of this project. Currently configured for:

  • crossroadworks.com

  • alliesprettylittletreats.com

  • dooratl.church

You can update these mappings at any time via the AI using the ga4_set_site_property tool or by editing the JSON file manually.


Installation & Setup

  1. Clone the repository:

    git clone https://github.com/natekpurcella-hue/gcp-mcp.git
    cd gcp-mcp
  2. Install dependencies:

    npm install
  3. Build the server:

    npm run build

Connecting to an MCP Client

To use this server with an MCP client (such as Claude Desktop, Cursor, or Antigravity), add it to your client's configuration file.

Claude Desktop

For macOS/Linux, edit ~/Library/Application Support/Claude/claude_desktop_config.json (or the equivalent path for your OS):

{
  "mcpServers": {
    "gcp-mcp": {
      "command": "node",
      "args": [
        "/absolute/path/to/gcp-mcp/dist/index.js"
      ],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/absolute/path/to/your/service-account-key.json"
      }
    }
  }
}

Cursor

  1. Open Cursor Settings > Features > MCP.

  2. Click Add New MCP Server.

  3. Choose command and enter: node /absolute/path/to/gcp-mcp/dist/index.js

  4. Make sure your GOOGLE_APPLICATION_CREDENTIALS environment variable is available to Cursor.

Antigravity

Edit ~/.gemini/antigravity-cli/mcp.json:

{
  "mcpServers": {
    "gcp-mcp": {
      "command": "node",
      "args": [
        "/absolute/path/to/gcp-mcp/dist/index.js"
      ],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "/absolute/path/to/your/service-account-key.json"
      }
    }
  }
}

Restart your MCP client, and your AI assistant will instantly have access to all GCP and Analytics capabilities!

Available Tools

33 tools
ga4_audience_overviewB

Get high-level audience metrics for a site: total users, new users, sessions, page views, bounce rate, avg session duration, engagement rate.

Inputs: site (required), endDate, startDate.

ga4_compare_all_sitesA

Get audience overview metrics for ALL three configured sites at once for a quick side-by-side comparison. Sites: crossroadworks.com, alliesprettylittletreats.com, dooratl.church.

Inputs: endDate, startDate.

ga4_device_breakdownB

Break down users by device type (desktop, mobile, tablet) and operating system.

Inputs: site (required), endDate, startDate.

ga4_discover_propertiesA

Probe GA4 property IDs to verify access and retrieve property metadata. Pass known property IDs as candidatePropertyIds (find them in GA4 β†’ Admin β†’ Property Settings). Also probes any IDs already saved in sites.config.json.

Inputs: candidatePropertyIds.

ga4_geo_breakdownC

Show top countries and cities by users for a site.

Inputs: site (required), limit, endDate, startDate.

ga4_list_configured_sitesA

Show the configured sites and their GA4 property IDs from sites.config.json.

Inputs: no named parameters.

ga4_realtime_usersA

Get real-time active users on a site right now (last 30 minutes), broken down by page.

Inputs: site (required).

ga4_run_custom_reportA

Run a fully custom GA4 report with any dimensions and metrics. See https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema for all available names.

Inputs: site (required), endDate (required), metrics (required), startDate (required), +3 more.

ga4_set_site_propertyA

Save a GA4 property ID for a named site. Call this after ga4_discover_properties to link crossroadworks.com, alliesprettylittletreats.com, or dooratl.church to their property IDs.

Inputs: site (required), propertyId (required).

ga4_top_pagesB

Get the top pages by views for a site, with users, avg duration, and bounce rate.

Inputs: site (required), limit, endDate, startDate.

ga4_traffic_over_timeA

Get daily, weekly, or monthly traffic trend (users, sessions, page views) for a site.

Inputs: site (required), endDate, dimension, startDate.

ga4_traffic_sourcesA

Break down where traffic is coming from: organic search, direct, referral, social, email, etc.

Inputs: site (required), endDate, startDate.

gcp_add_project_iam_bindingA

Grant an IAM role to a member on a GCP project. member format: 'user:email', 'serviceAccount:email', 'group:email', 'domain:domain'. role format: 'roles/editor', 'roles/viewer', 'roles/iam.serviceAccountUser', etc.

Inputs: role (required), member (required), projectId (required).

gcp_create_projectA

Create a new GCP project. Returns a long-running operation name. Use gcp_get_operation to poll for completion.

Inputs: projectId (required), displayName (required), labels, parentId.

gcp_create_service_accountC

Create a new service account in a GCP project.

Inputs: accountId (required), projectId (required), description, displayName.

gcp_delete_projectA

Move a GCP project to DELETE_REQUESTED state. The project is recoverable for 30 days.

Inputs: projectId (required).

gcp_delete_service_accountB

Permanently delete a service account.

Inputs: projectId (required), serviceAccountEmail (required).

gcp_disable_apiB

Disable a GCP API on a project.

Inputs: projectId (required), serviceName (required).

gcp_disable_service_accountA

Disable a service account (credentials will stop working until re-enabled).

Inputs: projectId (required), serviceAccountEmail (required).

gcp_enable_apisA

Enable one or more GCP APIs on a project. Returns an operation name to poll. Common APIs: compute.googleapis.com, run.googleapis.com, container.googleapis.com, storage.googleapis.com, cloudfunctions.googleapis.com, iam.googleapis.com, cloudbuild.googleapis.com, secretmanager.googleapis.com

Inputs: projectId (required), serviceIds (required).

gcp_enable_service_accountB

Enable a previously disabled service account.

Inputs: projectId (required), serviceAccountEmail (required).

gcp_get_apiB

Get the enabled/disabled state of a specific API on a project.

Inputs: projectId (required), serviceName (required).

gcp_get_api_operationA

Check the status of a long-running API enable/disable operation.

Inputs: operationName (required).

gcp_get_operationA

Check the status of a long-running GCP operation (from project creation, etc.).

Inputs: operationName (required).

gcp_get_projectB

Get details for a specific GCP project by project ID.

Inputs: projectId (required).

gcp_get_project_iam_policyA

Get the current IAM policy for a GCP project (shows all role bindings).

Inputs: projectId (required).

gcp_list_apisA

List APIs/services on a GCP project. Use filter='state:ENABLED' to see only enabled APIs.

Inputs: projectId (required), filter, pageSize.

gcp_list_projectsA

List all GCP projects accessible by the configured service account. Use filter='state:ACTIVE' to see only active projects.

Inputs: filter, pageSize.

gcp_list_rolesA

List available GCP IAM roles. Use filter to narrow results (e.g. 'storage' to find storage roles).

Inputs: filter, pageSize.

gcp_list_service_account_keysB

List all keys for a service account.

Inputs: projectId (required), serviceAccountEmail (required).

gcp_list_service_accountsA

List all service accounts in a GCP project.

Inputs: projectId (required).

gcp_remove_project_iam_bindingB

Remove an IAM role from a member on a GCP project.

Inputs: role (required), member (required), projectId (required).

gcp_update_projectB

Update a GCP project's display name or labels.

Inputs: projectId (required), labels, displayName.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 33 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose, covering GCP project management, IAM, service accounts, API operations, and GA4 analytics without overlap.

    Naming Consistency5/5

    Tools follow consistent patterns: gcp_verb_noun for GCP operations and ga4_verb_noun for GA4 analytics, with no mixing of conventions.

    Tool Count4/5

    33 tools is on the higher side but acceptable given the dual GCP and GA4 domains. The tool count is proportionate to the breadth of features.

    Completeness4/5

    Covers core GCP resources and a wide range of GA4 reports. Missing a few operations like updating service accounts or managing GA4 properties, but overall comprehensive.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      Enables managing Google Cloud Platform resources through natural language commands in Claude Desktop, supporting comprehensive operations across compute, storage, databases, networking, monitoring, and IAM without manual credential setup.
      56
      20
      -
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to interact with and manage Google Cloud Platform resources including Compute Engine, Cloud Run, Storage, BigQuery, and other GCP services through a standardized MCP interface.
      1
      6
      MIT
    • A
      license
      C
      quality
      D
      maintenance
      Enables AI assistants to interact with Google Cloud Platform resources through natural language queries. Supports querying and managing GCP services like Compute Engine, Cloud Storage, BigQuery, and more across multiple projects and regions.
      9
      1,773 npm
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables managing Google Cloud Platform infrastructure through natural language, including VM deployment, SSH key management, remote command execution, and Terraform infrastructure-as-code operations.
      2
      -