loading…
Search for a command to run...
loading…
Enables interaction with Google Kubernetes Engine (GKE) to list clusters, manage node pools, and retrieve server configurations. It includes automated scripts f
Enables interaction with Google Kubernetes Engine (GKE) to list clusters, manage node pools, and retrieve server configurations. It includes automated scripts for deploying and testing sample applications across multiple GKE Autopilot clusters.
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
Before running these scripts, you need:
autopilot-cluster-1 in us-central1autopilot-cluster-2 in europe-west2# Run PowerShell as Administrator
.\setup-gcloud.ps1
Then initialize gcloud:
gcloud init
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
gcloud init
gcloud components install kubectl
gcloud --version
kubectl version --client
# Deploy applications to both clusters
.\deploy-apps.ps1 -ProjectId "your-project-id"
# Or use current gcloud project (if configured)
.\deploy-apps.ps1
# 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
Nginx (3 replicas)
WordPress Stack
wordpressMonitoring Stack
monitoringSame applications deployed for comparison and multi-cluster testing.
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'
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'))"
When you're done testing, remove all deployments:
.\cleanup-deployments.ps1
./cleanup-deployments.sh
The cleanup script will:
Solution: Install Google Cloud SDK (see Step 1 above)
Solution: Install kubectl with gcloud components install kubectl
gcloud config get-value projectgcloud config set project YOUR_PROJECT_IDkubectl logs <pod-name> -n <namespace>kubectl describe pod <pod-name> -n <namespace>kubectl get services --all-namespaces -wTo deploy different applications, modify the deployment scripts:
deploy-apps.ps1 or deploy-apps.shExample - Deploy a different image:
kubectl create deployment my-app --image=busybox:latest --replicas=2
gcpInfra/
├── setup-gcloud.ps1 # Install Google Cloud SDK
├── deploy-apps.ps1 # PowerShell deployment script
├── deploy-apps.sh # Bash deployment script
├── cleanup-deployments.ps1 # PowerShell cleanup script
└── cleanup-deployments.sh # Bash cleanup script
For more information on GKE, visit: https://cloud.google.com/kubernetes-engine/docs
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"google-cloud-mcp-server": {
"command": "npx",
"args": []
}
}
}