SSE MCP Server with JWT Authentication
🔐 JWT 인증을 사용한 SSE MCP 서버
이는 JWT 기반 인증을 갖춘 MCP(Model Context Protocol) SSE 서버입니다.
이를 통해 여러 AI 도구를 SSE 전송을 통해 노출할 수 있으며, 안전한 Bearer Token 흐름을 통해 보호됩니다.
다음으로 구성됨:
🚀 Node.js + 익스프레스
🧩 @modelcontextprotocol/sdk
🔒 인증을 위한 JSON 웹 토큰(JWT)
⚙️ 입력 검증을 위한 Zod
✅
@modelcontextprotocol/inspector로 완벽하게 테스트됨
📂 프로젝트 구조
지엑스피1
Related MCP server: MCP Boilerplate
✨ 특징
✅ Bearer JWT 토큰을 사용한 안전한 SSE 연결
✅ 동적 도구 등록(에코, 시간, 난수 등)
✅ MCP Inspector로 테스트됨
✅ 모든 요청 라이프사이클 이벤트를 기록합니다
✅ /message 엔드포인트에 대한 세션 관리
🚀 프로덕션 용도로 확장할 준비가 되었습니다.
⚙️ 설정
1. 저장소를 복제합니다.
git clone https://github.com/anisirji/mcp-server-remote-setup-with-jwt-auth.git
cd mcp-server-remote-setup-with-jwt-auth2. 종속성 설치
npm install3. .env 파일 생성
echo "JWT_SECRET=your-secret-key" > .env4. 서버를 실행하세요
npm run dev✅ 서버는 다음에서 실행됩니다.
http://localhost:3001/sse🧪 MCP Inspector로 서버 테스트
1단계 - MCP Inspector 설치
📖 공식 문서: MCP 검사관
npx @modelcontextprotocol/inspector2단계 - 토큰 생성
cURL을 사용하여 JWT 토큰을 받으세요.
curl "http://localhost:3001/auth/token?username=aniket&scope=mcp:access"✅ 응답 예시:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}3단계 - MCP Inspector 연결
Inspector UI 열기
전송 유형 설정: SSE
URL:
http://localhost:3001/sse승인 헤더 추가:
Authorization: Bearer <your-token>연결을 클릭하세요
🎉 성공! 서버가 연결되었습니다.
4단계 - 테스트 도구
검사기의 도구 탭으로 가서 목록 도구를 클릭합니다.
당신은 볼 수 있습니다:
✅
test✅
echo✅
get-time✅
random-number
테스트해 보고 즐겨보세요!
📖 API 참조
🔑 토큰 생성
GET /auth/token?username=<username>&scope=mcp:access🔌 SSE 엔드포인트(토큰 필요)
GET /sse
Authorization: Bearer <token>📩 활성 세션에 메시지 보내기
POST /message?sessionId=<sessionId>
Authorization: Bearer <token>🧩 도구 참조
도구 이름 | 설명 |
| 연결 테스트(보안 확인) |
| 에코백 제공 메시지 |
| 현재 서버 시간을 반환합니다 |
| 난수(최소/최대)를 반환합니다. |
🗓️ 예정된 변경 사항
[ ] 토큰 취소 목록(블랙리스트)
[ ] 역할 기반 도구 액세스(범위 검사)
[ ] 세션 하트비트 / keep-alive
[ ] 속도 제한 및 로깅
[ ] 배포를 위한 Dockerization
📚 유용한 자료
👨💻 유지 관리자
아니켓
📄 라이센스
이 프로젝트는 오픈 소스이며 무료로 사용할 수 있습니다.
🚀 구축. 보안. 권한 부여.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA high-performance Model Context Protocol (MCP) server designed for large language models, enabling real-time communication between AI models and applications with support for session management and intelligent tool registration.2MIT
- AlicenseNot gradedqualityDmaintenanceA server that implements the Model Context Protocol, providing a standardized way to connect AI models to different data sources and tools.1011MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server with HTTP transport that implements JWT authentication, allowing secure tool execution and prompt handling with role-based access control.61
- FlicenseNot gradedqualityNot gradedmaintenanceA Model Context Protocol (MCP) server implementation that uses Server-Sent Events (SSE) to enable real-time, server-pushed updates between AI models and tools over HTTP connections.1
Related MCP Connectors
A Model Context Protocol server for Wix AI tools
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/anisirji/mcp-server-remote-setup-with-jwt-auth'
If you have feedback or need assistance with the MCP directory API, please join our Discord server