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. This is disabled by default. |
ALLOWED_HOSTS | Comma-separated list of allowed Host headers (if host validation is enabled). The default value is localhost,127.0.0.1,::1. |
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.
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
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:
- Ensure you have the
gcloud CLI installed and authenticated with gcloud auth login and gcloud auth application-default login.
- Set your project with
gcloud config set project [PROJECT_ID].
- 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
- 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.