☁️ 🚀 Build and Deploy a remote MCP server to Cloud Run in 5 minutes
LocalAbout ☁️ 🚀 Build and Deploy a remote MCP server to Cloud Run in 5 minutes
A collection of samples and instructions for deploying remote MCP servers on Cloud Run. It is intended for developers who want a centrally hosted server that can scale with demand and require authenticated access.
Key features
- 01Cloud Run deployment sample
- 02Remote MCP server hosting
- 03Scales based on demand
- 04Centralized access for teams
- 05Authenticated request configuration
Use cases
- 01Deploying an MCP server remotely
- 02Sharing one server across a team
- 03Restricting access to authenticated requests
MCP support
The project demonstrates deploying remote MCP servers on Cloud Run, including a simple sample server. It covers remote transports such as SSE and Streamable HTTP.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP on Cloud Run
This repository contains a series of samples that demonstrate how to deploy a remote Model Context Protocol (MCP) server on Cloud Run.
Quick Start
Background
Anthropic's Model Context Protocol (MCP) is a protocol that helps you connect prompts, resources and tools (context) to an LLM.
MCP has become increasingly popular with the rise of code assistants and AI-powered IDEs for software development, as well as agentic applications that need to connect to external tools and resources.
MCP follows a client-server architecture, and for the longest time only
supported running the server locally using the stdio transport.
MCP now supports two additional transports: sse and streamable-http,
which allow for running MCP servers remotely. You can read more about
these transports in the official MCP docs.
Benefits of running an MCP server remotely
Running an MCP server remotely on Cloud Run can provide several benefits:
- 📈 Scalability: Cloud Run is built to rapidly scale out to handle all incoming requests. Cloud Run will scale your MCP server automatically based on demand.
- 👥 Centralized server: You can share your MCP server with team members in one centralized location and they can connect to it from their local machines instead of running their own servers locally. If a change is made to the MCP server, all team members will benefit from it.
- 🔐 Security: Cloud Run provides an easy way to force authenticated requests. This allows only secure connections to your MCP server, preventing unauthorized access.
Important
The security aspect mentioned above is critical. If you don't enforce authentication, anyone on the public internet can potentially access and call your MCP server.
Prerequisites
- Python 3.10+ (FastMCP requires 3.10+)
- Google Cloud SDK (gcloud)
- Git (for cloning the repository)
Installation
Clone the repository
git clone https://github.com/jackwotherspoon/mcp-on-cloudrun.git
cd mcp-on-cloudrun
Deploying the MCP Server :rocket:
The 1-deploy-mcp-server directory contains a sample that demonstrates how to deploy a simple MCP server to Cloud Run.
Follow the instructions in the 1-deploy-mcp-server/README.md file to deploy the MCP server.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.