grok-mcp-cloudrun
Provides tools for deploying and managing Google Cloud Run services, including listing services, fetching logs, and deploying local folders to Cloud Run.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@grok-mcp-cloudrundeploy the current folder as 'my-service'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
grok-mcp-cloudrun
Grok plugin for deploying and managing Google Cloud Run services.
Deploy and manage Cloud Run from Grok using
MCP tools, slash commands, and a Cloud Run skill. This repo is a thin wrapper
around Google's open-source
@google-cloud/cloud-run-mcp
— it does not fork or vendor the upstream server.
Not affiliated with Google. See NOTICE for upstream attribution.
See GROK-CHANGES.md for a full list of Grok-specific additions and lessons learned from testing.
Table of contents
Related MCP server: Cloud Run MCP Server
What you get
Component | What it does |
MCP server | Deploy folders, list services, fetch logs via |
Skill |
|
Slash commands |
|
Hooks | Warns if no GCP project is set; blocks |
Prerequisites
Install and authenticate before anything else.
1. Google Cloud SDK
gcloud auth login
gcloud auth application-default login
gcloud config set project YOUR_PROJECT_ID2. Environment variables
export GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID
export GOOGLE_CLOUD_REGION=us-central1 # optional, defaults to us-central1
export DEFAULT_SERVICE_NAME= # optional, defaults to cwd basename3. Node.js
Node.js LTS is required for npx to spawn the MCP server.
4. IAM roles
Your account needs permission to deploy and read Cloud Run resources:
Action | Minimum roles |
Deploy |
|
Logs |
|
Source upload |
|
5. Verify MCP connectivity
grok mcp doctor cloud-runExpected output: Found 1 healthy, 0 failing with 8 tools discovered.
Quick start
If this repo is already on your machine:
# Install and trust the plugin
grok plugin install /path/to/grok-mcp-cloudrun --trust
grok plugin enable cloud-run
# Confirm everything loaded
grok plugin validate /path/to/grok-mcp-cloudrun
grok inspectOpen Grok and check:
/plugins—cloud-runis enabled/mcps—cloud-runserver shows 8 tools/skills—cloud-runskill is listed
Installation
Choose one path. Do not enable both with the same server name — pick plugin or bare MCP config.
Option A: Plugin (recommended)
Includes skills, slash commands, and safety hooks.
grok plugin install /path/to/grok-mcp-cloudrun --trust
grok plugin enable cloud-runThe --trust flag is required for MCP servers and hooks to activate.
Option B: MCP config only
For personal use without the plugin wrapper:
grok mcp add cloud-run \
-e GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID \
-e GOOGLE_CLOUD_REGION=us-central1 \
-- npx -y @google-cloud/cloud-run-mcp@1.10.0Or add manually to ~/.grok/config.toml:
[mcp_servers.cloud-run]
command = "npx"
args = ["-y", "@google-cloud/cloud-run-mcp@1.10.0"]
enabled = true
startup_timeout_sec = 60
[mcp_servers.cloud-run.env]
GOOGLE_CLOUD_PROJECT = "${GOOGLE_CLOUD_PROJECT}"
GOOGLE_CLOUD_REGION = "${GOOGLE_CLOUD_REGION:-us-central1}"
DEFAULT_SERVICE_NAME = "${DEFAULT_SERVICE_NAME:-}"
[mcp_servers.cloud-run.tool_timeouts]
deploy-local-folder = 600Quick test (deploy + curl)
End-to-end smoke test: clone a sample app, deploy it from Grok, then hit it with
curl.
Step 1 — Clone the sample
git clone https://github.com/GoogleCloudPlatform/cloud-run-mcp.git /tmp/cloud-run-mcp
cd /tmp/cloud-run-mcp/example-sources-to-deploy/nodejsUpstream also provides golang, java, and python samples in the same
directory.
Step 2 — Deploy from Grok
In a Grok session (with this directory as your working folder):
/deploy hello-testGrok calls cloud-run__deploy-local-folder and returns a public HTTPS URL when
the deploy finishes. First deploy can take several minutes (Cloud Build +
container push).
Step 3 — Verify with curl
Use the URL from the deploy response, or look it up with gcloud:
# Option A: URL from /deploy output
curl -sS https://hello-test-XXXXXXXX-uc.a.run.app/
# Option B: resolve URL via gcloud
SERVICE_URL=$(gcloud run services describe hello-test \
--region="${GOOGLE_CLOUD_REGION:-us-central1}" \
--project="${GOOGLE_CLOUD_PROJECT}" \
--format='value(status.url)')
curl -sS "$SERVICE_URL/"Expected response:
Hello from Node.js on Cloud Run!Health check:
curl -sS -o /dev/null -w "HTTP %{http_code}\n" "$SERVICE_URL/health"Expected: HTTP 200
Step 4 — Check logs
Back in Grok:
/logs hello-testOr from the shell:
gcloud run services logs read hello-test \
--region="${GOOGLE_CLOUD_REGION:-us-central1}" \
--limit=20Step 5 — Clean up (optional)
gcloud run services delete hello-test \
--region="${GOOGLE_CLOUD_REGION:-us-central1}" \
--quietDaily usage
Slash commands
Command | Action |
| Deploy cwd; service name = directory basename |
| Deploy cwd as |
| Logs for default service name |
| Logs for |
Natural language prompts
"List Cloud Run services in
my-projectregionus-central1""Deploy the current folder to Cloud Run"
"Get the URL for service
hello-test""Show me recent errors in Cloud Run logs for
my-api"
MCP tools
Grok namespaces tools as cloud-run__<tool>:
Tool | Purpose |
| Deploy cwd to Cloud Run |
| Deploy files by content (remote mode) |
| List services in project/region |
| Service details and public URL |
| Recent logs and errors |
| List GCP projects |
| Create project (blocked by default hook) |
Discover tools at runtime with search_tool, then call with use_tool.
Configuration reference
Environment variables
Variable | Default | Description |
| — | GCP project for all operations |
|
| Cloud Run region |
| cwd basename | Default name for |
|
| When |
| unset | Set to |
| unset | Set to |
Safety hooks
The plugin ships hooks/hooks.json:
SessionStart — warns if neither
GOOGLE_CLOUD_PROJECTnor agclouddefault project is set; warns if ADC is missingPreToolUse — blocks
cloud-run__create-projectunlessCONFIRM_CLOUD_RUN_CREATE_PROJECT=1PreToolUse — blocks deploy tools to production-like projects unless
CONFIRM_CLOUD_RUN_PROD_DEPLOY=1
Timeouts
Cold npx downloads can exceed the default 30s startup timeout. This repo's
config uses:
startup_timeout_sec = 60tool_timeouts.deploy-local-folder = 600(10 min for first deploy)
Troubleshooting
Symptom | Fix |
|
|
MCP starts but deploy fails with auth error | Re-run ADC login; confirm |
Cold start / connection timeout | Set |
Deploy hangs or times out | Set |
| Check IAM roles in Prerequisites |
Plugin MCP shows blocked | Reinstall with |
Plugin installed but tools missing |
|
| Service may not be public; check IAM or set |
| Wait 30–60s for the new revision to become ready, then retry |
Diagnostic commands
./scripts/verify-setup.sh # full Phase 3 checklist
grok mcp doctor cloud-run # MCP health
grok plugin validate . # plugin manifest
grok inspect # skills, commands, hooks, MCP inventory
grok plugin list # installed plugins
gcloud auth application-default print-access-token # confirm ADCMarketplace
Install from GitHub:
grok plugin install gprot42/grok-mcp-cloudrun --trust
grok plugin enable cloud-runTo submit to the official xAI marketplace, see MARKETPLACE.md.
Project layout
grok-mcp-cloudrun/
├── .mcp.json # MCP server config (Grok primary)
├── .claude-plugin/plugin.json # Claude-ecosystem compat
├── .grok-plugin/plugin.json # Marketplace manifest
├── plugin.json # Plugin metadata
├── commands/
│ ├── deploy.md # /deploy slash command
│ └── logs.md # /logs slash command
├── hooks/hooks.json # SessionStart + PreToolUse safety
├── skills/cloud-run/SKILL.md # MCP-first Cloud Run workflow
├── LICENSE # Apache 2.0 (upstream)
├── NOTICE # Upstream attribution
└── README.md # This guideHosted MCP vs local plugin
This plugin runs the MCP server locally via stdio
(npx @google-cloud/cloud-run-mcp). That is what powers /deploy, which calls
cloud-run__deploy-local-folder on your current working directory.
If you deploy the upstream MCP server itself to Cloud Run, it behaves differently:
Local plugin (this repo) | Hosted on Cloud Run | |
Transport | stdio via |
|
| Works | Not available |
Deploy by file contents | Yes | Yes |
Browser at service URL | N/A |
|
To verify a hosted MCP deployment, send an MCP initialize request to /mcp
(see GROK-CHANGES.md).
For Grok day-to-day use, install this plugin — do not point Grok at a public Cloud Run URL without IAM authentication.
License
Apache License 2.0. See LICENSE and NOTICE.
Upstream MCP server:
GoogleCloudPlatform/cloud-run-mcp
· npm: @google-cloud/cloud-run-mcp@1.10.0
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/gprot42/grok-mcp-cloudrun'
If you have feedback or need assistance with the MCP directory API, please join our Discord server