MCP Medical Appointments Demo
MCP 医疗预约演示
一个关于 Model Context Protocol 的工作参考实现——涵盖工具、资源、提示词、启发式交互、采样和补全——围绕医疗预约调度领域构建。
使用 TypeScript、Hono、MCP SDK 和 Zod 构建。
目录
Related MCP server: MCP Appointment Booking Server
功能
MCP 服务器原语
原语 | 名称 | 描述 |
工具 |
| 按姓名或专业搜索医生 |
工具 |
| 获取医生在某日的可预约时间段 |
工具 |
| 预订预约(使用 启发式交互 进行确认) |
工具 |
| 取消预约(使用 启发式交互 进行确认) |
工具 |
| 列出带有过滤条件的预约 |
工具 |
| 基于症状的专家推荐(使用 采样) |
资源 |
| 所有医疗专业的静态列表 |
资源 |
| 带有模板的动态医生资料 |
资源 |
| 患者信息 + 预约历史 |
资源 |
| 完整的预约详情 |
提示词 |
| 指导式预约调度工作流(带有 补全) |
提示词 |
| 患者历史记录回顾(带有 补全) |
提示词 |
| 症状分诊和专家推荐 |
MCP 客户端功能
功能 | 使用方式 |
启发式交互 |
|
采样 |
|
根目录 | 服务器为医疗预约工作区注册一个根目录 |
补全 | 提示词使用 |
代理技能
该领域的 SKILL.md 位于 .github/skills/medical-appointments/SKILL.md。它镜像了 MCP 服务器的功能,而无需 MCP 协议——任何兼容的代理(GitHub Copilot、Claude Code 等)都可以按需加载它。
技能涵盖范围
技能工作流 | 等效的 MCP 原语 |
查找医生 |
|
检查空闲时间段 |
|
预订预约 |
|
取消预约 |
|
列出预约 |
|
推荐专家 |
|
调度预约 |
|
患者历史记录 |
|
症状分诊 |
|
该技能使用代理的原生工具访问权限,直接通过 HTTP 与 REST 服务交互。
技能限制
以下 MCP 服务器功能在 agentskills.io 规范 中没有等效项,因此未进行复制:
MCP 功能 | 限制 |
启发式交互 |
|
采样 |
|
参数补全 | MCP 提示词使用 |
根目录 | MCP 服务器注册工作区根目录 ( |
VS Code 特定技能字段 |
|
快速入门
先决条件
Node.js >= 22.0.0
安装了 GitHub Copilot 的 VS Code(用于 MCP 集成)
1. 安装并启动 REST API
npm install
npm run dev:service你应该看到:
Bootstrapped: 8 specialties, 12 doctors, 5 patients
Medical Appointment Service running on http://localhost:30002. 在 VS Code 中连接 MCP 服务器
.vscode/mcp.json 文件已配置好。VS Code 将自动检测并提示启动 MCP 服务器。或者,手动运行它:
npm run dev:mcp3. 试用
在 VS Code 的 Copilot Chat(代理模式)中,尝试:
"Search for cardiologists"
"What slots does Dr. Sarah Chen have available next Monday?"
"Book an appointment with doc-3 for patient pat-1"
"Show me Alice Johnson's appointment history"
"I've been having severe headaches and dizziness — what specialist should I see?"
或者使用提示词选择器中的提示词:
Schedule Appointment — 指导式调度工作流
Patient History — 回顾患者就诊记录
Triage Symptoms — 基于症状的专家匹配
MCP 检查器
MCP Inspector 是一个基于浏览器的 UI,用于交互式测试 MCP 服务器——浏览工具、资源和提示词,并直接调用它们。
1. 启动 REST API
MCP 服务器通过 HTTP 调用 REST API,因此必须先运行它:
npm run dev:service2. 启动检查器
在第二个终端中,运行:
npx @modelcontextprotocol/inspector tsx src/mcp/server.ts检查器将作为子进程启动 MCP 服务器,并在 http://localhost:5173 打开浏览器 UI。选择 STDIO 选项。
如果 REST API 在非默认端口上运行,请传递 SERVICE_URL:
SERVICE_URL=http://localhost:3000 npx @modelcontextprotocol/inspector tsx src/mcp/server.ts3. 尝试启发式交互
启发式交互由 book_appointment 和 cancel_appointment 触发。检查器将在操作提交前渲染一个原生确认对话框。
使用以下命令调用 book_appointment:
{
"patientId": "pat-1",
"doctorId": "doc-1",
"dateTime": "2026-05-05T10:00:00",
"reason": "Annual checkup"
}检查器将暂停并要求你在预约预订前进行确认。
架构
┌─────────────────┐ stdio ┌───────────────────┐ HTTP ┌──────────────────┐
│ VS Code / │◄──────────────►│ MCP Server │─────────────►│ Hono REST API │
│ MCP Client │ │ (TypeScript) │ localhost │ (localhost:3000)│
└─────────────────┘ └───────────────────┘ └──────────────────┘
Tools, Resources, In-memory store
Prompts + JSON bootstrap该项目使用 双进程设计:
Hono REST API — 带有内存数据存储的 HTTP 服务,从
data/中的 JSON 种子文件引导。MCP 服务器 — 通过 stdio 连接,并通过 MCP 原语(工具、资源、提示词)暴露 REST API。
MCP 服务器从不直接接触数据存储——它通过 HTTP 客户端调用 REST API,保持两层之间的清晰分离。
REST API 端点
方法 | 端点 | 描述 |
|
| 列出所有专业 |
|
| 按 ID 获取专业 |
|
| 列出医生(过滤器: |
|
| 按 ID 获取医生 |
|
| 获取空闲时间段 |
|
| 列出所有患者 |
|
| 按 ID 获取患者 |
|
| 创建患者 |
|
| 列出预约(过滤器: |
|
| 按 ID 获取预约 |
|
| 预订预约 |
|
| 取消预约 |
|
| 完成预约 |
项目结构
mcp-demo/
├── data/
│ ├── specialties.json # 8 medical specialties
│ ├── doctors.json # 12 doctors across specialties
│ └── patients.json # 5 sample patients
├── src/
│ ├── types.ts # Shared domain types
│ ├── service/
│ │ ├── store.ts # In-memory data store
│ │ ├── app.ts # Hono app composition
│ │ ├── main.ts # Service entry point
│ │ └── routes/ # REST route handlers
│ └── mcp/
│ ├── api-client.ts # HTTP client for the REST API
│ ├── tools.ts # MCP tool registrations
│ ├── resources.ts # MCP resource registrations
│ ├── prompts.ts # MCP prompt registrations
│ └── server.ts # MCP server entry point
├── .vscode/
│ └── mcp.json # VS Code MCP server config
├── package.json
└── tsconfig.json脚本
命令 | 描述 |
| 启动带有热重载的 Hono REST API |
| 以 stdio 模式启动 MCP 服务器 |
| 将 TypeScript 编译为 |
| 进行类型检查而不生成文件 |
领域模型
实体 | 描述 |
Specialty | 医疗专业(心脏病学、皮肤病学等) |
Doctor | 拥有专业、可用日期、工作时间和时间段时长 |
Patient | 姓名、电子邮件、电话、出生日期 |
Appointment | 在特定日期/时间将患者与医生关联,并带有原因和状态 |
TimeSlot | 医生在特定日期的空闲或已预订时间窗口 |
配置
REST API 默认监听 3000 端口。MCP 服务器通过 http://localhost:3000 与 API 通信,并通过 stdio 连接到 VS Code。
种子数据(专业、医生、患者)在启动时从 data/ 目录加载。编辑这些 JSON 文件以自定义演示数据集。
贡献
欢迎贡献。Fork 仓库,创建功能分支,并提交拉取请求。
许可证
MIT
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
- AlicenseAqualityDmaintenanceEnables HIPAA-aware healthcare workflow automation including patient intake, clinical summaries, compliance checking, and appointment scheduling via MCP tools.4991Business Source 1.1
- FlicenseNot gradedqualityCmaintenanceSimulates a third-party appointment booking agent, enabling your AI platform to check availability and book appointments via MCP interoperability.
Related MCP Connectors
AI-native scheduling: check availability, book meetings, cancel and reschedule via MCP
An AI concierge that turns static forms into adaptive AI conversations. From any MCP client.
Hosted MCP server exposing US hospital procedure cost data to AI assistants
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/bicatu/mcp-skills-demo'
If you have feedback or need assistance with the MCP directory API, please join our Discord server