Google Cloud Run

by googlecloudplatform

621 stars
822 downloads
Not rated
GitHub

About

Official MCP Server to deploy to [Google Cloud Run](https://cloud.google.com/run).

Details

Author
googlecloudplatform
GitHub stars
621
Downloads
822
Categories
Cloud Service, Infrastructure, Developer Tools, Other

- Tools: deploy-file-contents, list-services, get-service, get-service-log
- Prompts: deploy and logs using current directory or default service name
- Deploy local folders and manage GCP projects (local only)
- Supports both local and remote (Cloud Run-hosted) execution
- OAuth authentication for Gemini CLI
- Configurable via environment variables for defaults and security

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Google Cloud Run
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Configure Mcp Server On Gemini Cli To Use Oauth

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.jsonfile:

{ "mcpServers": { "cloud-run": { "httpUrl": "http://localhost:3000/mcp", "oauth": { "enabled": true, "clientId": "<OAUTH_CLIENT_ID>", "clientSecret": "<OAUTH_CLIENT_SECRET>" } } } }

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:

The Google Cloud Platform Terms of Service (available athttps://cloud.google.com/terms/) and the Data Processing and Security Terms (available athttps://cloud.google.com/terms/data-processing-terms) do not apply to any component of the Cloud Run MCP Server software.

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 atCloud 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.
- Ensure you have thegcloudCLI installed and authenticated withgcloud auth loginandgcloud auth application-default login.
- Set your project withgcloud 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.

Navigate your Aiven projects and interact with the PostgreSQL®, Apache Kafka®, ClickHouse® and OpenSearch® services

Yunxiao MCP Server provides AI assistants with the ability to interact with the Yunxiao platform.

Get prescriptive CDK advice, explain CDK Nag rules, check suppressions, generate Bedrock Agent schemas, and discover AWS Solutions Constructs patterns.

This AWS Labs Model Context Protocol (MCP) server for CloudTrail enables your AI agents to query AWS account activity for security investigations, compliance auditing, and operational troubleshooting.

Core AWS MCP server providing prompt understanding and server management capabilities.

Analyze CDK projects to identify AWS services used and get pricing information from AWS pricing webpages and API.

Query and analyze your Axiom logs, traces, and all other event data in natural language

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "google cloud run": {
            "cloud-run-mcp": {
                "command": "node",
                "args": [
                    "mcp-server.js"
                ]
            }
        }
    }
}

McpServers

{
    "cloud-run-mcp": {
        "command": "node",
        "args": [
            "mcp-server.js"
        ]
    }
}
## What can you do with Google Cloud Run MCP? - **Deploy code directly to Cloud Run**— Ask the assistant to deploy file contents or a local folder using`deploy-file-contents`or`deploy-local-folder`. - **List and inspect Cloud Run services**— Retrieve services in a project and region with`list-services`, or get details for a specific service via`get-service`. - **Fetch service logs and errors**— Use`get-service-log`to pull recent logs and error messages for a named Cloud Run service. - **Discover and create GCP projects**— Locally list available projects with`list-projects`or create a new project and attach a billing account via`create-project`. - **Use natural language shortcuts**— Trigger the`deploy`prompt to deploy the current working directory, or the`logs`prompt to fetch service logs with sensible defaults. ## 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 agent SDKs, like the[Google Gen AI SDKor](https://ai.google.dev/gemini-api/docs/function-calling?example=meeting#use_model_context_protocol_mcp)[Agent Development Kit. ](https://google.github.io/adk-docs/tools/mcp-tools/)[!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. - `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. 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. The Cloud Run MCP server can be configured using the following environment variables: To install this as a](https://cloud.google.com/run/docs/host-mcp-servers)[Gemini CLIextension, run the following command: ``` `gemini extensions install https://github.com/GoogleCloudPlatform/cloud-run-mcp` ``` Log in to your Google Cloud account using the command: Set up application credentials using the command: 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: - ](https://github.com/google-gemini/gemini-cli)[**Antigravity** - ](https://antigravity.google/docs/mcp)[**Windsurf** - ](https://docs.windsurf.com/windsurf/mcp)[**VSCode** - ](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)[**Claude Desktop** - ](https://modelcontextprotocol.io/quickstart/user)[**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. 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 the](https://docs.cursor.com/context/model-context-protocol)[Google Cloud SDKand authenticate with your Google account. Log in to your Google Cloud account using the command: Set up application credentials using the command: Then configure the MCP server using either Node.js or Docker: - Install](https://cloud.google.com/sdk/docs/install)[Node.js(LTS version recommended). Update the MCP configuration file of your MCP client with the following: ``` `"cloud-run": { "command": "npx", "args": ](https://nodejs.org/en/download/)["-y", "@google-cloud/cloud-run-mcp"] }` ``` ``` `"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" } }` ``` See Docker's[MCP catalog, or use these manual instructions: Update the MCP configuration file of your MCP client with the following: ``` `"cloud-run": { "command": "docker", "args": ](https://hub.docker.com/mcp/server/cloud-run-mcp/overview)[ "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" } }` ``` [!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 SDKand authenticate with your Google account. Log in to your Google Cloud account using the command: 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. ``` `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` ``` 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](https://cloud.google.com/sdk/docs/install)[mcp-remote: ``` `"cloud-run": { "command": "npx", "args": ](https://www.npmjs.com/package/mcp-remote)["-y", "mcp-remote", "http://localhost:3000/sse"] }` ``` 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` ``` ### Configure MCP Server on Gemini CLI to use OAuth 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: ``` `{ "mcpServers": { "cloud-run": { "httpUrl": "http://localhost:3000/mcp", "oauth": { "enabled": true, "clientId": "<OAUTH_CLIENT_ID>", "clientSecret": "<OAUTH_CLIENT_SECRET>" } } } }` ``` 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: 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/)[https://cloud.google.com/terms/data-processing-terms) do not apply to any component of the Cloud Run MCP Server software. 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](https://cloud.google.com/terms/data-processing-terms)[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. - 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 ](https://github.com/GoogleCloudPlatform/cloud-run-mcp/blob/main/skills/cloud-run/SKILL.md)[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. Navigate your Aiven projects and interact with the PostgreSQL®, Apache Kafka®, ClickHouse® and OpenSearch® services Yunxiao MCP Server provides AI assistants with the ability to interact with the Yunxiao platform. Get prescriptive CDK advice, explain CDK Nag rules, check suppressions, generate Bedrock Agent schemas, and discover AWS Solutions Constructs patterns. This AWS Labs Model Context Protocol (MCP) server for CloudTrail enables your AI agents to query AWS account activity for security investigations, compliance auditing, and operational troubleshooting. Core AWS MCP server providing prompt understanding and server management capabilities. Analyze CDK projects to identify AWS services used and get pricing information from AWS pricing webpages and API. Query and analyze your Axiom logs, traces, and all other event data in natural language
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.