Google Cloud Platform MCP server

Integrates with Google Cloud Platform services, providing tools for interacting with Compute Engine, Cloud Storage, Cloud Functions, Cloud Run, BigQuery, and more using official client libraries and robust error handling.
Back to servers
Provider
Oluwapelumi Oluwaseyi
Release date
Mar 06, 2025
Language
TypeScript
Package
Stats
1.3K downloads
66 stars

This MCP server enables AI assistants like Claude to interact with your Google Cloud Platform environment through natural language, allowing you to query and manage GCP resources during conversations without exposing your credentials to external services.

Prerequisites

  • Node.js
  • Claude Desktop, Cursor, or Windsurf
  • GCP credentials configured locally (application default credentials)

Installation

Install the MCP server using npm:

npx -y gcp-mcp

Alternatively, clone and install from source:

git clone https://github.com/eniayomi/gcp-mcp
cd gcp-mcp
npm install

Configuration

Claude Desktop

  1. Open Claude desktop app and go to Settings -> Developer -> Edit Config
  2. Add the following entry to your claude_desktop_config.json:
{
  "mcpServers": {
    "gcp": {
      "command": "sh",
      "args": ["-c", "npx -y gcp-mcp"]
    }
  }
}

If you installed from source:

{
  "mcpServers": {
    "gcp": {
      "command": "npm",
      "args": [
        "--silent",
        "--prefix",
        "/path/to/gcp-mcp",
        "start"
      ]
    }
  }
}

Replace /path/to/gcp-mcp with the actual path to your project directory.

Cursor

  1. Open Cursor and go to Settings (⌘,)
  2. Navigate to AI -> Model Context Protocol
  3. Add a new MCP configuration:
{
  "gcp": {
    "command": "npx -y gcp-mcp"
  }
}

Windsurf

  1. Open ~/.windsurf/config.json (create if it doesn't exist)
  2. Add the MCP configuration:
{
  "mcpServers": {
    "gcp": {
      "command": "npx -y gcp-mcp"
    }
  }
}

GCP Setup

  1. Set up application default credentials:
gcloud auth application-default login
  1. Refresh your AI assistant (Claude Desktop/Cursor/Windsurf)

Usage Examples

Start by selecting a project or asking questions in natural language:

  • "List all GCP projects I have access to"
  • "Show me all Cloud SQL instances in project X"
  • "What's my current billing status?"
  • "Show me the logs from my Cloud Run services"
  • "List all GKE clusters in us-central1"
  • "Show me all Cloud Storage buckets in project X"
  • "What Cloud Functions are deployed in us-central1?"

Available Tools

The MCP server provides several tools:

  • run-gcp-code: Execute GCP API calls using TypeScript code
  • list-projects: List all accessible GCP projects
  • select-project: Select a GCP project for subsequent operations
  • get-billing-info: Get billing information for the current project
  • get-cost-forecast: Get cost forecast for the current project
  • get-billing-budget: Get billing budgets for the current project
  • list-gke-clusters: List all GKE clusters in the current project
  • list-sql-instances: List all Cloud SQL instances in the current project
  • get-logs: Get Cloud Logging entries for the current project

Sample Interactions

  1. List available projects:

    List all GCP projects I have access to
    
  2. Select a project:

    Use project my-project-id
    
  3. Check billing status:

    What's my current billing status?
    
  4. View logs:

    Show me the last 10 log entries from my project
    

Troubleshooting

To view logs for diagnosing issues:

tail -n 50 -f ~/Library/Logs/Claude/mcp-server-gcp.log

Common Issues

  • Authentication errors: Ensure you've run gcloud auth application-default login
  • Permission errors: Check IAM roles for your account
  • API errors: Verify that required APIs are enabled in your project

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