$git clone https://github.com/GoogleCloudPlatform/cloud-run-mcpEnable MCP-compatible AI agents to deploy apps to Cloud Run.
| 1 | # Cloud Run MCP server and Gemini CLI extension |
| 2 | |
| 3 | Enable MCP-compatible AI agents to deploy apps to Cloud Run. |
| 4 | |
| 5 | ```json |
| 6 | "mcpServers":{ |
| 7 | "cloud-run": { |
| 8 | "command": "npx", |
| 9 | "args": ["-y", "@google-cloud/cloud-run-mcp"] |
| 10 | } |
| 11 | } |
| 12 | ``` |
| 13 | |
| 14 | Deploy from Gemini CLI and other AI-powered CLI agents: |
| 15 | |
| 16 | <img src="https://raw.githubusercontent.com/GoogleCloudPlatform/cloud-run-mcp/refs/heads/main/.github/images/deploycli.gif" width="800"> |
| 17 | |
| 18 | Deploy from AI-powered IDEs: |
| 19 | |
| 20 | <img src="https://raw.githubusercontent.com/GoogleCloudPlatform/cloud-run-mcp/refs/heads/main/.github/images/deploy_from_ide.gif" width="800"> |
| 21 | |
| 22 | Deploy from AI assistant apps: |
| 23 | |
| 24 | <img src="https://raw.githubusercontent.com/GoogleCloudPlatform/cloud-run-mcp/refs/heads/main/.github/images/deploy_from_apps.gif" width="800"> |
| 25 | |
| 26 | 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/). |
| 27 | |
| 28 | > [!NOTE] |
| 29 | > 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). |
| 30 | |
| 31 | ## Tools |
| 32 | |
| 33 | - `deploy-file-contents`: Deploys files to Cloud Run by providing their contents directly. |
| 34 | - `list-services`: Lists Cloud Run services in a given project and region. |
| 35 | - `get-service`: Gets details for a specific Cloud Run service. |
| 36 | - `get-service-log`: Gets Logs and Error Messages for a specific Cloud Run service. |
| 37 | |
| 38 | - `deploy-local-folder`\*: Deploys a local folder to a Google Cloud Run service. |
| 39 | - `list-projects`\*: Lists available GCP projects. |
| 40 | - `create-project`\*: Creates a new GCP project and attach it to the first available billing account. A project ID can be optionally specified. |
| 41 | |
| 42 | _\* only available when running locally_ |
| 43 | |
| 44 | ## Prompts |
| 45 | |
| 46 | Prompts are natural language commands that can be used to perform common tasks. They are shortcuts for executing tool calls with pre-filled arguments. |
| 47 | |
| 48 | - `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. |
| 49 | - `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. |
| 50 | |
| 51 | ## Environment Variables |
| 52 | |
| 53 | The Cloud Run MCP server can be configured using the following environment variables: |
| 54 | |
| 55 | | Variable | Description | |
| 56 | | :----------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 57 | | `GOOGLE_CLOUD_PROJECT` | The default project ID to use for Cloud Run services. | |
| 58 | | `GOOGLE_CLOUD_REGION` | The default region to use for Cloud Run services. | |
| 59 | | `DEFAULT_SERVICE_NAME` | The default service name to use for Cloud Run services. | |
| 60 | | `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. | |
| 61 | | `ENABLE_HOST_VALIDATION` | Prevents [DNS Rebinding](https://en.wikipedia.org/wiki/DNS_rebinding) attacks by validating the Host header. This |