Google Cloud MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/nsachin08/gcpmcp
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS}" gcp-mcp -- python "<FULL_PATH_TO_GCPMCP>/dist/index.js"

Replace <FULL_PATH_TO_GCPMCP>/dist/index.js with the actual folder you prepared in step 1.

Required:GOOGLE_APPLICATION_CREDENTIALS
README.md

Interact with GKE to list clusters, manage node pools, and retrieve configs.

GKE Deployment Scripts Guide

This guide provides automated scripts to deploy sample applications to your GKE clusters for testing your GCP tools.

Google Cloud MCP Server

Current Suppported Tools: GKE

Prerequisites

Before running these scripts, you need:

  • Google Cloud SDK (gcloud) - For cluster authentication
  • kubectl - For Kubernetes operations
  • Two GKE Autopilot clusters:
    • autopilot-cluster-1 in us-central1
    • autopilot-cluster-2 in europe-west2

Installation Steps

Step 1: Install Google Cloud SDK

Windows (PowerShell)
# Run PowerShell as Administrator
.\setup-gcloud.ps1

Then initialize gcloud:

gcloud init
macOS/Linux (Bash)
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
gcloud init

Step 2: Install kubectl

gcloud components install kubectl

Step 3: Verify Installations

gcloud --version
kubectl version --client

Usage

Quick Start

Option A: PowerShell (Windows)
# Deploy applications to both clusters
.\deploy-apps.ps1 -ProjectId "your-project-id"

# Or use current gcloud project (if configured)
.\deploy-apps.ps1
Option B: Bash (Linux/macOS)
# Make scripts executable
chmod +x deploy-apps.sh cleanup-deployments.sh

# Deploy applications to both clusters
./deploy-apps.sh "your-project-id"

# Or use current gcloud project
./deploy-apps.sh

What Gets Deployed

Cluster 1 (us-central1)

  1. Nginx (3 replicas)

    • Default namespace
    • Service: LoadBalancer on port 80
  2. WordPress Stack

    • Namespace: wordpress
    • MySQL (1 replica) - Database
    • WordPress (2 replicas) - Web application
    • Services: LoadBalancer on port 80
  3. Monitoring Stack

    • Namespace: monitoring
    • Prometheus (1 replica) - Metrics collection
    • Grafana (1 replica) - Visualization
    • Services: LoadBalancer on ports 9090 & 3000

Cluster 2 (europe-west2)

Same applications deployed for comparison and multi-cluster testing.

Verification Commands

After deployment, monitor the applications:

# Watch all pods across both clusters
kubectl get pods --all-namespaces -w

# Get LoadBalancer external IPs
kubectl get services --all-namespaces

# Check pod distribution
kubectl get pods -o wide --all-namespaces

# View resource usage
kubectl top nodes
kubectl top pods --all-namespaces

# Check deployment replicas
kubectl get deployments --all-namespaces

# View events during deployment
kubectl get events --all-namespaces --sort-by='.lastTimestamp'

Testing Your GCP Tools

Once deployments are complete, test your GCP tools:

# List both clusters
py -c "import asyncio; from src.tools.gke import list_gke_clusters; asyncio.run(list_gke_clusters('-'))"

# Get cluster details
py -c "import asyncio; from src.tools.gke import get_gke_cluster; asyncio.run(get_gke_cluster('us-central1', 'autopilot-cluster-1'))"

# List node pools
py -c "import asyncio; from src.tools.gke import list_gke_node_pools; asyncio.run(list_gke_node_pools('us-central1', 'autopilot-cluster-1'))"

# Get node pool details
py -c "import asyncio; from src.tools.gke import get_gke_node_pool; asyncio.run(get_gke_node_pool('us-central1', 'autopilot-cluster-1', 'default-pool'))"

# Get server config
py -c "import asyncio; from src.tools.gke import get_gke_server_config; asyncio.run(get_gke_server_config('us-central1'))"

Cleanup

When you're done testing, remove all deployments:

PowerShell
.\cleanup-deployments.ps1
Bash
./cleanup-deployments.sh

The cleanup script will:

  • Delete all deployments
  • Delete all services
  • Remove custom namespaces (wordpress, monitoring)
  • Keep the clusters running for future use

Troubleshooting

Issue: "gcloud not found"

Solution: Install Google Cloud SDK (see Step 1 above)

Issue: "kubectl not found"

Solution: Install kubectl with gcloud components install kubectl

Issue: "Cluster credentials failed"

  • Verify cluster names spelling
  • Check you're in the correct Google Cloud project: gcloud config get-value project
  • Switch project: gcloud config set project YOUR_PROJECT_ID

Issue: "CreateContainerError" or "ImagePullBackOff"

  • Wait longer for pods to start (images are large)
  • Check pod logs: kubectl logs -n <namespace>
  • Check events: kubectl describe pod -n <namespace>

Issue: LoadBalancer IP stuck in "Pending"

  • This is normal for GKE. The IP will be assigned within a few seconds to a few minutes
  • Check status: kubectl get services --all-namespaces -w

Customization

To deploy different applications, modify the deployment scripts:

  1. Edit deploy-apps.ps1 or deploy-apps.sh
  2. Change image names, replicas, namespaces as needed
  3. Run the modified script

Example - Deploy a different image:

kubectl create deployment my-app --image=busybox:latest --replicas=2

File Structure

gcp

Tools (5)

list_gke_clustersLists all GKE clusters in the project.
get_gke_clusterRetrieves details for a specific GKE cluster.
list_gke_node_poolsLists node pools for a specific GKE cluster.
get_gke_node_poolRetrieves details for a specific node pool.
get_gke_server_configRetrieves the server configuration for a specific location.

Environment Variables

GOOGLE_APPLICATION_CREDENTIALSrequiredPath to your Google Cloud service account JSON key file.

Configuration

claude_desktop_config.json
{"mcpServers": {"gcp": {"command": "python", "args": ["path/to/gcpmcp/src/main.py"]}}}

Try it

List all GKE clusters in my current project.
Get the details for the cluster named autopilot-cluster-1 in us-central1.
Show me the node pools for autopilot-cluster-2 in europe-west2.
Retrieve the server configuration for the us-central1 region.

Frequently Asked Questions

What are the key features of Google Cloud MCP Server?

List and inspect GKE clusters. Manage and view GKE node pool configurations. Retrieve regional GKE server configurations. Automated deployment scripts for testing applications on GKE Autopilot.

What can I use Google Cloud MCP Server for?

Managing multi-cluster GKE environments via natural language. Automating the deployment of sample stacks like Nginx or WordPress for testing. Quickly auditing cluster and node pool configurations. Comparing cluster setups across different GCP regions.

How do I install Google Cloud MCP Server?

Install Google Cloud MCP Server by running: git clone https://github.com/nsachin08/gcpmcp

What MCP clients work with Google Cloud MCP Server?

Google Cloud MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Google Cloud MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare