这是一个实现模型上下文协议(MCP)的 Node.js 服务器,提供给 AI 助手访问医疗数据和医学信息工具的能力。它使 AI 模型能够从权威来源检索准确、最新的医学信息。此仓库提供了一个包含完整 Node.js 实现的单个 DXT 包。
医疗保健 MCP 服务器是一个专门的 Node.js 服务器,实现了模型上下文协议(MCP),以提供 AI 助手访问医疗数据和医学信息工具的能力。它使 AI 模型能够从权威来源检索准确、最新的医学信息。此仓库提供了一个包含完整 Node.js 实现的单个 DXT 包。
此仓库包括一个打包好的 DXT(桌面扩展)文件,便于在兼容的开发环境中进行安装。下载 healthcare-mcp.dxt 文件即可一键安装。
healthcare-mcp.dxt要通过 Smithery 自动安装 Claude Desktop 的医疗数据和医学信息服务器:
npx -y @smithery/cli install @Cicatriiz/healthcare-mcp-public --client claude
安装包:
npm install healthcare-mcp
运行服务器:
npx healthcare-mcp
克隆仓库:
git clone https://github.com/Cicatriiz/healthcare-mcp-public.git
cd healthcare-mcp-public/server
安装依赖项:
npm install
设置环境变量(可选):
# 从示例创建 .env 文件
cp .env.example .env
# 编辑 .env 文件添加您的 API 密钥(可选)
运行服务器:
npm start
stdio 模式(默认,适用于 MCP 客户端):
npm start
HTTP/SSE 模式(适用于 Web 客户端):
npm run server:http
您可以使用内置的测试脚本来测试 MCP 工具:
# 测试所有工具
npm test
# 测试个别工具
npm run test:fda # 测试 FDA 药物查找
npm run test:pubmed # 测试 PubMed 搜索
npm run test:health # 测试健康主题
npm run test:trials # 测试临床试验搜索
npm run test:icd # 测试 ICD-10 编码查找
医疗保健 MCP 服务器提供了直接集成的编程 API 和适用于 Web 客户端的 RESTful HTTP API。
当运行在 HTTP 模式时,以下端点可用:
GET /health
返回服务器及其服务的状态。
GET /api/fda?drug_name={drug_name}&search_type={search_type}
参数:
drug_name:要搜索的药物名称search_type:要检索的信息类型
general:基本药物信息(默认)label:药物标签信息adverse_events:报告的不良事件示例响应:
{
"status": "success",
"drug_name": "aspirin",
"search_type": "general",
"total_results": 25,
"results": [
{
"brand_name": "ASPIRIN",
"generic_name": "ASPIRIN",
"manufacturer": "Bayer Healthcare",
"product_type": "HUMAN OTC DRUG",
"route": "ORAL",
"active_ingredients": [
{
"name": "ASPIRIN",
"strength": "325 mg/1"
}
]
}
]
}
GET /api/pubmed?query={query}&max_results={max_results}&date_range={date_range}
参数:
query:医学文献的搜索查询max_results:要返回的最大结果数(默认:5,最大:50)date_range:限制到指定年份内发表的文章(例如 '5' 表示过去 5 年)示例响应:
{
"status": "success",
"query": "diabetes treatment",
"total_results": 123456,
"date_range": "5",
"articles": [
{
"pmid": "12345678",
"title": "New advances in diabetes treatment",
"authors": ["Smith J", "Johnson A"],
"journal": "Journal of Diabetes Research",
"publication_date": "2023-01-15",
"abstract": "This study explores new treatment options...",
"url": "https://pubmed.ncbi.nlm.nih.gov/12345678/"
}
]
}
GET /api/health_finder?topic={topic}&language={language}
参数:
topic:要搜索信息的健康主题language:内容的语言(en 或 es,默认:en)示例响应:
{
"status": "success",
"search_term": "diabetes",
"language": "en",
"total_results": 15,
"topics": [
{
"title": "Diabetes Type 2",
"url": "https://health.gov/myhealthfinder/topics/health-conditions/diabetes/diabetes-type-2",
"last_updated": "2023-05-20",
"section": "Health Conditions",
"description": "关于管理 2 型糖尿病的信息",
"content": ["糖尿病是一种疾病...", "治疗选择包括..."]
}
]
}
GET /api/clinical_trials?condition={condition}&status={status}&max_results={max_results}
参数:
condition:要搜索的医学状况或疾病status:试验状态(recruiting、completed、active、not_recruiting 或 all)max_results:要返回的最大结果数(默认:10,最大:100)示例响应:
{
"status": "success",
"condition": "breast cancer",
"search_status": "recruiting",
"total_results": 256,
"trials": [
{
"nct_id": "NCT12345678",
"title": "Study of New Treatment for Breast Cancer",
"status": "Recruiting",
"phase": "Phase 2",
"study_type": "Interventional",
"conditions": ["Breast Cancer", "HER2-positive Breast Cancer"],
"locations": [
{
"facility": "Memorial Hospital",
"city": "New York",
"state": "NY",
"country": "United States"
}
],
"sponsor": "National Cancer Institute",
"url": "https://clinicaltrials.gov/study/NCT12345678",
"eligibility": {
"gender": "Female",
"min_age": "18 Years",
"max_age": "75 Years",
"healthy_volunteers": "No"
}
}
]
}
GET /api/medical_terminology?code={code}&description={description}&max_results={max_results}
参数:
code:要查找的 ICD-10 编码(如果提供了描述则可选)description:要搜索的医学状况描述(如果提供了编码则可选)max_results:要返回的最大结果数(默认:10,最大:50)示例响应:
{
"status": "success",
"search_type": "description",
"search_term": "diabetes",
"total_results": 25,
"codes": [
{
"code": "E11",
"description": "2 型糖尿病",
"category": "内分泌、营养和代谢疾病"
},
{
"code": "E10",
"description": "1 型糖尿病",
"category": "内分泌、营养和代谢疾病"
}
]
}
POST /mcp/call-tool
请求正文:
{
"name": "fda_drug_lookup",
"arguments": {
"drug_name": "aspirin",
"search_type": "general"
},
"session_id": "optional-session-id"
}
当通过兼容客户端使用 MCP 服务器时,以下工具可用:
fda_drug_lookup(drug_name, search_type = "general")
参数:
drug_name:要搜索的药物名称search_type:要检索的信息类型
general:基本药物信息(默认)label:药物标签信息adverse_events:报告的不良事件pubmed_search(query, max_results = 5, date_range = "")
参数:
query:医学文献的搜索查询max_results:要返回的最大结果数(默认:5)date_range:限制到指定年份内发表的文章(例如 '5' 表示过去 5 年)health_topics(topic, language = "en")
参数:
topic:要搜索信息的健康主题language:内容的语言(en 或 es,默认:en)clinical_trials_search(condition, status = "recruiting", max_results = 10)
参数:
condition:要搜索的医学状况或疾病status:试验状态(recruiting、completed、active、not_recruiting 或 all)max_results:要返回的最大结果数lookup_icd_code(code = null, description = null, max_results = 10)
参数:
code:要查找的 ICD-10 编码(如果提供了描述则可选)description:要搜索的医学状况描述(如果提供了编码则可选)max_results:要返回的最大结果数medrxiv_search(query, max_results = 10)
参数:
query:medRxiv 文章的搜索查询max_results:要返回的最大结果数calculate_bmi(height_meters, weight_kg)
参数:
height_meters:以米为单位的高度weight_kg:以千克为单位的体重ncbi_bookshelf_search(query, max_results = 10)
参数:
query:NCBI 书架的搜索查询max_results:要返回的最大结果数extract_dicom_metadata(file_path)
参数:
file_path:DICOM 文件的路径此 MCP 服务器利用了几个公开的医疗保健 API:
MIT 许可证