Google Cloud MCP server

Integrates with Google Cloud services to provide direct access to Logging, Spanner, and Monitoring resources within conversations through authenticated connections.
Back to servers
Provider
Kristof Kowalski
Release date
Mar 18, 2025
Language
TypeScript
Package
Stats
362 downloads
33 stars

The Google Cloud MCP Server provides a Model Context Protocol server that connects to Google Cloud services, allowing you to interact with your cloud resources through natural language. It supports Logging, Monitoring, and Spanner services, with more integrations in development.

Installation

You can set up the Google Cloud MCP server by following these steps:

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

# Install dependencies
pnpm install

# Build
pnpm build

Authentication

Before using the server, you need to authenticate with Google Cloud. The server supports two authentication methods:

Method 1: Service Account Key File (Recommended)

Authenticate using Google Cloud's CLI:

gcloud auth application-default login

Method 2: Environment Variables

Set the following environment variables directly:

  • GOOGLE_CLIENT_EMAIL
  • GOOGLE_PRIVATE_KEY

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

Configuration

Configure the MCP server in your client by adding it to your mcpServers configuration:

{
  "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"
          }
      }
  }
}

Supported Services

Google Cloud Logging

With this service, you can:

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

Google Cloud Monitoring

This service allows you to:

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

Google Cloud Spanner

Interact with Spanner databases to:

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

Troubleshooting

Server Timeout Issues

If you encounter timeout issues:

  • Enable debug logging by setting debug: true in your configuration
  • Ensure lazyAuth: true is set to defer authentication
  • Verify your credentials file is accessible and valid
  • Check the logs for error messages

Authentication Issues

If authentication fails, ensure:

  • Your service account has the necessary permissions
  • The key file is properly formatted and accessible
  • Environment variables are correctly set

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later