Get the FREE Ultimate OpenClaw Setup Guide →

cloud-run

MCP server to deploy apps to Cloud Run

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio googlecloudplatform-cloud-run-mcp npx -y @google-cloud/cloud-run-mcp

How to use

This MCP server enables AI agents and IDEs to deploy code and manage Cloud Run services directly from trusted prompts. By integrating with Gemini CLI or other MCP clients, you can deploy, inspect, and fetch logs for Cloud Run services using a consistent set of prompts and tool calls. The server exposes commands such as deploy-file-contents, list-services, get-service, get-service-log, deploy-local-folder, list-projects, and create-project, making it feasible to automate cloud deployments and service management from your AI-assisted workflows. You can drive deployments from your current working directory or a specified folder, and you can tailor behavior with environment variables to control defaults like project, region, and service name.

To use with your MCP client, load the cloud-run MCP server configuration in your client’s MCP configuration file, then invoke prompts like deploy to push local code to a Cloud Run service, or logs to retrieve service logs. The server supports both local and IDE-driven workflows, and you can mix Node.js-based usage (via npx) or Docker-based setups as described in the installation guide.

How to install

Prerequisites:

  • Node.js (LTS) installed if using the Node.js/npx flow
  • Google Cloud SDK installed and authenticated if using local development with Cloud Run

Installation steps (Node.js / npx flow):

  1. Ensure Node.js is installed. You can verify with:
node -v
npm -v
  1. No separate installation is required for the MCP server if you use npx; ensure you have npm permissions to install and run global packages.
  2. Configure your MCP client with the server's entry, for example:
"cloud-run": {
  "command": "npx",
  "args": ["-y", "@google-cloud/cloud-run-mcp"]
}
  1. (Optional) Add default environment values in your MCP client config:
"cloud-run": {
  "command": "npx",
  "args": ["-y", "@google-cloud/cloud-run-mcp"],
  "env": {
    "GOOGLE_CLOUD_PROJECT": "YOUR_PROJECT_ID",
    "GOOGLE_CLOUD_REGION": "YOUR_REGION",
    "DEFAULT_SERVICE_NAME": "YOUR_SERVICE"
  }
}

Alternative installation (Docker):

  1. Install Docker on your machine.
  2. Update your MCP client configuration to run the Docker-based server:
"cloud-run": {
  "command": "docker",
  "args": [
    "run",
    "-i",
    "--rm",
    "-e",
    "GOOGLE_APPLICATION_CREDENTIALS",
    "-v",
    "/local-directory:/local-directory",
    "mcp/cloud-run-mcp:latest"
  ],
  "env": {
    "GOOGLE_APPLICATION_CREDENTIALS": "/Users/you/.config/gcloud/application_default-credentials.json",
    "DEFAULT_SERVICE_NAME": "YOUR_SERVICE"
  }
}

Prerequisites for Cloud Run access: Install the Google Cloud SDK, authenticate with gcloud auth login, and optionally enable application-default credentials with gcloud auth application-default login before using local MCP interactions with Cloud Run.

Additional notes

Tips and common issues:

  • Ensure GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_REGION are correctly set in environment or MCP config to avoid regional misrouting.
  • If ENABLE_HOST_VALIDATION is enabled in your environment, configure ALLOWED_HOSTS accordingly to prevent DNS rebinding issues.
  • When deploying from a local folder, verify that all necessary Cloud Run service permissions are granted to the credentials in use (IAM permissions). Use SKIP_IAM_CHECK to bypass IAM checks only for public deployments, but enabling checks is safer for security.
  • The DEFAULT_SERVICE_NAME is used when a service name isn’t specified in prompts; keep it descriptive to avoid conflicts.
  • For Docker-based runs, ensure the Docker image mcp/cloud-run-mcp:latest is accessible, and that GOOGLE_APPLICATION_CREDENTIALS points to valid credentials with Cloud Run permissions.

Related MCP Servers

Sponsor this space

Reach thousands of developers