Google Cloud MCP Server

Google Cloud MCP Server

A Model Context Protocol server that connects to Google Cloud services, allowing users to query logs, interact with Spanner databases, and analyze Cloud Monitoring metrics through natural language interaction.

krzko

Cloud Platforms
Visit Server

README

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 services:

  • [x] Google Cloud Logging
  • [x] Google Cloud Monitoring
  • [x] Google Cloud Spanner

Servers in development:

  • [ ] Google Cloud Trace
  • [ ] Google IAM
  • [ ] Google Cloud Compute
  • [ ] Google Cloud Run
  • [ ] Google Cloud Storage

Google Cloud Logging

Query and filter log entries from Google Cloud Logging:

  • Query logs with custom filters
  • Search logs within specific time ranges
  • Format and display log entries in a readable format

Google Cloud Spanner

Interact with Google Cloud Spanner databases:

  • Execute SQL queries against Spanner databases
  • List available databases and tables
  • Explore database schema

Google Cloud Monitoring

Retrieve and analyse metrics from Google Cloud Monitoring:

  • Query metrics with custom filters
  • Visualise metric data over time
  • List available metric types

Google Cloud Trace

Analyse distributed traces from Google Cloud Trace:

  • Retrieve traces by ID
  • List recent traces with filtering options
  • Find traces associated with logs
  • Identify failed traces
  • Use natural language to query traces (e.g., "Show me failed traces from the last hour")

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/krzko/google-cloud-mcp.git
cd google-cloud-mcp

# Install dependencies
pnpm install

# Build
pnpm build

Authenticate to Google Cloud:

gcloud auth application-default login

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

Using with Smithery (soon)

This server can be deployed and used with Smithery. The server implements lazy loading of authentication, which means it will start immediately and defer authentication until it's actually needed. Authentication is still required for operation, but this approach prevents timeouts during server initialization.

NOTE: Smithery local server support is currently in development and may not yet available.

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

Recommended Servers

contentful-mcp

contentful-mcp

Update, create, delete content, content-models and assets in your Contentful Space

Featured
TypeScript
Supabase MCP Server

Supabase MCP Server

A Model Context Protocol (MCP) server that provides programmatic access to the Supabase Management API. This server allows AI models and other clients to manage Supabase projects and organizations through a standardized interface.

Featured
JavaScript
Azure MCP Server

Azure MCP Server

Enables natural language interaction with Azure services through Claude Desktop, supporting resource management, subscription handling, and tenant selection with secure authentication.

Official
Local
TypeScript
SettleMint

SettleMint

Leverage SettleMint's Model Context Protocol server to seamlessly interact with enterprise blockchain infrastructure. Build, deploy, and manage smart contracts through AI-powered assistants, streamlining your blockchain development workflow for maximum efficiency.

Official
Local
TypeScript
Brev

Brev

Run, build, train, and deploy ML models on the cloud.

Official
Local
Python
Story SDK MCP Server

Story SDK MCP Server

This server provides MCP (Model Context Protocol) tools for interacting with Story's Python SDK. Features Get license terms Mint and register IP Asset with PIL Terms Mint license tokens Send $IP to a wallet Upload image to ipfs via Pinata [External] Upload ip and nft metadata via Pinata [External]

Official
Python
Tembo MCP Server

Tembo MCP Server

An MCP server that enables Claude to interact with Tembo Cloud platform API, allowing users to manage Tembo Cloud resources through natural language.

Official
TypeScript
Workers MCP

Workers MCP

A package that connects Claude Desktop and other MCP clients to Cloudflare Workers, enabling custom functionality to be accessed via natural language through the Model Context Protocol.

Official
TypeScript
Appwrite MCP Server

Appwrite MCP Server

A Model Context Protocol server that allows AI assistants to interact with Appwrite's API, providing tools to manage databases, users, functions, teams, and other resources within Appwrite projects.

Official
Python
MCP2Lambda

MCP2Lambda

Enables AI models to interact with AWS Lambda functions via the MCP protocol, allowing access to private resources, real-time data, and custom computation in a secure environment.

Official
Python