How googlecloudplatform/cloud-run-mcp works
Cloud Run MCP exposes project and service-management tools plus deployment and log prompts to AI clients. The principal workflow is an agent tool call through MCP registration into deployment orchestration, which prepares source or an image and deploys a Cloud Run service; separate tools list projects and inspect services/logs. The README documents local-folder, file-content, and image deployment, and local project creation. The sampled sources establish several orchestration calls, but not every internal deployment step, so uncertain wiring is omitted.
Main entry points: deployer.js Deployment orchestration · register-tools.js Tool registration · run.js Service operations · mcp-server.js MCP server
Components 23
MCP interface
- MCP server
mcp-server.js - Tool registration
tools/register-tools.js - Tool handlers
tools/tools.js - Prompt templates
prompts.js
Deployment
- Deployment orchestration
lib/deployment/deployer.js - Source preparation
lib/deployment/source-processor.js - Universal Maker
lib/deployment/universal-maker.js - Deployment helpers
lib/deployment/helpers.js
Cloud API
- Project operations
lib/cloud-api/projects.js - Service operations
lib/cloud-api/run.js - Cloud Build
lib/cloud-api/build.js - Artifact Registry
lib/cloud-api/registry.js - Storage operations
lib/cloud-api/storage.js
Authentication
- GCP client cache
lib/clients.js - ADC check
lib/cloud-api/auth.js - OAuth middleware
lib/middleware/oauth.js
Other components
- AI agent
- Google Cloud
- Cloud Run
- Cloud Build service
- Artifact Registry service
- Cloud Storage
- Cloud Logging
Connections 23
- AI agent → MCP server: sends MCP requests
- MCP server → Tool registration: registers tools
- MCP server → Prompt templates: provides prompts
- Tool registration → Project operations: lists or creates projects
- Tool registration → Service operations: lists and inspects services
- Tool registration → Deployment orchestration: requests deployment
- Deployment orchestration → Service operations: checks services
- Deployment orchestration → Artifact Registry: ensures repository
- Deployment orchestration → Cloud Build: triggers build
- Deployment orchestration → Universal Maker: analyzes source
- Deployment orchestration → Source preparation: cleans temporary files
- Deployment orchestration → Deployment helpers: checks build mode
- Deployment orchestration → Cloud Run: creates or updates service
- Cloud Build → Cloud Build service: starts build
- Artifact Registry → Artifact Registry service: manages repository
- Storage operations → Cloud Storage: creates buckets and uploads
- Project operations → Google Cloud: manages projects
- Service operations → Cloud Run: reads services and logs
- Service operations → Cloud Logging: reads logs
- GCP client cache → Google Cloud: creates authenticated clients
- ADC check → Google Cloud: checks credentials
- OAuth middleware → GCP client cache: gets OAuth client
- OAuth middleware → AI agent: rejects unauthenticated calls