Google Cloud Run
Visit ProjectOfficial MCP server to deploy workloads to Google Cloud Run.
Visit ProjectCategory
Tags
What is Google Cloud Run MCP Server?
The Google Cloud Run MCP Server is a tool that allows Model Context Protocol (MCP)-compatible AI agents to deploy applications to Google Cloud Run. It acts as an intermediary server to facilitate seamless deployment of code from AI-powered IDEs, assistants, and SDKs to Cloud Run services.
How to use Google Cloud Run MCP Server?
The server can be used in two ways: locally or remotely.
Using as a Local MCP Server
- Install Node.js (LTS version recommended)
- Install and authenticate the Google Cloud SDK:
gcloud auth login gcloud auth application-default login
- Configure your MCP client with the following JSON in the MCP configuration file:
"cloud-run": { "command": "npx", "args": ["-y", "https://github.com/GoogleCloudPlatform/cloud-run-mcp"] }
Using as a Remote MCP Server
- Install and authenticate the Google Cloud SDK
- Deploy the MCP server to Cloud Run:
gcloud run deploy cloud-run-mcp --image us-docker.pkg.dev/cloudrun/container/mcp --no-allow-unauthenticated
- Set up a local proxy to securely connect to the remote server:
gcloud run services proxy cloud-run-mcp --port=3000 --region=REGION --project=PROJECT_ID
- Configure your MCP client to use the local proxy URL:
"cloud-run": { "url": "http://localhost:3000/sse" }
Key Features
- Seamless Deployment: Deploy code directly to Cloud Run from AI-powered tools.
- Multiple Deployment Options: Supports deploying from file contents, local files, and local folders.
- Service Management: List, retrieve details, and access logs for Cloud Run services.
- Project Management: List and create GCP projects (local only).
- Secure Authentication: IAM-based authentication ensures secure access to resources.
- Flexible Usage: Works with AI-assisted IDEs (e.g., Cursor, Claude) and agent SDKs (e.g., Google Gen AI SDK, Agent Development Kit).
Use Cases
- Automating deployments from AI-powered development environments.
- Simplifying the process of deploying applications to Cloud Run without manual intervention.
- Managing Cloud Run services and projects programmatically via AI agents.
- Integrating Cloud Run deployments into AI-driven workflows, such as CI/CD pipelines managed by AI.
- Providing a secure, authenticated channel for deploying applications to Cloud Run from remote locations.
FAQ
-
What is MCP?
Model Context Protocol (MCP) is a protocol designed to facilitate communication between AI agents and systems. It enables agents to interact with tools and services seamlessly.
-
Is the MCP server only for Cloud Run?
This specific MCP server is designed for deploying to Google Cloud Run. Other MCP servers may be available for different platforms.
-
Can I deploy from multiple cloud projects?
When using the remote MCP server, you can only deploy to the project where the server is running. Local executions allow deploying to any authenticated project.
-
What are the prerequisites for using this tool?
You need a Google Cloud account, the Google Cloud SDK installed, and proper IAM permissions. Node.js is required for local setup.
MCP server to deploy code to Google Cloud Run
Enable MCP-compatible AI agents to deploy apps to Cloud Run.
"mcpServers":{
"cloud-run": {
"command": "npx",
"args": ["-y", "https://github.com/GoogleCloudPlatform/cloud-run-mcp"]
}
}
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-files
*: Deploys files from the local file system to a Google 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
Use 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).
-
Install Node.js (LTS version recommended).
-
Install the Google Cloud SDK and authenticate with your Google account.
-
Log in to your Google Cloud account using the command:
gcloud auth login
-
Set up application credentials using the command:
gcloud auth application-default login
-
Update the MCP configuration file of your MCP client with the following:
"cloud-run": { "command": "npx", "args": ["-y", "https://github.com/GoogleCloudPlatform/cloud-run-mcp"] }
Use 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.
-
Install the Google Cloud SDK and authenticate with your Google account.
-
Log in to your Google Cloud account using the command:
gcloud auth login
-
Set your Google Cloud project ID using the command:
gcloud config set project YOUR_PROJECT_ID
-
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.
-
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.
-
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"] }