MCP HTTP Proxy
MCP HTTP 프록시
stdio 기반의 모든 MCP 서버(예: @browsermcp/mcp)를 HTTP/SSE 전송을 통해 인터넷에 노출합니다. 네트워크를 통해 MCP 도구에 액세스해야 하는 원격 에이전트에 적합합니다.
기능
🌐 표준 MCP SSE 전송 - MCP HTTP 전송 사양을 따름
🔐 API 키 인증 - Bearer 토큰을 통한 보안 액세스
🚀 다양한 노출 옵션 - Tailscale, ngrok, Cloudflare Tunnel
🔄 세션 관리 - 다중 동시 세션 지원
📦 모든 MCP 서버와 호환 - 기본값으로
@browsermcp/mcp사용
Related MCP server: MCP SSE Proxy
빠른 시작
1. 의존성 설치
npm install2. 구성 (선택 사항)
cp .env.example .env
# Edit .env to set your API key보안 API 키 생성:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"3. 빌드 및 실행
npm run build
npm start또는 개발용:
npm run devAPI 엔드포인트 (표준 MCP SSE 전송)
엔드포인트 | 메서드 | 설명 |
| GET | SSE 연결 수립 (엔드포인트 URL 반환) |
| POST | JSON-RPC 메시지 전송 |
| GET | 상태 확인 (인증 불필요) |
| GET | 활성 세션 목록 (인증 필요) |
인터넷에 노출하기
옵션 1: Tailscale (개인 액세스 권장)
Tailscale은 공용 인터넷에 노출하지 않고도 안전한 개인 액세스를 제공합니다.
# Install Tailscale if not already installed
# Then serve via Tailscale
tailscale serve --bg --http 3000또는 Tailscale IP를 직접 사용:
tailscale status # Find your Tailscale IPMCP 서버는 다음 주소에서 사용할 수 있습니다:
https://your-machine.tailnet-name.ts.net(serve 사용 시)http://your-tailscale-ip:3000(직접 IP)
에이전트에서 사용:
{
"mcpServers": {
"browser-remote": {
"url": "http://your-tailscale-ip:3000/sse",
"headers": {
"Authorization": "Bearer your-api-key"
}
}
}
}옵션 2: ngrok (공용 URL)
# Install ngrok if not already installed
ngrok http 3000ngrok은 https://abc123.ngrok.io와 같은 공용 URL을 제공합니다.
옵션 3: Cloudflare Tunnel
# Install cloudflared if not already installed
cloudflared tunnel --url http://localhost:3000SSE 전송 작동 방식
클라이언트가
/sse에 GET 요청 - 서버가 세션을 생성하고 메시지 URL이 포함된endpoint이벤트를 전송합니다.클라이언트가
/message?sessionId=xxx에 POST 요청 - 서버가 JSON-RPC를 MCP 프로세스로 전달합니다.서버가 응답 스트리밍 - MCP 응답이 SSE
message이벤트로 전송됩니다.
사용 예시
상태 확인 테스트
curl http://localhost:3000/health응답:
{
"status": "healthy",
"sessions": 0,
"uptime": 10.5,
"transport": "sse",
"endpoints": {
"sse": "/sse (GET - establishes SSE connection)",
"message": "/message?sessionId=xxx (POST - send JSON-RPC messages)"
}
}SSE를 통한 연결 (JavaScript)
const eventSource = new EventSource('http://localhost:3000/sse', {
headers: { 'Authorization': 'Bearer your-api-key' }
});
eventSource.addEventListener('endpoint', (e) => {
console.log('Message endpoint:', e.data);
// e.data = "/message?sessionId=xxx"
});
eventSource.addEventListener('message', (e) => {
console.log('MCP response:', JSON.parse(e.data));
});MCP 요청 전송
curl -X POST "http://localhost:3000/message?sessionId=your-session-id" \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'구성
환경 변수 | 설명 | 기본값 |
| 서버 포트 |
|
| 바인딩할 호스트 |
|
| 인증용 API 키 | (없음) |
| MCP 서버 실행 명령어 |
|
| 인자 JSON 배열 |
|
다른 MCP 서버 사용하기
이 프록시는 stdio 기반의 모든 MCP 서버와 함께 사용할 수 있습니다:
# Example: Use a custom MCP server
MCP_COMMAND=node
MCP_ARGS=["/path/to/your/mcp-server/dist/index.js"]
# Example: Use Python MCP server
MCP_COMMAND=python
MCP_ARGS=["-m", "your_mcp_server"]보안 참고 사항
인터넷에 노출할 때는 항상 API 키 인증을 사용하세요.
HTTPS를 사용하세요 (Tailscale, ngrok, Cloudflare 모두 제공).
Tailscale은 테일넷 내 개인 액세스에 권장됩니다.
API 키를 주기적으로 교체하세요.
/sessions엔드포인트를 통해 세션을 모니터링하세요.
문제 해결
MCP 서버가 시작되지 않음
콘솔 로그에서 오류를 확인하세요. MCP 서버의 stderr은 프록시의 콘솔로 전달됩니다.
연결 거부됨
서버가 실행 중인지 확인하세요:
curl http://localhost:3000/healthTailscale 연결 상태 확인:
tailscale status
인증 실패
.env의 API 키가 요청 헤더와 일치하는지 확인하세요.Authorization 헤더에 "Bearer " 접두사가 포함되어 있는지 확인하세요.
SSE가 작동하지 않음
기본 URL이 아닌
/sse엔드포인트에 연결하고 있는지 확인하세요.GET 요청 시에도 Authorization 헤더가 전송되는지 확인하세요.
라이선스
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote MCP server exposing SMI Aware tools, resources, and skills over Streamable HTTP.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Streamable HTTP MCP server exposing planner flows, tasks, and squads.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables interaction with remote MCP servers using SSE transport instead of STDIO for enhanced communication capabilities.1200,973 PyPI2,786PythonMIT
- FlicenseNot gradedqualityNot gradedmaintenanceBridges STDIO-based MCP clients with SSE-based MCP servers, allowing applications like Claude Desktop to connect to remote MCP servers that use SSE transport.9-
- FlicenseNot gradedqualityDmaintenanceExposes a local MCP server via ngrok with SSE and Streamable HTTP transports for use in Kiro Web.-
- FlicenseNot gradedqualityDmaintenanceA standalone MCP server that exposes API endpoints as tools for AI assistants, using SSE transport.-