Authenticated MCP SSE Server
Google Cloud Run で MCP SSE サーバーをホストする
現時点では(2024年3月4日)、MCPは認証と認可の対応に取り組んでいます。2025年上半期には完了する予定です。問題は、今すぐにでもMCPサーバーをチームと共有したいということです。それで、今の状況です。CursorなどでSSE MCPサーバーを使用する唯一の即効性のある解決策は、ネットワーク層ベースのソリューション(例:プロキシ)です。Basic認証やAPIキーは諦めましょう。
GCP Cloud Run とユーザーベースの IAM 認証を利用して、クライアントがインターネット経由でカスタム MCP サーバーにアクセスできるようにするシンプルで安全な方法を作成しました。

仕組み
MCPサーバーはGoogle Cloud Runでホストされています。Cloud Run IAM認証を利用することで、Google Cloud SDKを使用してプロキシ接続を作成し、インターネットから安全にサーバーに接続できます。
TLDR README
すでに docker と gcloud CLI がローカルにセットアップされている場合は、最小限の設定ですぐに使用できるはずです。
**ステップ 1:**プロジェクト ID、サービス アカウントのメールなどを使用してdeploy.sh更新します。
**ステップ 2:**デプロイが成功したら、提供されたクラウド実行 URL を取得し、プロジェクト ID とともにmcp_proxy.tsに追加します。
**ステップ3:**プロキシnpx ts-node mcp_proxy.tsを実行する
ステップ 3: http://localhost:3030を使用して MCP サーバーにアクセスします - [設定] > [機能] > [MCP サーバー] の下にあるカーソルに追加します (コマンドではなく SSE を選択してください)
長くて退屈なREADME
Related MCP server: MCP Authentication Demo
展開手順
リポジトリをクローンする
npm install実行して依存関係をインストールしますnpm run devを実行してローカルでサーバーを起動します。
Google Cloud Runへのデプロイ
MCP サーバーを Google Cloud Run にデプロイするには:
Google Cloud SDKがインストールされていることを確認してください
プロジェクトの詳細で
deploy.shスクリプトを更新します。PROJECT_ID: Google Cloud プロジェクト IDREGION: ご希望の GCP リージョンSERVICE_ACCOUNT_EMAIL: 適切な権限を持つサービスアカウントのメールアドレス
デプロイメント スクリプトを実行します。
chmod +x deploy.sh ./deploy.sh
デプロイメント スクリプトは次の処理を実行します。
MCPサーバー用のDockerコンテナを構築する
Google Container Registry にプッシュする
認証を有効にして Cloud Run にデプロイする
デプロイされたMCPサーバーに接続する
デプロイされた MCP サーバーに接続するには:
MCP プロキシをローカルで実行します。
npx ts-node mcp_proxy.tsプロキシは次のことを行います。
Google Cloud で認証されているか確認する
認証トークンを自動的に取得する
ローカルプロキシサーバーを作成します(デフォルト: http://localhost:3030 )
認証されたリクエストを Cloud Run サービスに転送する
MCPクライアントをローカルプロキシURLに接続するように設定する
カーソルでMCPサーバーを使用する
まず、プロキシを実行して、ローカルマシンと Google Cloud Run でホストされている MCP サーバー間の接続を確立します。
npx ts-node mcp_proxy.ts次に、MCP サーバー セクションの [設定] > [機能] タブ内で、ローカル プロキシ サーバーをカーソルに追加します。


さあ、準備完了です!新しいコンポーザーを起動し(エージェントモードになっていることを確認してください)、特定の場所の天気を調べてみましょう。プロキシが接続されているターミナルの出力とコンポーザーの出力を合わせると、以下のようになります。

安全
この設定により、セキュリティ上の利点がいくつか得られます。
MCP サーバーは認証なしでは公開できません
すべての接続はGoogle Cloud IAMで保護されています
チームメンバーが接続するにはGoogle Cloud SDKへのアクセスが必要です
接続の問題
mcp_proxy.tsの Cloud Run URL がデプロイされたサービスと一致していることを確認します。Cloud Run ログでサーバー側のエラーがないか確認する
貢献
貢献を歓迎します!お気軽に問題やプルリクエストを送信してください。
ライセンス
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Cloud-hosted MCP server for durable AI memory
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
The Google Compute Engine MCP server is a fully-managed Model Context Protocol server that provides tools to manage Google Compute Engine resources through AI agents. It enables capabilities including instance management (creating, starting, stopping, resetting, listing), disk management, handling instance templates and group managers, viewing machine and accelerator types, managing images, and accessing reservation and commitment information. The server operates as a zero-deployment, enterprise-grade endpoint at https://compute.googleapis.com/mcp with built-in IAM-based security.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA secure MCP server example that demonstrates how to deploy to Google Cloud Run with authentication and identity token protection. Serves as a tutorial template for building production-ready MCP servers in the cloud.-
- FlicenseNot gradedqualityDmaintenanceA production-ready MCP server with OAuth 2.1 authentication, enabling authenticated MCP tool calls via Google OAuth.-
- FlicenseNot gradedqualityNot gradedmaintenanceRemote MCP server with built-in OAuth authentication via Cloudflare Access, enabling secure tool usage like math and image generation with user-based access control.-
- FlicenseNot gradedqualityDmaintenanceRemote MCP server with built-in OAuth authentication via Cloudflare Access, enabling secure tool invocation after user sign-in.-
Appeared in Searches
- Google Cloud Platform (GCP) resources and information
- Information about SSE (possible meanings: Scottish and Southern Energy, Server-Sent Events, etc.)
- Finding MCP servers that support SSE or Streamable HTTP, excluding stdio transport
- How to Submit an Outpatient Medical Claim to AIA
- Information about Google Cloud Services