Google Cloud MCP Server
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.
README
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-1inus-central1autopilot-cluster-2ineurope-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)
-
Nginx (3 replicas)
- Default namespace
- Service: LoadBalancer on port 80
-
WordPress Stack
- Namespace:
wordpress - MySQL (1 replica) - Database
- WordPress (2 replicas) - Web application
- Services: LoadBalancer on port 80
- Namespace:
-
Monitoring Stack
- Namespace:
monitoring - Prometheus (1 replica) - Metrics collection
- Grafana (1 replica) - Visualization
- Services: LoadBalancer on ports 9090 & 3000
- Namespace:
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 <pod-name> -n <namespace> - Check events:
kubectl describe pod <pod-name> -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:
- Edit
deploy-apps.ps1ordeploy-apps.sh - Change image names, replicas, namespaces as needed
- Run the modified script
Example - Deploy a different image:
kubectl create deployment my-app --image=busybox:latest --replicas=2
File Structure
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
Next Steps
- Run deployment script
- Wait for all pods to be ready
- Test your GCP tools
- Verify all deployments working correctly
- Run cleanup when done
For more information on GKE, visit: https://cloud.google.com/kubernetes-engine/docs
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。