MCP医疗保健服务器
MCP(模型上下文协议)服务器,使LLM能够实时访问医疗保健数据——药物相互作用、ICD-10代码、FDA不良事件、医疗保险统计数据和临床指南。

______________________________________________________________________
什么是MCP?
模型上下文协议(MCP) 是Anthropic的一个开放标准,用于将LLM连接到外部数据源和工具。MCP允许LLM动态调用工具来获取实时信息,而不是将数据硬编码到提示中。
此服务器公开 6种医疗保健工具 任何兼容MCP的客户端(Claude Desktop、Cursor等)都可以使用。
______________________________________________________________________
可用工具
| 工具 | 说明 | 数据源 |
|---|---|---|
drug_interaction | 检查两种药物之间的相互作用 | openFDA API |
icd10_lookup | 查找ICD-10-CM诊断代码描述 | NLM临床表格API |
icd10_search | 按关键字搜索ICD-10-CM代码 | NLM临床表格API |
fda_adverse_events | 获取药物的FDA不良事件报告 | openFDA API |
medicare_drug_statistics | 医疗保险D部分处方数据 | CMS.gov API |
clinical_guidelines | 在PubMed中搜索临床指南 | NCBI/PubMed电子工具 |
所有API都是 免费且不需要API密钥.
______________________________________________________________________
快速开始
与Claude Desktop一起使用
- 安装服务器:
git clone https://github.com/shinegami-2002/mcp-healthcare-server.git
cd mcp-healthcare-server
pip install -e .- 添加到您的Claude桌面配置(
~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"healthcare": {
"command": "python",
"args": ["/absolute/path/to/mcp-healthcare-server/src/server.py"]
}
}
}- 重新启动克劳德桌面。现在,您将在工具选择器中看到可用的医疗保健工具。
使用Docker
docker build -t mcp-healthcare .
docker run mcp-healthcare______________________________________________________________________
示例输出
药物相互作用检查
> drug_interaction("warfarin", "aspirin")
## Drug Interaction: Warfarin Aspirin
**Coumadin** (warfarin):
Drugs may interact with warfarin sodium through pharmacodynamic or
pharmacokinetic mechanisms. Pharmacodynamic mechanisms for drug interactions
with warfarin sodium include synergism (impaired hemostasis, reduced
clotting factor synthesis), competitive antagonism...ICD-10代码查找
> icd10_lookup("E11")
Codes matching 'E11':
- **E11.00**: Type 2 diabetes mellitus with hyperosmolarity without NKHHC
- **E11.01**: Type 2 diabetes mellitus with hyperosmolarity with coma
- **E11.10**: Type 2 diabetes mellitus with ketoacidosis without coma
- **E11.21**: Type 2 diabetes mellitus with diabetic nephropathy
- **E11.9**: Type 2 diabetes mellitus without complications美国食品药品监督管理局不良事件
> fda_adverse_events("ibuprofen", 3)
## FDA Adverse Events for Ibuprofen
*Source: openFDA (fda.gov)*
**Report 1** (Date: 2014-02-28)
- Serious: No
- Reactions: Dyspepsia, Renal impairment
**Report 2** (Date: 2014-03-12)
- Serious: No
- Reactions: Cholecystectomy, Nephrolithiasis, Biliary tract disorder医疗保险D部分统计
> medicare_drug_statistics("Lipitor")
## Medicare Part D Statistics: Lipitor
*Source: CMS.gov (2023 data)*
- **Lipitor** (Atorvastatin Calcium) — Overall
Total Claims (2023): 28,226
Total Spending (2023): $32,942,704.71
Avg Cost/Claim: $1,167.10
Beneficiaries: 7,792临床指南搜索
> clinical_guidelines("diabetes", 3)
## Clinical Guidelines: Diabetes
*Source: PubMed (3 results)*
**Type 1 Diabetes Mellitus and Cognitive Impairments: A Systematic Review.**
- Authors: Li W et al.
- Journal: J Alzheimers Dis
- Published: 2017
- Link: https://pubmed.ncbi.nlm.nih.gov/28222533/______________________________________________________________________
建筑
┌──────────────────────────┐
│ MCP Client │
│ (Claude Desktop, etc.) │
└────────┬─────────────────┘
│ MCP Protocol (stdio)
┌────────▼─────────────────┐
│ MCP Healthcare Server │
│ Python + FastMCP │
│ │
│ ┌─ drug_interaction │──→ openFDA API
│ ├─ icd10_lookup │──→ NLM Clinical Tables API
│ ├─ icd10_search │──→ NLM Clinical Tables API
│ ├─ fda_adverse_events │──→ openFDA API
│ ├─ medicare_drug_stats │──→ CMS.gov API
│ └─ clinical_guidelines │──→ PubMed E-utilities
└──────────────────────────┘______________________________________________________________________
项目结构
mcp-healthcare-server/
├── src/
│ ├── server.py # FastMCP server + tool definitions
│ └── tools/
│ ├── drug_interactions.py # openFDA drug interaction queries
│ ├── icd_lookup.py # ICD-10-CM code lookup/search (NLM API)
│ ├── adverse_events.py # FDA adverse event reports
│ ├── medicare_stats.py # CMS Medicare Part D data
│ └── clinical_guidelines.py # PubMed guideline search
├── tests/ # Unit tests with mocked HTTP (respx)
├── .github/workflows/ci.yml # GitHub Actions CI
├── pyproject.toml
├── Dockerfile
└── LICENSE______________________________________________________________________
发展
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Lint
ruff check src/ tests/______________________________________________________________________
技术栈
- Python 3.11+ --异步贯穿始终
- FastMCP --MCP服务器框架
- httpx --异步HTTP客户端
- 开放FDA API --药品标签、不良事件
- NLM临床表格API --ICD-10-CM编码(70k+编码)
- CMS.gov开放数据 --医疗保险D部分处方统计
- PubMed电子工具 --临床文献检索
- pytest+respx --使用模拟HTTP进行测试
- GitHub操作 --CI管道
- 码头工人 --集装箱化部署
______________________________________________________________________
免责声明
此工具用于 仅用于信息和教育目的它不应用于医疗决策。始终咨询合格的医疗保健专业人员以获取医疗建议。
______________________________________________________________________
许可证
MIT许可证——见 许可证 了解详情。
______________________________________________________________________
建造于 Shanmukha Chatadi --MS CS@北卡罗来纳州'26
