Cloud Run MCP server and Gemini CLI extension
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Enable MCP-compatible AI agents to deploy apps to Cloud Run.
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 as a Gemini CLI extension
To install this as a Gemini CLI extension, run the following command:
2. Install the extension:
3. Log in to your Google Cloud account using the command:
4. Set up application credentials using the command:
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:
- **Antigravity**
- **Windsurf**
- **VSCode**
- **Claude Desktop**
- **Cursor**
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).