
adamsiwiec1/mcp-sse-authenticated-cloud-run
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
Cloud Run에서 모델 Context Protocol SSE 배포를 호스팅합니다. IAM 인증을 받았습니다.
개요
현재 (03/04/2024) MCP는 여전히 인증 및 권한이 부여됩니다. 그들은 H1 2025에서 이것을 완료 할 계획입니다. 문제는, 나는 내 팀과 함께 MCP 서버를 공유하고 싶습니다. 그래서 여기 우리는. Cursor, etc.에서 SSE MCP 서버를 사용하는 유일한 즉각적인 대답은 이제 네트워크 계층 기반 솔루션 (예 : 프록시)입니다. Basic auth, api 키, 그것에 대해 잊지. GCP Cloud Run 및 User Based IAM Authentication을 활용하면 인터넷에서 사용자 정의 MCP 서버에 액세스 할 수있는 간단하고 안전한 방법을 만들었습니다. MCP 서버는 Google Cloud Run에서 호스팅됩니다. Cloud Run IAM 인증 활용, Google Cloud SDK를 사용하여 인터넷에서 서버에 안전하게 연결하여 프록시 연결을 만들 수 있습니다. 이 *** 이미 Docker와 gcloud CLI가 로컬로 설정하면 최소한의 설정이 있습니다. 프로젝트 ID, 서비스 계정 이메일 등과 함께 deploy.sh를 업데이트하십시오. 배포 성공에, 제공 된 클라우드 실행 URL을 잡아, mcp proxy에 추가.
개요(AI 번역)
현재 (03/04/2024) MCP는 여전히 인증 및 권한이 부여됩니다. 그들은 H1 2025에서 이것을 완료 할 계획입니다. 문제는, 나는 내 팀과 함께 MCP 서버를 공유하고 싶습니다. 그래서 여기 우리는. Cursor, etc.에서 SSE MCP 서버를 사용하는 유일한 즉각적인 대답은 이제 네트워크 계층 기반 솔루션 (예 : 프록시)입니다. Basic auth, api 키, 그것에 대해 잊지.
GCP Cloud Run 및 User Based IAM Authentication을 활용하면 인터넷에서 사용자 정의 MCP 서버에 액세스 할 수있는 간단하고 안전한 방법을 만들었습니다.
MCP 로드맵
어떻게 작동합니까?
MCP 서버는 Google Cloud Run에서 호스팅됩니다. Cloud Run IAM 인증 활용, Google Cloud SDK를 사용하여 인터넷에서 서버에 안전하게 연결하여 프록시 연결을 만들 수 있습니다.
TLDR 읽기
이 *** 최소 설정으로 상자 ***에서 작업을 수행하면 도커와 gcloud CLI가 로컬로 설정됩니다.
Step 1: 프로젝트 ID, 서비스 계정 이메일 등의 업데이트 deploy.sh
** 단계 2:** 배포 성공에, 제공 된 클라우드 실행 URL을 잡아, 당신의 프로젝트 ID와 함께 mcp_proxy.ts에 추가.
** 단계 3:** 프록시 실행 npx ts-node mcp_proxy.ts
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
Host MCP SSE Server on Google Cloud Run
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.
How it works
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.
TLDR README
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)
LONG BORING README
Deployment Steps
- Clone the repository
- Run
npm installto install the dependencies - Run
npm run devto start the server locally
Deployment to Google Cloud Run
To deploy your MCP server to Google Cloud Run:
- Make sure you have the Google Cloud SDK installed
- Update the
deploy.shscript with your project details:PROJECT_ID: Your Google Cloud project IDREGION: Your preferred GCP regionSERVICE_ACCOUNT_EMAIL: The service account email with appropriate permissions
- Run the deployment script:
chmod +x deploy.sh ./deploy.sh
The deployment script will:
- Build a Docker container for your MCP server
- Push it to Google Container Registry
- Deploy it to Cloud Run with authentication enabled
Connecting to your deployed MCP server
To connect to your deployed MCP server:
-
Run the MCP proxy locally:
npx ts-node mcp_proxy.ts -
The proxy will:
- Check if you’re authenticated with Google Cloud
- Obtain authentication tokens automatically
- Create a local proxy server (default: http://localhost:3030)
- Forward authenticated requests to your Cloud Run service
-
Configure your MCP client to connect to the local proxy URL
Use the MCP server in Cursor
설치
npx ts-node mcp_proxy.ts