-
Notifications
You must be signed in to change notification settings - Fork 615
[DOCS]: Add Google Cloud Run deployment guide #30
Description
📚 Documentation Issue Summary
The documentation currently lacks a guide for deploying MCP Gateway to [Google Cloud Run](https://cloud.google.com/run), a fully managed serverless platform for containers with automatic HTTPS, scale-to-zero, and built-in support for Cloud SQL and Memorystore (Redis).
📍 Location of the Problem
Suggested location:
docs/docs/deployment/google-cloud-run.md
✏️ Type of Issue
- Missing explanation or example
- Unclear deployment coverage
💡 Suggested Fix or Clarification
Create a new deployment guide following the format used in docs/docs/deployment/ibm-code-engine.md. Include end-to-end setup for Cloud SQL (Postgres), Memorystore (Redis), JWT auth, and curl-based health checks.
✅ Overview
- Explain Cloud Run as a secure, auto-scaling container platform.
- Emphasize native support for HTTPS, public endpoints, and scaling down to zero.
- Note that the
ghcr.io/ibm/mcp-context-forge:latestimage can be used directly—no build required.
🛠 Prerequisites
-
Google Cloud account + billing enabled
-
gcloudCLI installed and initialized -
Required services enabled:
run.googleapis.comsqladmin.googleapis.comredis.googleapis.com
-
PostgreSQL and Redis instances created
-
.envvalues ready (JWT_SECRET_KEY,DATABASE_URL,REDIS_URL)
⚙️ Setup Steps
1. Provision Cloud SQL (Postgres)
gcloud sql instances create mcpgw-db \
--database-version=POSTGRES_14 \
--cpu=2 --memory=4GiB --region=us-central1
gcloud sql users set-password postgres \
--instance=mcpgw-db --password=mysecretpassword
gcloud sql databases create mcpgw --instance=mcpgw-db2. Provision Memorystore (Redis)
gcloud redis instances create mcpgw-redis \
--region=us-central1 \
--tier=STANDARD_HA \
--size=13. Deploy to Cloud Run
gcloud run deploy mcpgateway \
--image=ghcr.io/ibm/mcp-context-forge:latest \
--region=us-central1 \
--platform=managed \
--allow-unauthenticated \
--port=4444 \
--cpu=2 --memory=2Gi \
--set-env-vars=\
JWT_SECRET_KEY=your-secret,\
BASIC_AUTH_USER=admin,\
BASIC_AUTH_PASSWORD=changeme,\
AUTH_REQUIRED=true,\
DATABASE_URL=postgresql://postgres:mysecretpassword@<SQL_IP>:5432/mcpgw,\
REDIS_URL=redis://<REDIS_IP>:6379/0,\
CACHE_TYPE=redis🔒 Auth & Access
Generate a JWT token:
docker run -it --rm ghcr.io/ibm/mcp-context-forge:latest \
python3 -m mcpgateway.utils.create_jwt_token -u adminCall a protected endpoint:
curl -H "Authorization: Bearer $MCPGATEWAY_BEARER_TOKEN" \
https://<your-cloud-run-url>/tools📝 Features to Document
- Native HTTPS with no TLS config
- Environment injection via
--set-env-vars - JWT generation via CLI or container run
- Postgres + Redis integration via GCP IPs
- Optional: build automation via GitHub Actions (
deploy-gcr.yml)
🧩 Additional Notes
- Use
gcloud sql instances describeandgcloud redis instances describeto get IPs - Align structure and tone with
ibm-code-engine.mdfor consistency - Cloud Run supports public/private endpoints, autoscaling, and container revision history
- Consider linking to
cloudbuild.yamlor GitHub CI workflows if build automation is added later