Use when integrating Google Cloud Run MCP server, deploying containers via MCP tools, managing Cloud Run services, monitoring revisions, configuring scaling, or debugging Cloud Run MCP integration - focuses on GCP serverless container deployments through MCP
☐ Check Cloud Run MCP server configured
☐ Verify mcp__cloud-run tools available
☐ Confirm GCP authentication is set up
// claude_desktop_config.json
{
"mcpServers": {
"cloud-run": {
"command": "npx",
"args": ["-y", "@google-cloud/mcp-server"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json",
"GCP_PROJECT": "your-project-id",
"GCP_REGION": "us-central1"
}
}
}
}
GCP authentication:
# Option 1: Service account key
gcloud iam service-accounts create mcp-cloud-run
gcloud iam service-accounts keys create sa-key.json \
[email protected]
# Option 2: Application default credentials
gcloud auth application-default login
☐ List Cloud Run services ☐ Review available MCP tools ☐ Understand tool parameters
Common Cloud Run MCP tools:
mcp__cloud-run__list_services - Get all services
mcp__cloud-run__get_service - Get service details
mcp__cloud-run__deploy - Deploy new revision
mcp__cloud-run__update_service - Update configuration
mcp__cloud-run__list_revisions - Get revision history
mcp__cloud-run__update_traffic - Split traffic between revisions
mcp__cloud-run__get_logs - Fetch service logs
Example: List services
const services = await mcp__cloud-run__list_services({
project: "my-project",
region: "us-central1"
});
services.forEach(service => {
console.log(`Service: ${service.name}`);
console.log(` URL: ${service.url}`);
console.log(` Latest revision: ${service.latestRevision}`);
console.log(` Traffic: ${service.traffic}`);
});
☐ Build container image ☐ Push to Container Registry or Artifact Registry ☐ Deploy via MCP ☐ Monitor deployment progress
Example: Deploy service
// Deploy from container image
const deployment = await mcp__cloud-run__deploy({
service: "my-api",
image: "gcr.io/my-project/my-api:latest",
region: "us-central1",
platform: "managed",
allow_unauthenticated: true,
memory: "512Mi",
cpu: "1",
max_instances: 10,
env_vars: {
"NODE_ENV": "production",
"DATABASE_URL": "postgres://..."
}
});
console.log(`Deployed to: ${deployment.url}`);
☐ Update environment variables ☐ Configure resource limits ☐ Set autoscaling parameters ☐ Configure concurrency
Example: Update service
await mcp__cloud-run__update_service({
service: "my-api",
region: "us-central1",
updates: {
min_instances: 1, // Always warm
max_instances: 50,
cpu: "2",
memory: "1Gi",
timeout: "300s",
concurrency: 80 // Requests per container
}
});
Example: Update environment variables
await mcp__cloud-run__update_service({
service: "my-api",
region: "us-central1",
env_vars: {
"FEATURE_FLAG_NEW_UI": "true",
"LOG_LEVEL": "debug"
}
});
☐ Deploy new revision ☐ Split traffic for canary testing ☐ Monitor new revision performance ☐ Roll back if issues detected
Example: Canary deployment
// 1. Deploy new revision (no traffic)
const newRevision = await mcp__cloud-run__deploy({
service: "my-api",
image: "gcr.io/my-project/my-api:v2",
no_traffic: true // Don't route traffic yet
});
// 2. Send 10% traffic to new revision
await mcp__cloud-run__update_traffic({
service: "my-api",
region: "us-central1",
traffic: {
[newRevision.name]: 10,
[currentRevision.name]: 90
}
});
// 3. Monitor metrics
// If successful, gradually increase traffic
Example: Rollback
// Get previous revision
const revisions = await mcp__cloud-run__list_revisions({
service: "my-api",
region: "us-central1"
});
const previousRevision = revisions[1];
// Route 100% traffic to previous revision
await mcp__cloud-run__update_traffic({
service: "my-api",
region: "us-central1",
traffic: {
[previousRevision.name]: 100
}
});
☐ Check service health ☐ Review logs for errors ☐ Monitor cold start times ☐ Track request metrics
Example: Get logs
const logs = await mcp__cloud-run__get_logs({
service: "my-api",
region: "us-central1",
limit: 100,
severity: "ERROR"
});
logs.forEach(entry => {
console.log(`[${entry.timestamp}] ${entry.message}`);
});
Example: Check service health
const service = await mcp__cloud-run__get_service({
service: "my-api",
region: "us-central1"
});
console.log("Status:", service.status.conditions);
// Check for: Ready, ContainerReady, ResourcesAvailable
apiVersion: serving.knative.dev/v1