A secure MCP (Model Context Protocol) server hosted on Google Cloud Run that enables team collaboration by providing authenticated access via Google Cloud IAM, allowing teams to share custom MCP servers over the internet before official MCP authentication is implemented.
At the moment (03/04/2024) MCP is still addressing Authentication and Authorization. They plan to complete this in H1 2025. The issue is, I want to share my MCP server with my team NOW. So here we are. The only immediate answer to use a SSE MCP server in Cursor, etc.. right now is a network layer based solution (e.g., a proxy). Basic auth, api keys, forget about it.
Utilizing GCP Cloud Run and User Based IAM Authentication, I have created a simple, secure way to allow clients to access a custom MCP server over the internet.
The MCP server is hosted on Google Cloud Run. Utilizing Cloud Run IAM Authentication, we can securely connect to the server from the internet by utilizing the Google Cloud SDK to create a proxy connection.
This should work out of the box with minimal config if you already have docker and the gcloud CLI set up locally.
Step 1: Update deploy.sh
with your project id, service account email, etc.
Step 2: On deploy success, grab the cloud run URL that was provided, and add it to mcp_proxy.ts
along with your project id.
Step 3: Run the proxy npx ts-node mcp_proxy.ts
Step 3: Access your MCP server using http://localhost:3030 - Add it to Cursor under Settings > Features > MCP Servers (make sure you select SSE not command)
npm install
to install the dependenciesnpm run dev
to start the server locallyTo deploy your MCP server to Google Cloud Run:
deploy.sh
script with your project details:
PROJECT_ID
: Your Google Cloud project IDREGION
: Your preferred GCP regionSERVICE_ACCOUNT_EMAIL
: The service account email with appropriate permissionschmod +x deploy.sh
./deploy.sh
The deployment script will:
To connect to your deployed MCP server:
Run the MCP proxy locally:
npx ts-node mcp_proxy.ts
The proxy will:
Configure your MCP client to connect to the local proxy URL
npx ts-node mcp_proxy.ts
This setup provides several security benefits:
mcp_proxy.ts
matches your deployed serviceContributions are welcome! Feel free to submit issues or pull requests.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!