Skip to content
Back to search

cloud-run-mcp

MCP server to deploy apps to Cloud Run

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/GoogleCloudPlatform/cloud-run-mcp with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/GoogleCloudPlatform/cloud-run-mcp'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/googlecloudplatform--cloud-run-mcp/badge.svg)](/listings/googlecloudplatform--cloud-run-mcp)

HTML

<a href="/listings/googlecloudplatform--cloud-run-mcp"><img src="/api/listings/googlecloudplatform--cloud-run-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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](https://cloud.google.com/sdk/docs/install) 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

0. Install [Node.js](https://nodejs.org/en/download/) (LTS version recommended).

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

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

2. [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](https://hub.docker.com/mcp/server/cloud-run-mcp/overview), or use these manual instructions:

0. Install [Docker](https://www.docker.com/get-started/)

1. 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"
        }
      }

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 302 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # Cloud Run MCP server and Gemini CLI extension
  2. Enable MCP-compatible AI agents to deploy apps to Cloud Run.
  3. ```json
  4. "mcpServers":{
  5. "cloud-run": {
  6. "command": "npx",
  7. "args": ["-y", "@google-cloud/cloud-run-mcp"]
  8. }
  9. }
  10. ```
  11. Deploy from Gemini CLI and other AI-powered CLI agents:
  12. <img src="https://raw.githubusercontent.com/GoogleCloudPlatform/cloud-run-mcp/refs/heads/main/.github/images/deploycli.gif" width="800">
  13. Deploy from AI-powered IDEs:
  14. <img src="https://raw.githubusercontent.com/GoogleCloudPlatform/cloud-run-mcp/refs/heads/main/.github/images/deploy_from_ide.gif" width="800">
  15. Deploy from AI assistant apps:
  16. <img src="https://raw.githubusercontent.com/GoogleCloudPlatform/cloud-run-mcp/refs/heads/main/.github/images/deploy_from_apps.gif" width="800">
  17. Deploy from agent SDKs, like the [Google Gen AI SDK](https://ai.google.dev/gemini-api/docs/function-calling?example=meeting#use_model_context_protocol_mcp) or [Agent Development Kit](https://google.github.io/adk-docs/tools/mcp-tools/).
  18. > [!NOTE]
  19. > 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](https://cloud.google.com/run/docs/host-mcp-servers).
  20. ## Tools
  21. - `deploy-file-contents`: Deploys files to Cloud Run by providing their contents directly.
  22. - `list-services`: Lists Cloud Run services in a given project and region.
  23. - `get-service`: Gets details for a specific Cloud Run service.
  24. - `get-service-log`: Gets Logs and Error Messages for a specific Cloud Run service.
  25. - `deploy-local-folder`\*: Deploys a local folder to a Google Cloud Run service.
  26. - `list-projects`\*: Lists available GCP projects.
  27. - `create-project`\*: Creates a new GCP project and attach it to the first available billing account. A project ID can be optionally specified.
  28. _\* only available when running locally_
  29. ## Prompts
  30. Prompts are natural language commands that can be used to perform common tasks. They are shortcuts for executing tool calls with pre-filled arguments.
  31. - `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.
  32. - `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.
  33. ## Environment Variables
  34. The Cloud Run MCP server can be configured using the following environment variables:
  35. | Variable | Description |
  36. | :----------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  37. | `GOOGLE_CLOUD_PROJECT` | The default project ID to use for Cloud Run services. |
  38. | `GOOGLE_CLOUD_REGION` | The default region to use for Cloud Run services. |
  39. | `DEFAULT_SERVICE_NAME` | The default service name to use for Cloud Run services. |
  40. | `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. |
  41. | `ENABLE_HOST_VALIDATION` | Prevents [DNS Rebinding](https://en.wikipedia.org/wiki/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. |
  42. | `ALLOWED_HOSTS` | Comma-separated list of allowed Host headers (if host validation is enabled). The default value is `localhost,127.0.0.1,::1`. |
  43. | `OAUTH_ENABLED` | Enables OAuth 2.0 Bearer token verification for incoming HTTP/SSE requests when set to `true`. Disabled by default. |
  44. | `GOOGLE_OAUTH_AUDIENCE` | Expected OAuth 2.0 token audience (typically your OAuth Client ID). Required when `OAUTH_ENABLED=true`. |
  45. ## Use as a Gemini CLI extension
  46. To install this as a [Gemini CLI](https://github.com/google-gemini/gemini-cli) extension, run the following command:
  47. 2. Install the extension:
  48. ```bash
  49. gemini extensions install https://github.com/GoogleCloudPlatform/cloud-run-mcp
  50. ```
  51. 3. Log in to your Google Cloud account using the command:
  52. ```bash
  53. gcloud auth login
  54. ```
  55. 4. Set up application credentials using the command:
  56. ```bash
  57. gcloud auth application-default login
  58. ```
  59. ## Use in MCP Clients
  60. ### Learn how to configure your MCP client
  61. Most MCP clients require a configuration file to be created or modified to add the MCP server.
  62. The configuration file syntax can be different across clients. Please refer to the following links for the latest expected syntax:
  63. - [**Antigravity**](https://antigravity.google/docs/mcp)
  64. - [**Windsurf**](https://docs.windsurf.com/windsurf/mcp)
  65. - [**VSCode**](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)
  66. - [**Claude Desktop**](https://modelcontextprotocol.io/quickstart/user)
  67. - [**Cursor**](https://docs.cursor.com/context/model-context-protocol)
  68. Once you have identified how to configure your MCP client, select one of these two options to set up the MCP server.
  69. We recommend setting up as a local MCP server using Node.js.
  70. ### Set up as local MCP server
  71. 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).
  72. 1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) and authenticate with your Google account.
  73. 2. Log in to your Google Cloud account using the command:
  74. ```bash
  75. gcloud auth login
  76. ```
  77. 3. Set up application credentials using the command:
  78. ```bash
  79. gcloud auth application-default login
  80. ```
  81. Then configure the MCP server using either Node.js or Docker:
  82. #### Using Node.js
  83. 0. Install [Node.js](https://nodejs.org/en/download/) (LTS version recommended).
  84. 1. Update the MCP configuration file of your MCP client with the following:
  85. ```json
  86. "cloud-run": {
  87. "command": "npx",
  88. "args": ["-y", "@google-cloud/cloud-run-mcp"]
  89. }
  90. ```
  91. 2. [Optional] Add default configurations
  92. ```json
  93. "cloud-run": {
  94. "command": "npx",
  95. "args": ["-y", "@google-cloud/cloud-run-mcp"],
  96. "env": {
  97. "GOOGLE_CLOUD_PROJECT": "PROJECT_NAME",
  98. "GOOGLE_CLOUD_REGION": "PROJECT_REGION",
  99. "DEFAULT_SERVICE_NAME": "SERVICE_NAME"
  100. }
  101. }
  102. ```
  103. #### Using Docker
  104. See Docker's [MCP catalog](https://hub.docker.com/mcp/server/cloud-run-mcp/overview), or use these manual instructions:
  105. 0. Install [Docker](https://www.docker.com/get-started/)
  106. 1. Update the MCP configuration file of your MCP client with the following:
  107. ```json
  108. "cloud-run": {
  109. "command": "docker",
  110. "args": [
  111. "run",
  112. "-i",
  113. "--rm",
  114. "-e",
  115. "GOOGLE_APPLICATION_CREDENTIALS",
  116. "-v",
  117. "/local-directory:/local-directory",
  118. "mcp/cloud-run-mcp:latest"
  119. ],
  120. "env": {
  121. "GOOGLE_APPLICATION_CREDENTIALS": "/Users/slim/.config/gcloud/application_default-credentials.json",
  122. "DEFAULT_SERVICE_NAME": "SERVICE_NAME"
  123. }
  124. }
  125. ```
  126. ### Set up as remote MCP server
  127. > [!WARNING]
  128. > 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.
  129. Run the Cloud Run MCP server itself on Cloud Run with connection from your local machine authenticated via IAM.
  130. With this option, you will only be able to deploy code to the same Google Cloud project as where the MCP server is running.
  131. 1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) and authenticate with your Google account.
  132. 2. Log in to your Google Cloud account using the command:
  133. ```bash
  134. gcloud auth login
  135. ```
  136. 3. Set your Google Cloud project ID using the command:
  137. ```bash
  138. gcloud config set project YOUR_PROJECT_ID
  139. ```
  140. 4. Deploy the Cloud Run MCP server to Cloud Run:
  141. ```bash
  142. gcloud run deploy cloud-run-mcp --image us-docker.pkg.dev/cloudrun/container/mcp --no-allow-unauthenticated
  143. ```
  144. When prompted, pick a region, for example `europe-west1`.
  145. Note that the MCP server is _not_ publicly accessible, it requires authentication via IAM.
  146. 5. [Optional] Add default configurations
  147. ```bash
  148. 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
  149. ```
  150. 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:
  151. ```bash
  152. gcloud run services proxy cloud-run-mcp --port=3000 --region=REGION --project=PROJECT_ID
  153. ```
  154. This will create a local proxy on port 3000 that forwards requests to the remote MCP server and injects your identity.
  155. 7. Update the MCP configuration file of your MCP client with the following:
  156. ```json
  157. "cloud-run": {
  158. "url": "http://localhost:3000/sse"
  159. }
  160. ```
  161. If your MCP client does not support the `url` attribute, you can use [mcp-remote](https://www.npmjs.com/package/mcp-remote):
  162. ```json
  163. "cloud-run": {
  164. "command": "npx",
  165. "args": ["-y", "mcp-remote", "http://localhost:3000/sse"]
  166. }
  167. ```
  168. ## Using MCP Server with OAuth
  169. 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.
  170. 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:
  171. ```bash
  172. cp .env.gcloud-sdk-oauth .env
  173. node mcp-server.js
  174. ```
  175. ### Configure MCP Server on Gemini CLI to use OAuth
  176. 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:
  177. ```json
  178. {
  179. "mcpServers": {
  180. "cloud-run": {
  181. "httpUrl": "http://localhost:3000/mcp",
  182. "oauth": {
  183. "enabled": true,
  184. "clientId": "<OAUTH_CLIENT_ID>",
  185. "clientSecret": "<OAUTH_CLIENT_SECRET>"
  186. }
  187. }
  188. }
  189. }
  190. ```
  191. 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:
  192. ```
  193. /mcp auth cloud-run
  194. ```
  195. 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.
  196. 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.
  197. # Cloud Run Skills
  198. 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](https://github.com/GoogleCloudPlatform/cloud-run-mcp/blob/main/skills/cloud-run/SKILL.md).
  199. 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.
  200. In order to use Cloud Run skills:
  201. 1. Ensure you have the `gcloud` CLI installed and authenticated with `gcloud auth login` and `gcloud auth application-default login`.
  202. 2. Set your project with `gcloud config set project [PROJECT_ID]`.
  203. 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:
  204. ```bash
  205. gemini skills install https://github.com/GoogleCloudPlatform/cloud-run-mcp.git --path skills/cloud-run
  206. ```
  207. 4. 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:
  208. - List the Cloud Run services in the project test-gcp-project in the region us-west1.
  209. - 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.
  210. - Describe the Cloud Run job hello-job in the project test-gcp-project in the region europe-west1.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.