/ Directory / Playground / Google Cloud Run
● Official GoogleCloudPlatform 🔑 Needs your key

Google Cloud Run

by 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.

Why use it

Key features

Live Demo

What it looks like in practice

cloud-run.replay ▶ ready
0/0

Install

Pick your 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"
      ]
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

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

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

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

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

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

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

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

Continue uses an array of server objects rather than a map.

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

Add to context_servers. Zed hot-reloads on save.

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

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use Google Cloud Run

Deploy a small service to Cloud Run from the agent

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

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

Prerequisites
  • gcloud SDK installed + authenticatedgcloud auth login && gcloud auth application-default login
  • A GCP project with billing enabledgcloud projects list
Flow
  1. List projects, pick the right one
    List my GCP projects. I want to deploy to the one tagged with 'staging'.✓ Copied
    → 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.✓ Copied
    → Deploy completes, URL returned
  3. Verify
    Get the service details. Call the URL with a curl-style test. Confirm 200.✓ Copied
    → Working service URL

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

Pitfalls
  • 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
Combine with: fastmcp · fastapi-mcp

Diagnose a Cloud Run service from its logs

👤 On-call engineers ⏱ ~10 min intermediate

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

Flow
  1. Pull recent logs
    Get the last 200 log entries for service 'api-prod' in us-central1. Filter to ERROR severity.✓ Copied
    → Error log entries
  2. Find patterns
    Group the errors by message template. Which one is most common? Include one sample stacktrace.✓ Copied
    → 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.✓ Copied
    → Root cause hypothesis + action

Outcome: From alert to rollback decision in 5 minutes.

Pitfalls
  • 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
Combine with: sentry

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

👤 Platform engineers hosting shared MCPs ⏱ ~30 min advanced

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

Prerequisites
  • Dockerfile or buildpack-compatible project — Cloud Run can use buildpacks for most languages
Flow
  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.✓ Copied
    → Service deployed behind IAM
  2. Grant IAM access
    Grant role 'roles/run.invoker' on this service to [email protected] group.✓ Copied
    → 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.✓ Copied
    → Team has copy-paste setup

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

Pitfalls
  • SSE connections drop on Cloud Run's default 5-minute request timeout — Set --timeout=3600 on the service; MCP connections need longer idle tolerance

Combinations

Pair with other MCPs for X10 leverage

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.✓ Copied
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.✓ Copied
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.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
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

Cost & Limits

What this costs to run

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

Security

Permissions, secrets, blast radius

Minimum scopes: roles/run.admin roles/iam.serviceAccountUser
Credential storage: Application Default Credentials via gcloud auth application-default login — no key files
Data egress: Calls to *.googleapis.com
Never grant: roles/owner

Troubleshooting

Common errors and fixes

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.

Alternatives

Google Cloud Run vs others

AlternativeWhen to use it insteadTradeoff
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

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills