Official Google Cloud MCP server for managing Cloud Run services. Deploy, scale, and monitor serverless containers directly from Google Antigravity with natural language commands.
## Google Cloud Run MCP Server: Serverless Container Deployment from Your IDE The **Google Cloud Run MCP Server** enables seamless integration between Google Antigravity and Google Cloud Run, allowing you to deploy, manage, and monitor serverless containers using natural language commands. This official Google Cloud integration brings the full power of Cloud Run directly into your AI-assisted development workflow. ### What is Google Cloud Run? Google Cloud Run is a fully managed serverless platform that automatically scales your containerized applications. It abstracts away all infrastructure management, letting you focus on writing code while Google handles: - **Automatic Scaling**: From zero to thousands of instances in seconds - **Pay-per-use Pricing**: Only pay for the compute time you actually use - **HTTPS Endpoints**: Automatic TLS certificates and custom domains - **Container Support**: Deploy any language, framework, or binary ### Key MCP Server Capabilities #### 1. Service Deployment Deploy containerized applications with simple commands: ``` "Deploy my Dockerfile to Cloud Run as production-api" "Create a new Cloud Run service from gcr.io/my-project/my-image:latest" "Deploy this Next.js app to Cloud Run with 1GB memory" ``` The MCP server handles all the complexity: - Container registry authentication - Service configuration - Traffic routing - Revision management #### 2. Service Management Manage your running services effortlessly: - **List Services**: View all Cloud Run services across regions - **Update Configuration**: Modify CPU, memory, concurrency limits - **Traffic Splitting**: Route traffic between revisions for canary deployments - **Delete Services**: Clean up unused services #### 3. Monitoring and Logs Real-time insights into your services: - Stream logs from running containers - View request metrics and latency - Monitor error rates and 5xx responses - Check revision deployment status #### 4. Revision Control Advanced deployment strategies: - **Blue-Green Deployments**: Switch traffic between versions instantly - **Canary Releases**: Gradually roll out changes - **Rollback**: Instantly revert to previous revisions - **Revision Tagging**: Create stable URLs for specific versions ### Configuration and Setup Add the Cloud Run MCP to your Google Antigravity configuration: ```json { "mcpServers": { "google-cloud-run": { "command": "npx", "args": ["-y", "@anthropic/mcp-server-gcloud-run"], "env": { "GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json", "GCLOUD_PROJECT": "your-project-id", "GCLOUD_REGION": "us-central1" } } } } ``` ### Prerequisites 1. **Google Cloud Account**: Active GCP account with billing enabled 2. **Service Account**: With Cloud Run Admin and Artifact Registry roles 3. **gcloud CLI**: Installed and authenticated (optional but recommended) 4. **Docker**: For building container images locally ### Common Workflows #### Deploy a New Service ``` "Build and deploy this Python FastAPI app to Cloud Run" ``` The MCP server will: 1. Build the Docker image 2. Push to Artifact Registry 3. Create or update the Cloud Run service 4. Return the service URL #### Scale a Service ``` "Set minimum instances to 2 for my production-api service" "Update max instances to 100 for high-traffic-service" ``` #### View Service Status ``` "Show me the status of all my Cloud Run services" "Get the logs for payment-processor service from the last hour" ``` #### Manage Traffic ``` "Split traffic 90/10 between v2 and v1 revisions" "Route all traffic to the latest revision" ``` ### Best Practices for Cloud Run with AI 1. **Use Environment Variables**: Store configuration in environment variables, not code 2. **Implement Health Checks**: Add /health endpoints for proper load balancing 3. **Set Appropriate Timeouts**: Configure request timeouts based on your workload 4. **Optimize Cold Starts**: Use minimum instances for latency-sensitive services 5. **Container Optimization**: Use multi-stage builds for smaller images ### Integration with CI/CD The Cloud Run MCP works alongside your existing CI/CD pipelines: - **Staging Deployments**: Deploy feature branches for testing - **Production Promotion**: Promote tested containers to production - **Automated Rollback**: Detect failures and rollback automatically ### Security Considerations - **IAM Authentication**: Require authentication for internal services - **VPC Connector**: Access private resources securely - **Secret Manager**: Integrate secrets without exposing them - **Binary Authorization**: Only deploy verified containers ### Pricing Optimization The MCP can help optimize your Cloud Run costs: - Identify underutilized services - Recommend appropriate resource allocation - Suggest concurrency settings for your workload - Monitor and alert on unexpected spending ### Use Cases - **API Backends**: Deploy REST and GraphQL APIs - **Web Applications**: Host Next.js, React, or Vue apps - **Microservices**: Run distributed system components - **Background Jobs**: Process async tasks with Cloud Tasks - **Event Processing**: Handle Pub/Sub messages and webhooks ### Getting Started 1. Set up a GCP project with Cloud Run API enabled 2. Create a service account with necessary permissions 3. Configure the MCP server in your Antigravity settings 4. Start deploying with natural language commands The Google Cloud Run MCP transforms serverless deployment into a conversational experience, making cloud-native development more accessible and efficient than ever before.
{
"mcpServers": {
"google-cloud-run": {
"env": {
"GCLOUD_REGION": "us-central1",
"GCLOUD_PROJECT": "your-project-id",
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json"
},
"args": [
"-y",
"@anthropic/mcp-server-gcloud-run"
],
"command": "npx"
}
}
}GCLOUD_REGIONus-central1GCLOUD_PROJECTyour-project-idGOOGLE_APPLICATION_CREDENTIALS/path/to/service-account.json