Cloud Run

Cloud and DevOps

MCP server to deploy apps to Cloud Run.

Your AI app calls the Cloud Run MCP server, which does the work through tools like deploy-file-contents, list-services, get-service and get-service-log and sends the result back to the chat.

About Cloud Run

Cloud Run is a community MCP server from GoogleCloudPlatform, filed in our directory under cloud and devops. MCP server to deploy apps to Cloud Run.

The README for Cloud Run lists tools such as deploy-file-contents, list-services, get-service and get-service-log, which your AI app can call once the server is connected.

At a glance

Publisher
GoogleCloudPlatform (community)
Runs
See the README for setup
Written in
JavaScript
License
Apache-2.0
GitHub stars
642

Tools Cloud Run gives your AI app

  • deploy-file-contentsDeploys files to Cloud Run by providing their contents directly.
  • list-servicesLists Cloud Run services in a given project and region.
  • get-serviceGets details for a specific Cloud Run service.
  • get-service-logGets Logs and Error Messages for a specific Cloud Run service.
  • deploy-local-folder\: Deploys a local folder to a Google Cloud Run service.
  • list-projects\: Lists available GCP projects.
  • create-project\: Creates a new GCP project and attach it to the first available billing account. A project ID can be optionally specified.

Tool names as the Cloud Run README lists them. Your AI app shows the live list once Cloud Run is connected.

How to set up Cloud Run

  1. Follow the install steps in the Cloud Run README; it is written in JavaScript, so have that toolchain ready.
  2. Check the Cloud Run README for keys or settings; the registry lists none that Cloud Run requires.
  3. Add Cloud Run to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Cloud Run tools to confirm the connection.
  5. Run one read-only task with Cloud Run first, such as a call to deploy-file-contents, before you allow anything that writes or sends.

Cloud Run compared with similar servers

  • SandBase Harness by sandbaseai has fewer GitHub stars than Cloud Run (642 against 642); both are community servers, and both run locally.
  • Cloudflare Workers by cloudflare has more GitHub stars than Cloud Run (649 against 642); Cloudflare Workers is official while Cloud Run is a community server, and both run locally.
  • Coolify by StuMason has fewer GitHub stars than Cloud Run (632 against 642); both are community servers, and both run locally.

Before you connect Cloud Run

  • Give Cloud Run its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Cloud Run tool call until you trust what it does with them.
  • Treat text that Cloud Run fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Cloud Run on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Cloud Run

How marketing and sales teams put Cloud Run to work, by company size. Pick the size closest to yours and start Cloud Run on one use case.

Small business

  • A small business can ask Cloud Run why the site is slow or down and get the likely cause in plain words.
  • Owners can use Cloud Run to check hosting costs and spot services they pay for but no longer use.
  • Cloud Run runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Web teams can connect Cloud Run to watch deploys during a launch and roll back fast if a campaign page breaks.
  • Marketing engineering can use Cloud Run to spin up preview environments for every landing page review.
  • Start with deploy-file-contents and list-services, the tools Cloud Run lists first, and add more once the team trusts the results.

Enterprise

  • Enterprises should give Cloud Run read access first, with changes gated by the same approvals as any infrastructure change.
  • Large orgs can use Cloud Run to answer cost and reliability questions across accounts, so marketing launches are planned with real capacity.
  • Cloud Run is a community server, so have security review the code and pin a version before Cloud Run touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Cloud Run README

From GoogleCloudPlatform/cloud-run-mcp on GitHub, shared under its Apache-2.0 license. Images are left out; the original has them.

README.md

Cloud Run MCP server and Gemini CLI extension

Enable MCP-compatible AI agents to deploy apps to Cloud Run.

"mcpServers":{
  "cloud-run": {
    "command": "npx",
    "args": ["-y", "@google-cloud/cloud-run-mcp"]
  }
}

Deploy from Gemini CLI and other AI-powered CLI agents:

Deploy from AI-powered IDEs:

Deploy from AI assistant apps:

Deploy from agent SDKs, like the Google Gen AI SDK or Agent Development Kit.

[!NOTE]
This is the repository of an MCP server to deploy code to Cloud Run, to learn how to host MCP servers on Cloud Run, visit the Cloud Run documentation.

Tools

  • deploy-file-contents: Deploys files to Cloud Run by providing their contents directly.

  • list-services: Lists Cloud Run services in a given project and region.

  • get-service: Gets details for a specific Cloud Run service.

  • get-service-log: Gets Logs and Error Messages for a specific Cloud Run service.

  • deploy-local-folder*: Deploys a local folder to a Google Cloud Run service.

  • list-projects*: Lists available GCP projects.

  • create-project*: Creates a new GCP project and attach it to the first available billing account. A project ID can be optionally specified.

* only available when running locally

Prompts

Prompts are natural language commands that can be used to perform common tasks. They are shortcuts for executing tool calls with pre-filled arguments.

  • deploy: Deploys the current working directory to Cloud Run. If a service name is not provided, it will use the DEFAULT_SERVICE_NAME environment variable, or the name of the current working directory.
  • logs: Gets the logs for a Cloud Run service. If a service name is not provided, it will use the DEFAULT_SERVICE_NAME environment variable, or the name of the current working directory.

Environment Variables

The Cloud Run MCP server can be configured using the following environment variables:

Variable Description
GOOGLE_CLOUD_PROJECT The default project ID to use for Cloud Run services.
GOOGLE_CLOUD_REGION The default region to use for Cloud Run services.
DEFAULT_SERVICE_NAME The default service name to use for Cloud Run services.
SKIP_IAM_CHECK Controls whether to check for IAM permissions for a Cloud Run service. Set to false to enable checks. This is true by default which is a recommended way to make the service public.
ENABLE_HOST_VALIDATION Prevents DNS Rebinding attacks by validating the Host header. Enabled by default when running locally and disabled by default when running on Cloud Run. Set to false to disable or true to enable.
ALLOWED_HOSTS Comma-separated list of allowed Host headers (if host validation is enabled). The default value is localhost,127.0.0.1,::1.
OAUTH_ENABLED Enables OAuth 2.0 Bearer token verification for incoming HTTP/SSE requests when set to true. Disabled by default.
GOOGLE_OAUTH_AUDIENCE Expected OAuth 2.0 token audience (typically your OAuth Client ID). Required when OAUTH_ENABLED=true.

Use as a Gemini CLI extension

To install this as a Gemini CLI extension, run the following command:

  1. Install the extension:

    gemini extensions install https://github.com/GoogleCloudPlatform/cloud-run-mcp
    
  2. Log in to your Google Cloud account using the command:

    gcloud auth login
    
  3. Set up application credentials using the command:

    gcloud auth application-default login
    

Use in MCP Clients

Learn how to configure your MCP client

Most MCP clients require a configuration file to be created or modified to add the MCP server.

The configuration file syntax can be different across clients. Please refer to the following links for the latest expected syntax:

Once you have identified how to configure your MCP client, select one of these two options to set up the MCP server. We recommend setting up as a local MCP server using Node.js.

Set up as local MCP server

Run the Cloud Run MCP server on your local machine using local Google Cloud credentials. This is best if you are using an AI-assisted IDE (e.g. Cursor) or a desktop AI application (e.g. Claude).

  1. Install the Google Cloud SDK and authenticate with your Google account.

  2. Log in to your Google Cloud account using the command:

    gcloud auth login
    
  3. Set up application credentials using the command:

    gcloud auth application-default login
    

Then configure the MCP server using either Node.js or Docker:

Using Node.js
  1. Install Node.js (LTS version recommended).

  2. Update the MCP configuration file of your MCP client with the following:

       "cloud-run": {
         "command": "npx",
         "args": ["-y", "@google-cloud/cloud-run-mcp"]
       }
    
  3. [Optional] Add default configurations

       "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

See Docker's MCP catalog, or use these manual instructions:

  1. Install Docker

  2. Update the MCP configuration file of your MCP client with the following:

       "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"
         }
       }
    
Set up as remote MCP server

[!WARNING]
Do not use the remote MCP server without authentication. In the following instructions, we will use IAM authentication to secure the connection to the MCP server from your local machine. This is important to prevent unauthorized access to your Google Cloud resources.

Run the Cloud Run MCP server itself on Cloud Run with connection from your local machine authenticated via IAM. With this option, you will only be able to deploy code to the same Google Cloud project as where the MCP server is running.

  1. Install the Google Cloud SDK and authenticate with your Google account.

  2. Log in to your Google Cloud account using the command:

    gcloud auth login
    
  3. Set your Google Cloud project ID using the command:

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

    gcloud run deploy cloud-run-mcp --image us-docker.pkg.dev/cloudrun/container/mcp --no-allow-unauthenticated
    

    When prompted, pick a region, for example europe-west1.

    Note that the MCP server is not publicly accessible, it requires authentication via IAM.

  5. [Optional] Add default configurations

    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 Cloud Run proxy on your local machine to connect securely using your identity to the remote MCP server running on Cloud Run:

    gcloud run services proxy cloud-run-mcp --port=3000 --region=REGION --project=PROJECT_ID
    

    This will create a local proxy on port 3000 that forwards requests to the remote MCP server and injects your identity.

  7. Update the MCP configuration file of your MCP client with the following:

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

    If your MCP client does not support the url attribute, you can use mcp-remote:

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

Using MCP Server with OAuth

Cloud Run MCP server supports OAuth as an authentication mechanism. In order to use OAuth, create the OAuth client, and configure a .env file with the appropriate values pertaining to your OAuth client. A .env.example is provided for reference.

The Cloud Run MCP server works seamlessly with Google Cloud SDK OAuth client. In order to leverage the Google Cloud SDK OAuth client, you can use the .env.gcloud-sdk-oauth file as your .env file as follows:

cp .env.gcloud-sdk-oauth .env
node mcp-server.js
Configure MCP Server on Gemini CLI to use OAuth

When the Cloud Run MCP server is started in the OAuth mode, the MCP client should also be configured to use OAuth. You can setup the MCP server in OAuth mode in the Gemini CLI by using the following JSON in the ~/.gemini/settings.json file:

{
  "mcpServers": {
    "cloud-run": {
      "httpUrl": "http://localhost:3000/mcp",
      "oauth": {
        "enabled": true,
        "clientId": "<OAUTH_CLIENT_ID>",
        "clientSecret": "<OAUTH_CLIENT_SECRET>"
      }
    }
  }
}

Post the configuration changes as shown above, start the Gemini CLI. You should authenticate the Cloud Run MCP server using the following prompt in the Gemini CLI:

/mcp auth cloud-run

This will take you to the authentication page on your browser, wherein you need to sign in using the appropriate gmail id, and accept the terms and conditions. Once the authentication is succcessful, you can come back to the Gemini CLI, and the Cloud Run MCP server will be ready to use.

The Google Cloud Platform Terms of Service (available at https://cloud.google.com/terms/) and the Data Processing and Security Terms (available at https://cloud.google.com/terms/data-processing-terms) do not apply to any component of the Cloud Run MCP Server software.

Cloud Run Skills

We introduce Cloud Run skills to enable AI agents to perform actions on Cloud Run. You can use these skills with Gemini CLI and other agentic AI tools. The skills are available at Cloud Run Skills.

The Cloud Run skills are based on top of gcloud cli for Cloud Run empowering agents to perform all the actions on the Cloud Run using gcloud, as can be performed by the GCP user using gcloud cli.

In order to use Cloud Run skills:

  1. Ensure you have the gcloud CLI installed and authenticated with gcloud auth login and gcloud auth application-default login.
  2. Set your project with gcloud config set project [PROJECT_ID].
  3. Enable the skills on your agentic AI tool. For example, you can enable the skills for Gemini CLI using the following command on your terminal:
gemini skills install https://github.com/GoogleCloudPlatform/cloud-run-mcp.git --path skills/cloud-run
  1. Once the skills are enabled, you can use them to perform actions on Cloud Run. Here are some of the prompts for you to get started:
  • List the Cloud Run services in the project test-gcp-project in the region us-west1.

  • Deploy the folder /home/username/workspace/hello-world as Cloud Run service hello-world to the project test-gcp-project in the region us-west1.

  • Describe the Cloud Run job hello-job in the project test-gcp-project in the region europe-west1.

Questions about Cloud Run

What is the Cloud Run MCP server?

MCP server to deploy apps to Cloud Run. Cloud Run is maintained by GoogleCloudPlatform on GitHub at GoogleCloudPlatform/cloud-run-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Cloud Run MCP server?

Cloud Run doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (GoogleCloudPlatform/cloud-run-mcp). Like most servers, Cloud Run ends with a command or URL you paste into your AI app's MCP config.

Does Cloud Run need an API key?

The registry lists no required keys for Cloud Run. Check the Cloud Run README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Cloud Run an official MCP server?

No. Cloud Run is a community server maintained by GoogleCloudPlatform. Community servers can be excellent; read the code and the open issues before you give Cloud Run access to company data.

What license is Cloud Run under?

Cloud Run is released under the Apache-2.0 license, according to its GitHub repository. The license covers the code of Cloud Run; the service it connects to has its own terms.