grok-mcp-cloudrun
Grok plugin for deploying and managing Google Cloud Run services via MCP tools, slash commands, and a skill.
README
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
- What you get
- Prerequisites
- Quick start
- Installation
- Quick test (deploy + curl)
- Daily usage
- Configuration reference
- Troubleshooting
- Project layout
- Hosted MCP vs local plugin
- License
What you get
| Component | What it does |
|---|---|
| MCP server | Deploy folders, list services, fetch logs via cloud-run__* tools |
| Skill | cloud-run — MCP-first workflow with gcloud fallback |
| Slash commands | /deploy and /logs |
| Hooks | Warns if no GCP project is set; blocks create-project by default |
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_ID
2. 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 basename
3. 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 | roles/run.admin — or roles/run.developer + roles/iam.serviceAccountUser |
| Logs | roles/logging.viewer + Cloud Run read access |
| Source upload | roles/storage.admin, roles/artifactregistry.writer (as needed by your build) |
5. Verify MCP connectivity
grok mcp doctor cloud-run
Expected 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 inspect
Open 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-run
The --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.0
Or 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 = 600
Quick 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/nodejs
Upstream 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-test
Grok 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-test
Or from the shell:
gcloud run services logs read hello-test \
--region="${GOOGLE_CLOUD_REGION:-us-central1}" \
--limit=20
Step 5 — Clean up (optional)
gcloud run services delete hello-test \
--region="${GOOGLE_CLOUD_REGION:-us-central1}" \
--quiet
Daily usage
Slash commands
| Command | Action |
|---|---|
/deploy |
Deploy cwd; service name = directory basename |
/deploy my-api |
Deploy cwd as my-api |
/logs |
Logs for default service name |
/logs my-api |
Logs for my-api |
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 |
|---|---|
cloud-run__deploy-local-folder |
Deploy cwd to Cloud Run |
cloud-run__deploy-file-contents |
Deploy files by content (remote mode) |
cloud-run__list-services |
List services in project/region |
cloud-run__get-service |
Service details and public URL |
cloud-run__get-service-log |
Recent logs and errors |
cloud-run__list-projects |
List GCP projects |
cloud-run__create-project |
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 |
|---|---|---|
GOOGLE_CLOUD_PROJECT |
— | GCP project for all operations |
GOOGLE_CLOUD_REGION |
us-central1 |
Cloud Run region |
DEFAULT_SERVICE_NAME |
cwd basename | Default name for /deploy and /logs |
SKIP_IAM_CHECK |
true (upstream) |
When true, new services may be publicly accessible |
CONFIRM_CLOUD_RUN_CREATE_PROJECT |
unset | Set to 1 to allow create-project (hook blocks it otherwise) |
CONFIRM_CLOUD_RUN_PROD_DEPLOY |
unset | Set to 1 to deploy when project ID looks like production |
Safety hooks
The plugin ships hooks/hooks.json:
- SessionStart — warns if neither
GOOGLE_CLOUD_PROJECTnor agclouddefault project is set; warns if ADC is missing - PreToolUse — blocks
cloud-run__create-projectunlessCONFIRM_CLOUD_RUN_CREATE_PROJECT=1 - PreToolUse — 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 |
|---|---|
grok mcp doctor cloud-run fails |
gcloud auth application-default login |
| MCP starts but deploy fails with auth error | Re-run ADC login; confirm GOOGLE_CLOUD_PROJECT |
| Cold start / connection timeout | Set startup_timeout_sec = 60 in config |
| Deploy hangs or times out | Set tool_timeouts = { deploy-local-folder = 600 } |
Permission denied on deploy |
Check IAM roles in Prerequisites |
| Plugin MCP shows blocked | Reinstall with grok plugin install ... --trust |
| Plugin installed but tools missing | grok plugin enable cloud-run |
curl returns 403 |
Service may not be public; check IAM or set SKIP_IAM_CHECK=false and add allUsers invoker binding |
curl connection refused right after deploy |
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 ADC
Marketplace
Install from GitHub:
grok plugin install gprot42/grok-mcp-cloudrun --trust
grok plugin enable cloud-run
To 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 guide
Hosted 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 npx |
POST /mcp or GET /sse |
/deploy (local folder) |
Works | Not available |
| Deploy by file contents | Yes | Yes |
| Browser at service URL | N/A | Cannot GET / (expected — no web UI) |
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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。