K-LifeGuard MCP Server
# K-LifeGuard MCP Server
지능형 응급 의료 코디네이터 MCP Server
증상 기반 최적 병원 추천, 실시간 ETA, 보호자 알림 기능을 제공합니다.
## Features
| Tool | Description |
|------|-------------|
| `lifeguard_search_emergency` | 증상과 위치 기반 최적 응급의료기관 추천 (복합 스코어링) |
| `lifeguard_activate_emergency` | 응급 모드 활성화, 보호자 알림, 병상 모니터링 |
| `lifeguard_get_status` | 현재 응급 세션 상태 및 실시간 병상 조회 |
| `lifeguard_find_pharmacy` | 주변 약국 검색 (야간/휴일 필터) |
## Scoring Algorithm
병원 추천은 다음 복합 스코어링 공식을 사용합니다:
```
Score = (병상 가용성 × 0.4) + (거리 × 0.3) + (교통 ETA × 0.2) + (전문 장비 × 0.1)
```
## Installation
```bash
npm install
npm run build
```
## Configuration
`.env` 파일을 생성하고 API 키를 설정하세요:
```bash
cp .env.example .env
```
```env
# 공공데이터포털 API 키 (필수)
DATA_GO_KR_API_KEY=your_api_key
# 카카오 REST API 키 (선택 - ETA 계산용)
KAKAO_REST_API_KEY=your_kakao_api_key
```
### API Key 발급
1. **공공데이터포털**: https://www.data.go.kr
- 국립중앙의료원 응급의료정보 API 신청
2. **카카오 개발자**: https://developers.kakao.com
- REST API 키 발급 (네비게이션 API)
## Usage
### Claude Desktop 연동
`claude_desktop_config.json`:
```json
{
"mcpServers": {
"k-lifeguard": {
"command": "node",
"args": ["C:/path/to/k-lifeguard-mcp-server/dist/index.js"],
"env": {
"DATA_GO_KR_API_KEY": "your_api_key",
"KAKAO_REST_API_KEY": "your_kakao_api_key"
}
}
}
}
```
### 직접 실행
```bash
npm start
```
## Tool Examples
### 응급실 검색
```
증상: 가슴통증
위치: 서울 시청 (37.5665, 126.9780)
반경: 10km
```
응답:
- 증상 분석 (심장내과, CT/MRI 필요 등)
- 병원 5곳 추천 (점수, 거리, ETA, 병상, 장비)
### 약국 검색
```
위치: 현재 위치
필터: night (야간 운영)
```
응답:
- 야간 운영 약국 목록
- 운영시간, 거리, 연락처
## Project Structure
```
k-lifeguard-mcp-server/
├── src/
│ ├── index.ts # MCP 서버 엔트리포인트
│ ├── types.ts # TypeScript 타입 정의
│ ├── constants.ts # 상수 (API URL, 증상 매핑 등)
│ ├── schemas/ # Zod 입력/출력 스키마
│ ├── tools/ # MCP 도구 구현
│ │ ├── searchEmergency.ts
│ │ ├── activateEmergency.ts
│ │ ├── getStatus.ts
│ │ └── findPharmacy.ts
│ └── services/ # 외부 API 클라이언트
│ ├── nemcApi.ts # 공공데이터포털 API
│ ├── kakaoNaviApi.ts # 카카오 내비 API
│ ├── sessionManager.ts
│ └── utils.ts
├── dist/ # 빌드 결과물
├── package.json
└── tsconfig.json
```
## Data Sources
- **공공데이터포털 (NEMC)**: 응급의료기관 정보, 실시간 병상
- **카카오 모빌리티**: 실시간 교통 ETA
## License
MIT
## Author
yonghwan1106
TDQS
Scored across 4 tools
All four tools have clearly distinct purposes: status checking, emergency hospital search, emergency activation, and pharmacy search. There is no overlap or ambiguity in their functions.
All tool names follow a consistent 'lifeguard_verb_noun' pattern with lowercase and underscores. Verbs are descriptive (get, search, activate, find) and nouns are appropriate.
With 4 tools, the server is well-scoped for its purpose: emergency medical assistance. Each tool provides essential functionality without being overwhelming or underdeveloped.
The tool set covers the main emergency workflow (search, activate, monitor status) and adds pharmacy search. However, it lacks a tool to cancel or complete an emergency session, which is a minor but notable gap.