Doctor Appointment MCP Server
Doctor Appointment MCP サーバー
外部の予約 REST API を通じて医師の予約を管理するための、Python ベースの Model Context Protocol (MCP) サーバーです。
このサーバーは、予約管理の操作を MCP ツールとして公開するため、MCP 互換の AI エージェントやクライアントが予約の作成、検索、取得、キャンセル、再スケジュールを行うことができます。
機能
サーバーは 5 つの MCP ツールを提供します:
ツール | 説明 |
| 新しい医師の予約を作成します。 |
| 患者名、医師名、予約日で予約を検索します。 |
| 予約 ID で予約の詳細とステータスを取得します。 |
| 予約のステータスを |
| 既存の予約の日時を変更します。 |
サーバーには以下も含まれます:
/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-mcp2. 仮想環境の作成
Windows PowerShell:
python -m venv .venv
.\.venv\Scripts\Activate.ps1Linux/macOS/WSL:
python3 -m venv .venv
source .venv/bin/activate3. 依存関係のインストール
pip install -r requirements.txt4. 予約 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 8000MCP エンドポイントは次のようになります:
http://127.0.0.1:8000/mcpヘルスチェックエンドポイントは次のようになります:
http://127.0.0.1:8000/healthヘルスチェックが成功すると、次の応答が返されます:
okMCP ツール
1. create_appointment
新しい医師の予約を作成します。
入力:
patient_namedoctor_nameappointment_dateappointment_timereason— オプション
ツール引数の例:
{
"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 が不明な場合に、既存の 1 つ以上の予約を検索します。
検索入力:
patient_name— オプションdoctor_name— オプションappointment_date— オプションinclude_cancelled— オプションのブール値、デフォルトはfalse
patient_name、doctor_name、appointment_date のうち少なくとも 1 つを指定する必要があります。
患者の予約を検索:
{
"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"
}
]
}一致するレコードがない場合、ツールは count が 0 に設定され、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_idnew_appointment_datenew_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 またはその他の本番グレードの認証メカニズムを追加
自動テストを追加
構造化された監査ログを追加
実際のカレンダーまたはスケジューリングプロバイダーと統合
本番グレードの患者 ID と認可制御を追加
開発ステータス
このプロジェクトは MCP の開発および学習プロジェクトとして意図されています。現在の予約バックエンドは、MCP 向けのツールインターフェースを維持したまま、後で本番のスケジューリングサービスやデータベースに置き換えることができます。
セキュリティと医療データ
保護されていないデモバックエンドで、実際の患者情報や保護対象医療情報 (PHI) を使用しないでください。
本番の医療アプリケーションには、米国では HIPAA などのプライバシー、セキュリティ、コンプライアンス、データ保持に関する要件が適用される場合があります。
リポジトリ
https://github.com/josh747jr/doctor-appointment-mcp
ライセンス
このリポジトリにはまだライセンスが指定されていません。特定のライセンス条件でプロジェクトを配布または再利用する前に、LICENSE ファイルを追加してください。
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
- FlicenseNot gradedqualityDmaintenanceAn 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.
- AlicenseNot gradedqualityDmaintenanceAn 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
- AlicenseNot gradedqualityDmaintenanceEnables 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.15MIT
- FlicenseNot gradedqualityCmaintenanceSimulates a third-party appointment booking agent, enabling your AI platform to check availability and book appointments via MCP interoperability.
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.
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/josh747jr/doctor-appointment-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server