Skip to main content
Glama
Google Cloud MCP Server

Google Cloud MCP Server

by iamishaan24

Google Cloud MCP Server

A Model Context Protocol server that connects to Google Cloud services to provide context and tools for interacting with your Google Cloud resources.

Services

Supported Google Cloud services:

Billing

Manage and analyse Google Cloud billing with cost optimisation insights:

Tools: gcp-billing-list-accounts, gcp-billing-get-account-details, gcp-billing-list-projects, gcp-billing-get-project-info, gcp-billing-list-services, gcp-billing-list-skus, gcp-billing-analyse-costs, gcp-billing-detect-anomalies, gcp-billing-cost-recommendations, gcp-billing-service-breakdown

Example prompts:

  • "Show me all my billing accounts"

  • "Analyse costs for project my-app-prod-123 for the last 30 days"

  • "Generate cost recommendations for billing account billingAccounts/123456-789ABC-DEF012"

  • "Check for billing anomalies in project my-ecommerce-456"

Error Reporting

Monitor and analyse application errors with automated investigation and remediation suggestions:

Tools: gcp-error-reporting-list-groups, gcp-error-reporting-get-group-details, gcp-error-reporting-analyse-trends

Example prompts:

  • "Show me error groups from project my-webapp-prod-789 for the last hour"

  • "Get details for error group projects/my-app-123/groups/xyz789"

  • "Analyse error trends for service my-api in project analytics-prod-456"

IAM

Query and analyse IAM policies and permissions:

Tools: gcp-iam-get-project-policy, gcp-iam-test-project-permissions, gcp-iam-test-resource-permissions, gcp-iam-validate-deployment-permissions, gcp-iam-list-deployment-services, gcp-iam-analyse-permission-gaps

Example prompts:

  • "Get IAM policy for project my-webapp-prod-123"

  • "Test if I have storage.buckets.create permission on project data-lake-456"

  • "Check deployment permissions for Cloud Run in project microservices-789"

  • "Analyse permission gaps for deploying to GKE cluster in project k8s-prod-321"

Logging

Query and filter log entries from Google Cloud Logging:

Tools: gcp-logging-query-logs, gcp-logging-query-time-range, gcp-logging-search-comprehensive

Example prompts:

  • "Show me logs from project my-app-prod-123 from the last hour with severity ERROR"

  • "Search for logs containing 'timeout' from service my-api in project backend-456"

  • "Query logs for resource type gce_instance in project compute-prod-789"

Spanner

Interact with Google Cloud Spanner databases:

Tools: gcp-spanner-execute-query, gcp-spanner-list-tables, gcp-spanner-list-instances, gcp-spanner-list-databases, gcp-spanner-query-natural-language, gcp-spanner-query-count

Example prompts:

  • "List all databases in Spanner instance my-instance in project ecommerce-prod-123"

  • "Execute SQL: SELECT COUNT(*) FROM users in database user-db in project my-app-456"

  • "Show me table structure for orders in database inventory-db in project retail-789"

Monitoring

Retrieve and analyse metrics from Google Cloud Monitoring:

Tools: gcp-monitoring-query-metrics, gcp-monitoring-list-metric-types, gcp-monitoring-query-natural-language

Example prompts:

  • "Show me CPU utilisation metrics for project web-app-prod-123 for the last 6 hours"

  • "List available metric types for Compute Engine in project infrastructure-456"

  • "Query memory usage for instances in project backend-services-789"

Profiler

Analyse application performance with Google Cloud Profiler:

Tools: gcp-profiler-list-profiles, gcp-profiler-analyse-performance, gcp-profiler-compare-trends

Example prompts:

  • "List CPU profiles from project my-java-app-123 for the last 24 hours"

  • "Analyse performance bottlenecks in service my-api in project backend-prod-456"

  • "Compare heap profiles for deployment v1.2 vs v1.3 in project performance-test-789"

Trace

Analyse distributed traces from Google Cloud Trace:

Tools: gcp-trace-get-trace, gcp-trace-list-traces, gcp-trace-find-from-logs, gcp-trace-query-natural-language

Example prompts:

  • "Get trace details for ID abc123def456 in project distributed-app-789"

  • "Show me failed traces from project microservices-prod-123 from the last hour"

  • "Find logs related to trace xyz789 in project web-backend-456"

  • "Query traces for service checkout-api in project ecommerce-prod-321"

Compute

Manage Compute Engine VM instances and deploy simple static HTML websites using startup scripts.

Tools: gcp-compute-list-instances, gcp-compute-create-instance, gcp-compute-delete-instance, gcp-compute-start-instance, gcp-compute-stop-instance, get-compute-vm-status, get-compute-vm-ip, deploy-static-html-site

Example prompts:

  • "Deploy a static HTML site in project my-site-123 in zone us-central1-a using VM name site-vm and serve <h1>Hello</h1>; return the public URL."

  • "Check VM status for site-vm in us-central1-a until it is RUNNING."

  • "Get the public HTTP URL for site-vm in us-central1-a."

Note: The deploy-static-html-site tool creates an e2-micro Debian 12 VM with an external IP and an nginx-based startup script; the HTML content is embedded (base64-encoded) in the startup script and written to /var/www/html/index.html. This flow requires no SSH or file uploads.

Related MCP server: GCP MCP

Quick Start

Once configured, you can interact with Google Cloud services using natural language:

"What are my current billing costs for project my-webapp-prod-123?"
"Show me errors from project ecommerce-api-456 in the last hour"
"Check if I have permission to deploy to Cloud Run in project microservices-789"
"Find logs containing 'database timeout' from project backend-prod-321 yesterday"
"List Spanner databases in instance prod-db for project data-store-654"
"What's the CPU usage of Compute Engine instances in project infrastructure-987?"

Authentication

This server supports two methods of authentication with Google Cloud:

  1. Service Account Key File (Recommended): Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your service account key file. This is the standard Google Cloud authentication method.

  2. Environment Variables: Set GOOGLE_CLIENT_EMAIL and GOOGLE_PRIVATE_KEY environment variables directly. This is useful for environments where storing a key file is not practical.

The server will also use the GOOGLE_CLOUD_PROJECT environment variable if set, otherwise it will attempt to determine the project ID from the authentication credentials.

Installation

# Clone the repository
git clone https://github.com/iamishaan24/gcp-mcp-server.git
cd google-cloud-mcp

# Install dependencies
pnpm install

# Build
pnpm build

Authenticate to Google Cloud:

gcloud auth application-default login

To create service account key:

gcloud config set project YOUR_PROJECT_ID

gcloud iam service-accounts create mcp-service-account \
  --display-name="MCP Service Account"

gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
  --member="serviceAccount:mcp-service-account@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
  --role="roles/viewer"

gcloud iam service-accounts keys create mcp-key.json \
  --iam-account=mcp-service-account@YOUR_PROJECT_ID.iam.gserviceaccount.com

To use the key

Linux/mac

export GOOGLE_APPLICATION_CREDENTIALS="/path/to/mcp-key.json"

powershell

$env:GOOGLE_APPLICATION_CREDENTIALS="D:\path\to\mcp-key.json"

Configuration

Configure the mcpServers in your client:

{
  "mcpServers": {
      "google-cloud-mcp": {
          "command": "node",
          "args": [
              "/Users/foo/code/google-cloud-mcp/dist/index.js"
          ],
          "env": {
              "GOOGLE_APPLICATION_CREDENTIALS": "/Users/foo/.config/gcloud/application_default_credentials.json"
          }
      }
  }
}

Development

Starting the server

# Build the project
pnpm build

# Start the server
pnpm start

Development mode

# Build the project
pnpm build

# Start the server and inspector
npx -y @modelcontextprotocol/inspector node dist/index.js

Troubleshooting

Server Timeout Issues

If you encounter timeout issues when running the server with Smithery, try the following:

  1. Enable debug logging by setting debug: true in your configuration

  2. Ensure lazyAuth: true is set to defer authentication until it's actually needed

  3. Ensure your credentials file is accessible and valid

  4. Check the logs for any error messages

Important: Authentication is still required for operation, but with lazy loading enabled, the server will start immediately and authenticate when needed rather than during initialization.

Authentication Issues

The server supports two methods of authentication:

  1. Service Account Key File: Set GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your service account key file

  2. Environment Variables: Set GOOGLE_CLIENT_EMAIL and GOOGLE_PRIVATE_KEY environment variables

If you're having authentication issues, make sure:

  • Your service account has the necessary permissions

  • The key file is properly formatted and accessible

  • Environment variables are correctly set

Available Tools

56 tools
create-static-site-bucketCreate Static Site BucketB

Create a Cloud Storage bucket configured for static site hosting (uniform bucket-level access).

Inputs: bucketName (required), location, projectId.

delete-static-site-bucketDelete Storage BucketA

Delete a Cloud Storage bucket (must be empty).

Inputs: bucketName (required).

deploy-static-html-siteDeploy Static HTML SiteB

Create a VM with a startup script that installs nginx and writes provided HTML to /var/www/html/index.html

Inputs: zone (required), vmName (required), htmlContent (required), projectId.

deploy-static-site-from-htmlDeploy Static Site from HTMLB

Create a bucket, upload HTML, and provision a VM that serves the bucket content via nginx.

Inputs: zone (required), vmName (required), bucketName (required), htmlContent (required), +1 more.

gcp-billing-analyse-costsAnalyse Billing CostsC

Perform detailed cost analysis with trends and insights for Google Cloud billing data

Inputs: endDate (required), startDate (required), billingAccountName (required), groupBy, +2 more.

gcp-billing-cost-recommendationsGenerate Cost RecommendationsB

Generate cost optimisation recommendations with potential savings for Google Cloud billing

Inputs: billingAccountName (required), priority, projectId, minSavingsAmount.

gcp-billing-detect-anomaliesDetect Cost AnomaliesC

Detect unusual cost patterns and spending anomalies in Google Cloud billing data

Inputs: billingAccountName (required), projectId, lookbackDays, thresholdPercentage.

gcp-billing-get-account-detailsGet Billing Account DetailsA

Retrieve detailed information about a specific Google Cloud billing account

Inputs: billingAccountName (required).

gcp-billing-get-project-infoGet Project Billing InformationA

Retrieve billing configuration and status for a Google Cloud project

Inputs: projectId.

gcp-billing-list-accountsList Billing AccountsA

List all Google Cloud billing accounts accessible to the user

Inputs: filter, pageSize, pageToken.

gcp-billing-list-projectsList Billing Account ProjectsA

List all projects associated with a specific Google Cloud billing account

Inputs: billingAccountName (required), pageSize, pageToken.

gcp-billing-list-servicesList Google Cloud ServicesB

List all available Google Cloud services for billing and cost analysis

Inputs: pageSize, pageToken.

gcp-billing-list-skusList Service SKUsB

List all SKUs (Stock Keeping Units) and pricing information for a Google Cloud service

Inputs: serviceId (required), pageSize, pageToken, currencyCode.

gcp-billing-service-breakdownGet Service Cost BreakdownC

Get detailed cost breakdown by Google Cloud service with usage and SKU information

Inputs: billingAccountName (required), projectId, timeRange.

gcp-compute-create-instanceCreate Compute InstanceA

Create a Compute Engine VM instance with simple parameters

Inputs: name (required), zone (required), image, network, +2 more.

gcp-compute-delete-instanceDelete Compute InstanceA

Delete a Compute Engine VM instance by name and zone

Inputs: name (required), zone (required).

gcp-compute-get-instance-ipGet Instance IP and SSH CommandB

Fetch external IP(s) for a VM and provide suggested SSH commands

Inputs: name (required), zone (required).

gcp-compute-list-instancesList Compute InstancesA

List Compute Engine VM instances across the project or within a zone

Inputs: zone, filter, pageSize.

gcp-compute-start-instanceStart Compute InstanceB

Start a stopped Compute Engine VM instance

Inputs: name (required), zone (required).

gcp-compute-stop-instanceStop Compute InstanceB

Stop a running Compute Engine VM instance

Inputs: name (required), zone (required).

gcp-error-reporting-get-group-detailsD

Inputs: no named parameters.

gcp-error-reporting-list-groupsD

Inputs: no named parameters.

gcp-iam-analyse-permission-gapsAnalyse Permission GapsC

Compare current permissions against required permissions for specific operations and identify gaps

Inputs: requiredPermissions (required), project, operationDescription.

gcp-iam-get-project-policyGet Project IAM PolicyB

Retrieve the IAM policy for a Google Cloud project

Inputs: project, requestedPolicyVersion.

gcp-iam-list-deployment-servicesList Available Deployment ServicesB

List all GCP services with pre-defined deployment permission sets

Inputs: no named parameters.

gcp-iam-test-project-permissionsTest Project IAM PermissionsA

Test which permissions the current caller has on a Google Cloud project

Inputs: permissions (required), project.

gcp-iam-test-resource-permissionsTest Resource-Specific IAM PermissionsA

Test which permissions the current caller has on specific Google Cloud resources

Inputs: resource (required), permissions (required).

gcp-iam-validate-deployment-permissionsValidate Deployment PermissionsA

Check if current caller has required permissions for deploying to common GCP services

Inputs: service (required), project, includeOptional.

gcp-list-project-idsList Project IDsB

List all accessible Google Cloud project IDs

Inputs: filter, pageSize.

gcp-logging-query-logsQuery LogsB

Query Google Cloud Logs with custom filters. Searches across all payload types (text, JSON, proto) and metadata fields.

Inputs: filter (required), limit.

gcp-logging-query-time-rangeQuery Logs by Time RangeA

Query Google Cloud Logs within a specific time range. Supports relative times (1h, 2d) and ISO timestamps.

Inputs: startTime (required), limit, filter, endTime.

gcp-logging-search-comprehensiveComprehensive Log SearchC

Search across all log fields including textPayload, jsonPayload, protoPayload, labels, HTTP requests, and metadata. Provides maximum context.

Inputs: searchTerm (required), limit, resource, severity, +1 more.

gcp-monitoring-list-metric-typesD

Inputs: filter, timeout, pageSize.

gcp-monitoring-query-metricsD

Inputs: filter (required), startTime (required), endTime, alignmentPeriod.

gcp-monitoring-query-natural-languageD

Inputs: query (required), endTime, startTime, alignmentPeriod.

gcp-profiler-analyse-performanceD

Inputs: no named parameters.

gcp-profiler-list-profilesD

Inputs: no named parameters.

gcp-spanner-execute-queryD

Inputs: sql (required), params, databaseId, instanceId.

gcp-spanner-list-databasesD

Inputs: instanceId (required).

gcp-spanner-list-instancesD

Inputs: _dummy.

gcp-spanner-list-tablesD

Inputs: databaseId, instanceId.

gcp-spanner-query-countD

Inputs: status, endTime, queryType, startTime, +3 more.

gcp-spanner-query-natural-languageD

Inputs: query (required), databaseId, instanceId.

gcp-trace-find-from-logsD

Inputs: filter (required), limit, projectId.

gcp-trace-get-traceD

Inputs: traceId (required), projectId.

gcp-trace-list-tracesD

Inputs: limit, filter, projectId, startTime.

gcp-trace-query-natural-languageD

Inputs: query (required), projectId.

gcp-utils-get-project-idGet Project IDA

Get the current Google Cloud project ID and recent project history

Inputs: no named parameters.

gcp-utils-set-project-idSet Project IDB

Set the default Google Cloud project ID to use for all operations

Inputs: project_id (required).

generate_gcp_mermaid_diagramGenerate GCP Mermaid DiagramA

Generate a Mermaid architecture diagram for a GCP project

Inputs: projectId (required).

get-compute-vm-ipGet Compute VM IPB

Fetch the external IP of a VM and return an http URL

Inputs: zone (required), vmName (required), projectId.

get-compute-vm-statusGet Compute VM StatusB

Retrieve the status of a Compute Engine VM instance

Inputs: zone (required), vmName (required), projectId.

list-static-site-bucketsList Storage BucketsB

List Cloud Storage buckets in the project.

Inputs: projectId.

upload-static-site-htmlUpload Static Site HTMLB

Upload an HTML file to Cloud Storage and make it publicly readable.

Inputs: bucketName (required), htmlContent (required), fileName.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2/5.0

    Scored across 56 tools

    Disambiguation1/5

    Multiple tools appear to do the same thing: gcp-compute-get-instance-ip vs get-compute-vm-ip, gcp-logging-query-logs vs gcp-logging-search-comprehensive, deploy-static-html-site vs deploy-static-site-from-html, plus several natural-language query variants for Spanner, Monitoring, and Trace. Many tools have no descriptions at all, making boundaries impossible to distinguish reliably.

    Naming Consistency3/5

    Most tools follow a readable gcp-service-verb-noun pattern, which helps navigation. However, the pattern is broken by unprefixed tools like deploy-static-html-site and get-compute-vm-ip, and by generate_gcp_mermaid_diagram using underscores. These are mixed conventions rather than complete chaos.

    Tool Count2/5

    56 tools is well above the 25+ threshold for a coherent toolkit. The count feels bloated because several tools could be consolidated, such as IP retrieval, logging queries, static-site deployment, and cost analysis variants.

    Completeness2/5

    The server covers a broad read-only observability and billing surface, plus basic compute and static-site workflows, but major GCP services like BigQuery, Cloud Run, GKE, and full Cloud Storage are missing. Even within covered services there are notable gaps: no IAM policy updates, no Spanner writes/DDL, no compute update, and no object-level static-site deletion.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      Enables interaction with Google Cloud services including billing cost analysis, log querying, and metrics monitoring through natural language commands. Provides comprehensive tools for managing GCP resources, analyzing costs, detecting anomalies, and retrieving operational insights.
      40
      1
      Apache 2.0
    • 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
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with Google Cloud Platform services through gcloud CLI commands via a Cloud Run deployed MCP server. Supports executing gcloud commands and managing GCP resources through natural language.
      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
      -