Google Cloud Run MCP server

Deploys applications to Google Cloud Run through automated containerization, project setup, and service management with support for both local files and provided content.
Back to servers
Setup instructions
Provider
Google
Release date
May 29, 2025
Language
Go
Stats
346 stars

The MCP server for Cloud Run enables AI agents to deploy applications to Google Cloud Run through a standardized interface. It allows for deployments from various AI-powered environments including CLI tools, IDEs, assistant apps, and agent SDKs.

Installation Options

Option 1: As a Gemini CLI Extension

mkdir -p ~/.gemini/extensions/cloud-run/gemini-extension && \
  curl -s -L https://raw.githubusercontent.com/GoogleCloudPlatform/cloud-run-mcp/main/gemini-extension.json > ~/.gemini/extensions/cloud-run/gemini-extension.json && \
  curl -s -L https://raw.githubusercontent.com/GoogleCloudPlatform/cloud-run-mcp/main/gemini-extension/GEMINI.md > ~/.gemini/extensions/cloud-run/gemini-extension/GEMINI.md

Option 2: As a Local MCP Server

Prerequisites

  1. Install the Google Cloud SDK
  2. Authenticate with Google Cloud:
    gcloud auth login
    
  3. Set up application credentials:
    gcloud auth application-default login
    

Using Node.js

  1. Install Node.js (LTS version recommended)
  2. Update your MCP client configuration file:
    "mcpServers": {
      "cloud-run": {
        "command": "npx",
        "args": ["-y", "@google-cloud/cloud-run-mcp"]
      }
    }
    
  3. (Optional) Add default configurations:
    "mcpServers": {
      "cloud-run": {
        "command": "npx",
        "args": ["-y", "@google-cloud/cloud-run-mcp"],
        "env": {
          "GOOGLE_CLOUD_PROJECT": "PROJECT_NAME",
          "GOOGLE_CLOUD_REGION": "PROJECT_REGION",
          "DEFAULT_SERVICE_NAME": "SERVICE_NAME"
        }
      }
    }
    

Using Docker

  1. Install Docker
  2. Update your MCP client configuration file:
    "mcpServers": {
      "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/slim/.config/gcloud/application_default-credentials.json",
          "DEFAULT_SERVICE_NAME": "SERVICE_NAME"
        }
      }
    }
    

Option 3: As a Remote MCP Server

Setup Steps

  1. Install the Google Cloud SDK

  2. Authenticate with Google Cloud:

    gcloud auth login
    
  3. Set your Google Cloud project:

    gcloud config set project YOUR_PROJECT_ID
    
  4. Deploy the MCP server to Cloud Run:

    gcloud run deploy cloud-run-mcp --image us-docker.pkg.dev/cloudrun/container/mcp --no-allow-unauthenticated
    
  5. (Optional) Configure environment variables:

    gcloud run services update cloud-run-mcp --region=REGION --update-env-vars GOOGLE_CLOUD_PROJECT=PROJECT_NAME,GOOGLE_CLOUD_REGION=PROJECT_REGION,DEFAULT_SERVICE_NAME=SERVICE_NAME,SKIP_IAM_CHECK=false
    
  6. Run a local proxy to connect securely:

    gcloud run services proxy cloud-run-mcp --port=3000 --region=REGION --project=PROJECT_ID
    
  7. Update your MCP client configuration:

    "mcpServers": {
      "cloud-run": {
        "url": "http://localhost:3000/sse"
      }
    }
    

    Alternatively, if your client doesn't support the url attribute:

    "mcpServers": {
      "cloud-run": {
        "command": "npx",
        "args": ["-y", "mcp-remote", "http://localhost:3000/sse"]
      }
    }
    

Available Tools

Core Tools

  • deploy-file-contents: Deploy files to Cloud Run by providing their contents directly
  • list-services: List Cloud Run services in a project and region
  • get-service: Get details for a specific Cloud Run service
  • get-service-log: Get logs and error messages for a service

Local-Only Tools

  • deploy-local-folder: Deploy a local folder to Cloud Run
  • list-projects: List available GCP projects
  • create-project: Create a new GCP project with billing account

Using Prompts

The MCP server supports natural language prompts as shortcuts for common tasks:

  • deploy: Deploy the current directory to Cloud Run
  • logs: Get logs for a Cloud Run service

If service names aren't specified, the server will use either the DEFAULT_SERVICE_NAME environment variable or the current directory name.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "cloud-run" '{"command":"npx","args":["-y","https://github.com/GoogleCloudPlatform/cloud-run-mcp"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cloud-run": {
            "command": "npx",
            "args": [
                "-y",
                "https://github.com/GoogleCloudPlatform/cloud-run-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "cloud-run": {
            "command": "npx",
            "args": [
                "-y",
                "https://github.com/GoogleCloudPlatform/cloud-run-mcp"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later