/ Verzeichnis / Playground / Google Cloud Run
● Offiziell GoogleCloudPlatform 🔑 Eigener Schlüssel nötig

Google Cloud Run

von GoogleCloudPlatform · GoogleCloudPlatform/cloud-run-mcp

Deploy and manage Google Cloud Run services from an agent — official Google MCP, works with gcloud auth.

Official Google Cloud Platform MCP. Deploy containers or file contents to Cloud Run, list and inspect services, pull logs. Uses gcloud Application Default Credentials — no service account JSON in config. Best for agent-driven deploys and diagnose-in-place log queries.

Warum nutzen

Hauptfunktionen

Live-Demo

In der Praxis

cloud-run.replay ▶ bereit
0/0

Installieren

Wählen Sie Ihren Client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "cloud-run": {
      "command": "npx",
      "args": [
        "-y",
        "@google-cloud/cloud-run-mcp"
      ]
    }
  }
}

Öffne Claude Desktop → Settings → Developer → Edit Config. Nach dem Speichern neu starten.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "cloud-run": {
      "command": "npx",
      "args": [
        "-y",
        "@google-cloud/cloud-run-mcp"
      ]
    }
  }
}

Cursor nutzt das gleiche mcpServers-Schema wie Claude Desktop. Projektkonfiguration schlägt die globale.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "cloud-run": {
      "command": "npx",
      "args": [
        "-y",
        "@google-cloud/cloud-run-mcp"
      ]
    }
  }
}

Klicken Sie auf das MCP-Servers-Symbol in der Cline-Seitenleiste, dann "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "cloud-run": {
      "command": "npx",
      "args": [
        "-y",
        "@google-cloud/cloud-run-mcp"
      ]
    }
  }
}

Gleiche Struktur wie Claude Desktop. Windsurf neu starten zum Übernehmen.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "cloud-run",
      "command": "npx",
      "args": [
        "-y",
        "@google-cloud/cloud-run-mcp"
      ]
    }
  ]
}

Continue nutzt ein Array von Serverobjekten statt einer Map.

~/.config/zed/settings.json
{
  "context_servers": {
    "cloud-run": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@google-cloud/cloud-run-mcp"
        ]
      }
    }
  }
}

In context_servers hinzufügen. Zed lädt beim Speichern neu.

claude mcp add cloud-run -- npx -y @google-cloud/cloud-run-mcp

Einzeiler. Prüfen mit claude mcp list. Entfernen mit claude mcp remove.

Anwendungsfälle

Praxisnahe Nutzung: Google Cloud Run

Deploy a small service to Cloud Run from the agent

👤 Backend engineers, solo founders shipping prototypes ⏱ ~10 min intermediate

Wann einsetzen: You have a Node/Python service ready. You want it live on Cloud Run without context-switching to the console.

Voraussetzungen
  • gcloud SDK installed + authenticatedgcloud auth login && gcloud auth application-default login
  • A GCP project with billing enabledgcloud projects list
Ablauf
  1. List projects, pick the right one
    List my GCP projects. I want to deploy to the one tagged with 'staging'.✓ Kopiert
    → Project identified
  2. Deploy the local folder
    Deploy ./my-api as a Cloud Run service named 'api-staging' in us-central1. Allow unauthenticated invocations. Use the auto-detected buildpack.✓ Kopiert
    → Deploy completes, URL returned
  3. Verify
    Get the service details. Call the URL with a curl-style test. Confirm 200.✓ Kopiert
    → Working service URL

Ergebnis: A running Cloud Run service in 3-5 minutes, with the agent recording the URL for you.

Fallstricke
  • Unauthenticated flag exposes the service publicly — great for staging, bad for prod — For anything prod-adjacent, omit allow_unauthenticated and use IAM; front with Cloud Armor if user-facing
  • Each deploy creates a new revision, old ones linger and pin resources — Periodically clean up old revisions with gcloud, or configure revision retention
Kombinieren mit: fastmcp · fastapi-mcp

Diagnose a Cloud Run service from its logs

👤 On-call engineers ⏱ ~10 min intermediate

Wann einsetzen: A Cloud Run service is returning 500s. You want to see logs without opening the console.

Ablauf
  1. Pull recent logs
    Get the last 200 log entries for service 'api-prod' in us-central1. Filter to ERROR severity.✓ Kopiert
    → Error log entries
  2. Find patterns
    Group the errors by message template. Which one is most common? Include one sample stacktrace.✓ Kopiert
    → Top error with stacktrace
  3. Propose remediation
    Based on the stacktrace, point at the likely code path. Recommend a rollback to the previous revision if the errors are concentrated in the last deploy.✓ Kopiert
    → Root cause hypothesis + action

Ergebnis: From alert to rollback decision in 5 minutes.

Fallstricke
  • Log retention is short by default (30 days) — For anything you might need to look at later, export logs to BigQuery or GCS via Log Router
Kombinieren mit: sentry

Deploy an MCP server (FastMCP / fastapi-mcp) to Cloud Run

👤 Platform engineers hosting shared MCPs ⏱ ~30 min advanced

Wann einsetzen: You built an MCP server and want it hosted for team-wide use.

Voraussetzungen
  • Dockerfile or buildpack-compatible project — Cloud Run can use buildpacks for most languages
Ablauf
  1. Deploy the server
    Deploy ./my-mcp as Cloud Run service 'acme-mcp', region us-central1. Set env vars from my .env.prod. Require authentication.✓ Kopiert
    → Service deployed behind IAM
  2. Grant IAM access
    Grant role 'roles/run.invoker' on this service to [email protected] group.✓ Kopiert
    → Team can now invoke
  3. Wire clients
    Write the Claude Desktop config that connects via gcloud run services proxy or mcp-remote with IAM token.✓ Kopiert
    → Team has copy-paste setup

Ergebnis: A team-hosted MCP with GCP-native auth, same deploy model as your other services.

Fallstricke
  • SSE connections drop on Cloud Run's default 5-minute request timeout — Set --timeout=3600 on the service; MCP connections need longer idle tolerance
Kombinieren mit: fastmcp · fastapi-mcp · mcp-context-forge

Kombinationen

Mit anderen MCPs für 10-fache Wirkung

cloud-run + fastmcp

Write a Python MCP, deploy to Cloud Run in one session

Scaffold a FastMCP server exposing our pricing API, then deploy it to Cloud Run service 'pricing-mcp' with IAM auth.✓ Kopiert
cloud-run + sentry

Cloud Run errors → Sentry for incident triage

If our Cloud Run service's error rate spikes, pull Sentry's matching issue and correlate stack traces with the last deploy.✓ Kopiert
cloud-run + mcp-context-forge

Host ContextForge itself on Cloud Run to federate MCPs

Deploy mcp-contextforge-gateway to Cloud Run with Redis for federation state. Register our 3 existing MCPs as backends.✓ Kopiert

Werkzeuge

Was dieses MCP bereitstellt

WerkzeugEingabenWann aufrufenKosten
list-projects Discover which project to target (local only) free
create-project name, project_id? Bootstrap a new GCP project (local only) free
list-services project, region? See what's running in a project/region free
get-service project, region, service Inspect a specific service's config free
get-service-log project, region, service, filter?, limit? Debugging — pull recent logs free
deploy-local-folder folder_path, service, region, project, allow_unauthenticated? Deploy code you have locally (local only) free (build) + per-request Cloud Run pricing
deploy-file-contents files: {path,content}[], service, region, project Deploy agent-generated code without local files free (build) + per-request Cloud Run pricing

Kosten & Limits

Was der Betrieb kostet

API-Kontingent
GCP quotas — generous for Cloud Run deploy API
Tokens pro Aufruf
Log responses can be large — paginate or filter aggressively
Kosten in €
Cloud Run: free tier ~2M req/month, then ~$0.40 per million req + $0.000024 per vCPU-sec
Tipp
Set min-instances=0 for non-critical services — cold starts hurt but cost drops to near-zero at idle

Sicherheit

Rechte, Secrets, Reichweite

Minimale Scopes: roles/run.admin roles/iam.serviceAccountUser
Credential-Speicherung: Application Default Credentials via gcloud auth application-default login — no key files
Datenabfluss: Calls to *.googleapis.com
Niemals gewähren: roles/owner

Fehlerbehebung

Häufige Fehler und Lösungen

Permission denied on deploy

Your account needs roles/run.admin AND roles/iam.serviceAccountUser on the runtime service account. Check via gcloud projects get-iam-policy.

Build failed with 'buildpack not detected'

Add a Dockerfile, or a file that buildpacks recognize (package.json for Node, requirements.txt for Python, etc.).

Service deployed but returns 403

Either allow_unauthenticated wasn't set, or your invoking identity lacks roles/run.invoker. Decide: public or IAM-gated.

SSE MCP connections hang / drop

Increase --timeout=3600 and ensure min-instances=1 to avoid cold start disconnects.

Alternativen

Google Cloud Run vs. andere

AlternativeWann stattdessenKompromiss
Vercel (for Next.js)You're specifically hosting a Next.js appSimpler DX for Next.js; narrower than Cloud Run
AWS App Runner / Lambda MCPYou're on AWSComparable serverless model, different ecosystem
Fly.ioYou want global edge by default and simpler pricingSmaller ecosystem; no official MCP yet

Mehr

Ressourcen

📖 Offizielle README auf GitHub lesen

🐙 Offene Issues ansehen

🔍 Alle 400+ MCP-Server und Skills durchsuchen