Skip to main content
Glama
josh747jr

Doctor Appointment MCP Server

by josh747jr

Doctor Appointment MCP Server

외부 예약 REST API를 통해 의사 예약을 관리하기 위한 Python 기반 Model Context Protocol (MCP) 서버입니다.

이 서버는 예약 관리 작업을 MCP 도구로 노출하여, MCP 호환 AI 에이전트 또는 클라이언트가 예약을 생성, 검색, 조회, 취소 및 일정 변경할 수 있게 합니다.

기능

서버는 5개의 MCP 도구를 제공합니다:

도구

설명

create_appointment

새 의사 예약을 생성합니다.

find_appointments

환자 이름, 의사 이름 및/또는 예약 날짜로 예약을 검색합니다.

check_appointment_status

예약 ID로 예약 세부 정보 및 상태를 조회합니다.

cancel_appointment

상태를 cancelled로 변경하여 예약을 취소합니다.

reschedule_appointment

기존 예약의 날짜와 시간을 변경합니다.

서버에는 다음도 포함됩니다:

  • /mcp의 스트리밍 HTTP MCP 엔드포인트

  • //health의 상태 확인 엔드포인트

  • 선택적 사용자 지정 HTTP 헤더 인증

  • APPOINTMENTS_API를 통해 구성되는 외부 REST API 백엔드

  • httpx를 사용한 비동기 HTTP 요청

Related MCP server: MCP Appointment Booking Server

아키텍처

AI Agent / MCP Client
          |
          | Model Context Protocol
          v
      /mcp endpoint
          |
          v
       Uvicorn
          |
          v
      Starlette
          |
          v
       FastMCP
          |
   +------+------+------+------+------+
   |      |      |      |      |
   v      v      v      v      v
 Create  Find   Check  Cancel Reschedule
   |      |      |      |      |
   +------+------+------+------+------+
                 |
                 v
            HTTPX Client
                 |
                 | REST API
                 v
        Appointment Backend
         (MockAPI by default)

프로젝트 구조

doctor-appointment-mcp/
├── server.py
├── requirements.txt
├── start.sh
├── run.sh
├── README.md
├── .gitignore
└── .gitattributes

요구 사항

  • Python 3.11 이상 권장

  • pip

  • 예약 REST API 엔드포인트

Python 종속성은 requirements.txt에 정의되어 있습니다:

fastmcp>=3.0
uvicorn[standard]>=0.30
httpx>=0.27

로컬 설정

1. 저장소 클론

git clone https://github.com/josh747jr/doctor-appointment-mcp.git
cd doctor-appointment-mcp

2. 가상 환경 생성

Windows PowerShell:

python -m venv .venv
.\.venv\Scripts\Activate.ps1

Linux/macOS/WSL:

python3 -m venv .venv
source .venv/bin/activate

3. 종속성 설치

pip install -r requirements.txt

4. 예약 API 구성

예약 레코드를 저장하는 REST 엔드포인트로 APPOINTMENTS_API를 설정합니다.

Windows PowerShell:

$env:APPOINTMENTS_API="https://YOUR-API-ENDPOINT/appointments"

Linux/macOS/WSL:

export APPOINTMENTS_API="https://YOUR-API-ENDPOINT/appointments"

APPOINTMENTS_API가 설정되지 않은 경우, 현재 server.py는 구성된 MockAPI 엔드포인트를 사용합니다.

API 키, 자격 증명 또는 기타 비밀 정보를 저장소에 커밋하지 마십시오.

서버 로컬 실행

Uvicorn 시작:

python -m uvicorn server:app --host 127.0.0.1 --port 8000

MCP 엔드포인트는 다음과 같습니다:

http://127.0.0.1:8000/mcp

상태 확인 엔드포인트는 다음과 같습니다:

http://127.0.0.1:8000/health

성공적인 상태 확인은 다음을 반환합니다:

ok

MCP 도구

1. create_appointment

새 의사 예약을 생성합니다.

입력:

  • patient_name

  • doctor_name

  • appointment_date

  • appointment_time

  • reason — 선택 사항

도구 인자 예시:

{
  "patient_name": "John Doe",
  "doctor_name": "Dr. Mike",
  "appointment_date": "2026-09-18",
  "appointment_time": "2:00 PM",
  "reason": "Annual physical"
}

새 예약은 scheduled 상태로 저장됩니다.

사용자 요청 예시:

Schedule an appointment for John Doe with Dr. Mike on September 18, 2026
at 2:00 PM for an annual physical.

2. find_appointments

예약 ID를 모를 때 기존 예약을 하나 이상 검색합니다.

검색 입력:

  • patient_name — 선택 사항

  • doctor_name — 선택 사항

  • appointment_date — 선택 사항

  • include_cancelled — 선택 사항 부울, 기본값은 false

patient_name, doctor_name 또는 appointment_date 중 하나 이상을 제공해야 합니다.

환자의 예약 검색:

{
  "patient_name": "John Doe"
}

환자와 의사의 예약 검색:

{
  "patient_name": "John Doe",
  "doctor_name": "Dr. Mike"
}

특정 날짜의 예약 검색:

{
  "appointment_date": "2026-09-18"
}

이 도구는 제공된 검색 필드를 쿼리 매개변수로 예약 REST API에 전송하고 일치하는 예약 레코드를 반환합니다.

성공적인 결과에는 다음이 포함됩니다:

{
  "success": true,
  "message": "Found 1 matching appointment(s).",
  "count": 1,
  "appointments": [
    {
      "id": "12",
      "patientName": "John Doe",
      "doctorName": "Dr. Mike",
      "appointmentDate": "2026-09-18",
      "appointmentTime": "2:00 PM",
      "reason": "Annual physical",
      "status": "scheduled"
    }
  ]
}

일치하는 레코드가 없으면 도구는 count0으로 설정되고 appointments 배열이 비어 있는 성공 응답을 반환합니다.

사용자 요청 예시:

Find my appointment with Dr. Mike.
What appointments does John Doe have?
Find John Doe's appointment on September 18, 2026.

3. check_appointment_status

ID로 예약을 조회합니다.

입력:

  • appointment_id

예시:

{
  "appointment_id": "12"
}

성공적인 응답에는 환자, 의사, 예약 날짜, 예약 시간, 사유 및 상태가 포함됩니다.

사용자 요청 예시:

What is the status of appointment 12?

4. cancel_appointment

기존 예약을 취소합니다.

입력:

  • appointment_id

예시:

{
  "appointment_id": "12"
}

취소는 예약 레코드를 삭제하지 않습니다. 서버는 상태를 다음으로 변경합니다:

cancelled

레코드를 유지하면 예약 기록이 보존됩니다.

사용자 요청 예시:

Cancel appointment 12.

5. reschedule_appointment

기존 예약의 날짜와 시간을 변경합니다.

입력:

  • appointment_id

  • new_appointment_date

  • new_appointment_time

예시:

{
  "appointment_id": "12",
  "new_appointment_date": "2026-09-21",
  "new_appointment_time": "10:00 AM"
}

현재 구현에서는 취소된 예약의 일정을 변경할 수 없습니다.

사용자 요청 예시:

Move appointment 12 to September 21, 2026 at 10:00 AM.

예약 데이터 모델

REST 백엔드는 다음 형식의 레코드를 저장할 것으로 예상됩니다:

{
  "id": "12",
  "patientName": "John Doe",
  "doctorName": "Dr. Mike",
  "appointmentDate": "2026-09-18",
  "appointmentTime": "2:00 PM",
  "reason": "Annual physical",
  "status": "scheduled"
}

서버는 다음에 해당하는 REST 작업을 사용합니다:

POST /appointments
GET  /appointments
GET  /appointments/{id}
PUT  /appointments/{id}

find_appointments는 다음과 같은 쿼리 매개변수와 함께 GET /appointments를 사용합니다:

patientName
doctorName
appointmentDate

에이전트 워크플로 예시

사용자가 먼저 다음과 같이 요청할 수 있습니다:

Find my appointment with Dr. Mike.

MCP 클라이언트는 다음을 호출할 수 있습니다:

find_appointments(patient_name="John Doe", doctor_name="Dr. Mike")

일치하는 레코드와 예약 ID를 찾은 후, 사용자는 다음과 같이 말할 수 있습니다:

Move that appointment to September 21 at 10 AM.

MCP 클라이언트는 그런 다음 다음을 호출할 수 있습니다:

reschedule_appointment(
    appointment_id="12",
    new_appointment_date="2026-09-21",
    new_appointment_time="10:00 AM"
)

이를 통해 AI 에이전트는 사용자가 예약 ID를 알 필요 없이 먼저 예약을 찾을 수 있습니다.

선택적 MCP 헤더 인증

서버는 MCP_REQUEST_HEADERS 환경 변수를 통한 선택적 사용자 지정 헤더 인증을 지원합니다.

변수가 구성되지 않은 경우 사용자 지정 헤더 인증은 비활성화됩니다.

단순 헤더

Windows PowerShell:

$env:MCP_REQUEST_HEADERS="my-secret"

Linux/macOS/WSL:

export MCP_REQUEST_HEADERS="my-secret"

이 구성은 MCP 요청에 다음 이름의 헤더가 포함될 것으로 기대합니다:

MCP_REQUEST_HEADERS

구성된 값과 함께.

사용자 지정 헤더 이름

변수는 JSON을 포함할 수도 있습니다:

export MCP_REQUEST_HEADERS='{"X-API-Key":"my-secret"}'

MCP 클라이언트는 그런 다음 다음을 전송해야 합니다:

X-API-Key: my-secret

//health 엔드포인트는 이 사용자 지정 인증 없이도 계속 사용할 수 있습니다.

보안 참고: 이 프로젝트는 데모/학습용 구현입니다. 실제 의료 애플리케이션은 실제 환자 정보를 저장하기 전에 훨씬 더 강력한 인증, 권한 부여, 개인정보 보호, 감사 로깅, 비밀 관리, 데이터 보호 및 규제 검토가 필요합니다.

배포

저장소에는 다음이 포함되어 있습니다:

start.sh
run.sh

이 스크립트는 Linux 기반 배포에 사용할 수 있습니다.

start.sh는 필요한 Python 패키지를 배포 종속성 디렉터리에 설치합니다.

run.sh는 Uvicorn으로 애플리케이션을 시작하고 PORT 환경 변수를 수신하며, 기본값은 포트 8080입니다.

필수 배포 환경 변수:

APPOINTMENTS_API=https://YOUR-API-ENDPOINT/appointments

선택적 인증:

MCP_REQUEST_HEADERS=your-secret

배포 후 MCP 엔드포인트는 일반적으로 다음과 같습니다:

https://YOUR-SERVER/mcp

상태 확인 엔드포인트는 다음과 같습니다:

https://YOUR-SERVER/health

서버 테스트

애플리케이션 시작:

python -m uvicorn server:app --host 127.0.0.1 --port 8000

상태 확인 엔드포인트 테스트:

curl http://127.0.0.1:8000/health

예상 응답:

ok

그런 다음 MCP 호환 클라이언트를 다음에 연결하도록 구성합니다:

http://127.0.0.1:8000/mcp

클라이언트는 다음 5가지 도구를 발견해야 합니다:

create_appointment
find_appointments
check_appointment_status
cancel_appointment
reschedule_appointment

개선 계획

유용한 다음 단계는 다음과 같습니다:

  • 의사 가용성 및 시간 슬롯 조회 추가

  • 중복 또는 이중 예약 방지

  • 더 강력한 날짜 및 시간 검증 추가

  • 프로덕션 데이터베이스 추가

  • OAuth 또는 다른 프로덕션급 인증 메커니즘 추가

  • 자동화된 테스트 추가

  • 구조화된 감사 로깅 추가

  • 실제 캘린더 또는 일정 관리 제공업체와 통합

  • 프로덕션급 환자 신원 및 권한 부여 제어 추가

개발 상태

이 프로젝트는 MCP 개발 및 학습 프로젝트로 의도되었습니다. 현재 예약 백엔드는 MCP 지향 도구 인터페이스를 유지하면서 나중에 프로덕션 일정 관리 서비스 또는 데이터베이스로 교체할 수 있습니다.

보안 및 의료 데이터

보안되지 않은 데모 백엔드에서 실제 환자 정보 또는 보호된 건강 정보(PHI)를 사용하지 마십시오.

프로덕션 의료 애플리케이션은 미국의 HIPAA와 같은 개인정보 보호, 보안, 규정 준수 및 데이터 보존 요구 사항의 적용을 받을 수 있습니다.

저장소

https://github.com/josh747jr/doctor-appointment-mcp

라이선스

이 저장소에는 아직 라이선스가 지정되지 않았습니다. 특정 라이선스 조건에 따라 프로젝트를 배포하거나 재사용하기 전에 LICENSE 파일을 추가하십시오.

F
license - not found
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • F
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that enables interaction with OnSched's consumer-facing appointment scheduling API through natural language, allowing users to manage bookings, appointments, and scheduling operations.
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that enables users to book, cancel, reschedule, and list appointments through natural language interactions. It uses YAML configurations for agent behavior and function logic to manage appointment data and availability.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables users to manage medical appointments by searching for doctors, checking availability, and booking sessions through a natural language interface. It serves as a reference implementation for advanced MCP features like symptom-based specialist recommendations and multi-step scheduling workflows.
    15
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Simulates a third-party appointment booking agent, enabling your AI platform to check availability and book appointments via MCP interoperability.

View all related MCP servers

Related MCP Connectors

  • Hosted Google Calendar MCP server for AI agents. No self-hosting or Google Cloud setup.

  • Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.

  • An AI concierge that turns static forms into adaptive AI conversations. From any MCP client.

View all MCP Connectors

Latest Blog Posts

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/josh747jr/doctor-appointment-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server