The MCP server for Cloud Run enables AI agents to deploy applications to Google Cloud Run through a standardized interface. It allows for deployments from various AI-powered environments including CLI tools, IDEs, assistant apps, and agent SDKs.
mkdir -p ~/.gemini/extensions/cloud-run/gemini-extension && \
curl -s -L https://raw.githubusercontent.com/GoogleCloudPlatform/cloud-run-mcp/main/gemini-extension.json > ~/.gemini/extensions/cloud-run/gemini-extension.json && \
curl -s -L https://raw.githubusercontent.com/GoogleCloudPlatform/cloud-run-mcp/main/gemini-extension/GEMINI.md > ~/.gemini/extensions/cloud-run/gemini-extension/GEMINI.md
gcloud auth login
gcloud auth application-default login
"mcpServers": {
"cloud-run": {
"command": "npx",
"args": ["-y", "@google-cloud/cloud-run-mcp"]
}
}
"mcpServers": {
"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"
}
}
}
"mcpServers": {
"cloud-run": {
"command": "docker",
"args": [
"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"
}
}
}
Install the Google Cloud SDK
Authenticate with Google Cloud:
gcloud auth login
Set your Google Cloud project:
gcloud config set project YOUR_PROJECT_ID
Deploy the MCP server to Cloud Run:
gcloud run deploy cloud-run-mcp --image us-docker.pkg.dev/cloudrun/container/mcp --no-allow-unauthenticated
(Optional) Configure environment variables:
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 local proxy to connect securely:
gcloud run services proxy cloud-run-mcp --port=3000 --region=REGION --project=PROJECT_ID
Update your MCP client configuration:
"mcpServers": {
"cloud-run": {
"url": "http://localhost:3000/sse"
}
}
Alternatively, if your client doesn't support the url
attribute:
"mcpServers": {
"cloud-run": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:3000/sse"]
}
}
deploy-file-contents
: Deploy files to Cloud Run by providing their contents directlylist-services
: List Cloud Run services in a project and regionget-service
: Get details for a specific Cloud Run serviceget-service-log
: Get logs and error messages for a servicedeploy-local-folder
: Deploy a local folder to Cloud Runlist-projects
: List available GCP projectscreate-project
: Create a new GCP project with billing accountThe MCP server supports natural language prompts as shortcuts for common tasks:
deploy
: Deploy the current directory to Cloud Runlogs
: Get logs for a Cloud Run serviceIf service names aren't specified, the server will use either the DEFAULT_SERVICE_NAME
environment variable or the current directory name.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "cloud-run" '{"command":"npx","args":["-y","https://github.com/GoogleCloudPlatform/cloud-run-mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cloud-run": {
"command": "npx",
"args": [
"-y",
"https://github.com/GoogleCloudPlatform/cloud-run-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"cloud-run": {
"command": "npx",
"args": [
"-y",
"https://github.com/GoogleCloudPlatform/cloud-run-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect