内容
# 开放牙科MCP服务器
**模型上下文协议(MCP)服务器,适用于[开放牙科](https://www.opendental.com/)** — 牙科实践管理软件。
通过Claude、Cursor或任何MCP客户端与您的开放牙科数据进行对话。读取患者、预约、提供者、程序、提醒。向患者图表写入通讯(电话、消息)。
根据[开放牙科REST API](https://www.opendental.com/site/apispecification.html)构建。没有现有的开放牙科MCP — 这是第一个。
## 您可以用它做什么
```
您: “拉取患者4523并显示他们的最后5个预约 + 待处理提醒。”
克劳德:*调用get_patient,然后find_appointments,然后find_recalls*
您: “查找本月到期所有提醒并为每个提醒草拟友好提醒。”
克劳德:*调用find_recalls,带有到期日期窗口,草拟消息*
您: “刚刚与Smith家族通话关于重新安排 - 记录它。”
克劳德:*调用log_communication,带有正确的comm_type + comm_mode*
您: “哪些提供者明天将在诊所2工作?”
克劳德:*调用list_providers + find_appointments,过滤器*
```
## 安装
```bash
pip install -e .
```
## 配置
您需要开放牙科[开发者门户](https://api.opendental.com/portal)的两个API密钥:
1. **开发者API密钥** — 适用于您的集成(您通过`vendor.relations@opendental.com`注册)
2. **客户API密钥** — 在开发者门户中为每个客户生成
```bash
export OPENDENTAL_DEVELOPER_KEY="..."
export OPENDENTAL_CUSTOMER_KEY="..."
```
### 谁使用此服务器?
1. **批准的开放牙科API合作伙伴**,正在为牙科诊所构建工具。您的开发者密钥 + 客户密钥直接起作用。
2. **牙科诊所/牙科服务组织**,进行自定义集成工作。发送电子邮件至`vendor.relations@opendental.com`进行设置。
## 与Claude Desktop一起使用
添加到 `~/Library/Application Support/Claude/claude_desktop_config.json`:
```json
{
"mcpServers": {
"open_dental_mcp": {
"command": "open_dental_mcp",
"env": {
"OPENDENTAL_DEVELOPER_KEY": "您的开发者密钥",
"OPENDENTAL_CUSTOMER_KEY": "您的客户密钥"
}
}
}
}
```
## 工具
| 工具 | 类型 | 它做什么 |
| --- | --- | --- |
| `health_check` | 诊断 | 验证凭证 |
| `get_patient` | 读取 | 按PatNum获取患者 |
| `find_patients` | 读取 | 按姓名/电话/电子邮件/出生日期搜索 |
| `update_patient` | 写入 | 修补患者字段 |
| `get_appointment` | 读取 | 按AptNum获取预约 |
| `find_appointments` | 读取 | 列出预约(按日期/患者/提供者) |
| `create_appointment` | 写入 | 预订新预约 |
| `list_providers` | 读取 | 实践中的所有提供者 |
| `list_clinics` | 读取 | 所有可访问的诊所(办公室) |
| `list_operatories` | 读取 | 治疗室 |
| `list_appointment_types` | 读取 | 清洁/填充/检查定义 |
| `find_procedurelogs` | 读取 | 已执行的治疗 |
| `log_communication` | 写入 | 记录电话/电子邮件/消息 |
| `find_recalls` | 读取 | 卫生跟进提醒 |
## 常见模式
### 预访简报
```
用户: 我将于下午2点看患者4523。给我简要介绍。
代理: get_patient(patnum=4523)
find_appointments(patnum=4523, limit=5)
find_procedurelogs(patnum=4523, limit=10)
find_recalls(patnum=4523)
→ 摘要:患者信息,最后的访问,已完成的操作,到期的操作
```
### 提醒活动
```
用户: 构建本周的提醒列表并为每个提醒草拟重新预订消息。
代理: find_recalls(due_date_start="2026-06-26", due_date_end="2026-07-03")
→ 对于每个:拉取患者,草拟友好消息
```
### 通话后文档
```
用户: 刚刚与史密斯夫妇通话,讨论下周清洁的重新安排。
代理: find_patients(lname="Smith", fname="...", phone="...")
log_communication(
patnum=<找到的>,
comm_datetime="2026-06-26T15:30:00",
comm_type=1, # 预约相关
comm_mode=2, # 电话
sent_or_received=1, # 已接收
note="患者打电话重新安排清洁。将与新日期回电。"
)
```
## API覆盖
| 开放牙科端点 | MCP工具 |
| --- | --- |
| `GET /patients/{id}` | `get_patient` |
| `GET /patients` | `find_patients` |
| `PUT /patients/{id}` | `update_patient` |
| `GET /appointments/{id}` | `get_appointment` |
| `GET /appointments` | `find_appointments` |
| `POST /appointments` | `create_appointment` |
| `GET /providers` | `list_providers` |
| `GET /clinics` | `list_clinics` |
| `GET /operatories` | `list_operatories` |
| `GET /appointmenttypes` | `list_appointment_types` |
| `GET /procedurelogs` | `find_procedurelogs` |
| `POST /commlogs` | `log_communication` |
| `GET /recalls` | `find_recalls` |
完整的开放牙科API:<https://www.opendental.com/site/apispecification.html>
## 开发
```bash
pip install -e ".[dev]"
pytest
open_dental_mcp
```
---
## 您需要为您的SaaS定制MCP吗?
我为垂直SaaS构建生产级MCP服务器 - 保险,牙科,兽医,法律,物业管理,家居服务。典型的参与:2-4周,$25K-$120K。源代码所有,MIT许可,无供应商锁定。
参见 [sanjibani/mcp-services](https://github.com/sanjibani/mcp-services) 或发送电子邮件至 sanjibani@users.noreply.github.com。
---
*包含在[sanjibani垂直MCP产品组合](https://github.com/sanjibani?q=-mcp)中 - 另见[hawksoft-mcp](https://github.com/sanjibani/hawksoft-mcp),[open-dental-mcp](https://github.com/sanjibani/open-dental-mcp),[ezyvet-mcp](https://github.com/sanjibani/ezyvet-mcp),[jobber-mcp](https://github.com/sanjibani/jobber-mcp),[paid-skills](https://github.com/sanjibani/paid-skills),[mcp-vertical-template](https://github.com/sanjibani/mcp-vertical-template)。*
---
MIT - 参见 [LICENSE](LICENSE)。
## 致谢
- 开放牙科提供公共REST API
- 使用 [mcp-vertical-template](https://github.com/sanjibani/mcp-vertical-template) 构建
- 受 [sanjibani/hawksoft-mcp](https://github.com/sanjibani/hawksoft-mcp) 启发(保险垂直,相同模式)
## 另见
- [开放牙科API文档](https://www.opendental.com/site/apispecification.html)
- [开放牙科开发者门户](https://api.opendental.com/portal/gwt/fhirportal.html)
- [模型上下文协议](https://modelcontextprotocol.io)
- [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk)
- [更多sanjibani垂直MCP](https://github.com/sanjibani?q=-mcp)