Drug Interaction MCP Server

Drug Interaction MCP Server

Enables querying of Chinese-Western medicine interactions with comprehensive drug information, risk assessment, and clinical recommendations. Supports searching medicines, checking interactions individually or in batches, and provides safety guidance with severity classifications.

Category
Visit Server

README

中西藥交互作用查詢MCP Server

專案概述

本專案是一個基於FastMCP框架開發的中西藥交互作用查詢系統,提供完整的中藥、西藥及其交互作用資訊查詢功能。系統參考奇美醫院藥劑部的中西藥交互作用查詢系統,致力於為醫療專業人員和患者提供安全、準確的用藥指導。

主要功能

🏥 藥物查詢功能

  • 中藥搜尋: 支援中文名稱、拼音和分類的模糊搜尋
  • 西藥搜尋: 支援中文名稱、通用名、品牌名和分類的模糊搜尋
  • 詳細資訊: 提供藥物的性味歸經、功效主治、副作用、禁忌症等完整資訊

⚠️ 交互作用檢查

  • 單一檢查: 檢查特定中藥與西藥之間的交互作用
  • 全向查詢: 根據中藥或西藥查找所有相關交互作用
  • 批次檢查: 同時檢查多個中藥與多個西藥的所有交互作用組合
  • 風險評估: 提供嚴重程度分類(致命、重度、中度、輕度)

📊 數據分析

  • 交互作用摘要: 完整的風險評估和統計分析
  • 嚴重程度分布: 視覺化展示不同嚴重程度的交互作用數量
  • 專業建議: 基於證據的臨床建議和監測要點

系統架構

drug-interaction-mcp/
├── src/
│   ├── __init__.py          # 模組初始化
│   ├── models.py            # 資料模型定義
│   ├── database.py          # 資料庫操作層
│   └── tools.py             # MCP工具實現
├── data/
│   └── init_data.sql        # 資料庫初始化腳本
├── tests/                   # 測試檔案
├── examples/                # 使用範例
├── server.py                # MCP Server主程式
├── run.sh                   # 啟動腳本
├── mcp-server.json          # MCP配置檔案
├── pyproject.toml           # UV專案配置
└── README.md                # 專案說明文檔

資料庫設計

中藥表 (chinese_medicines)

  • 基本資訊:名稱、拼音、分類
  • 中醫理論:性味歸經、功效主治
  • 安全資訊:副作用、禁忌症、用法用量

西藥表 (western_medicines)

  • 基本資訊:名稱、通用名、品牌名
  • 臨床資訊:治療分類、作用機制
  • 安全資訊:副作用、禁忌症、用法用量

交互作用表 (interactions)

  • 關聯資訊:中藥ID、西藥ID
  • 交互詳情:類型、嚴重程度、作用機制
  • 臨床指導:效果描述、建議、證據等級

技術特性

🔍 智能搜尋

  • 中文模糊匹配: 支援簡體、繁體中文搜尋
  • 拼音支援: 支援中文拼音搜尋
  • 相關度排序: 按搜尋相關度智能排序

💾 高效資料庫

  • SQLite資料庫: 輕量級、高效能
  • 索引優化: 多重索引提升查詢速度
  • 外鍵約束: 保證資料完整性

🛡️ 安全機制

  • 輸入驗證: 嚴格的參數驗證
  • 錯誤處理: 完善的異常處理機制
  • 日誌記錄: 詳細的操作日誌

🎯 實用功能

  • 批次處理: 支援大量藥物組合檢查
  • 統計分析: 豐富的數據統計功能
  • 專業建議: 基於實證的臨床建議

安裝與使用

環境要求

  • Python 3.10+
  • UV套件管理器

安裝步驟

  1. 克隆專案
cd /workspace
git clone <repository-url>
cd drug-interaction-mcp
  1. 初始化環境
# 創建虛擬環境並安裝依賴
uv venv
uv sync
  1. 啟動服務器
# STDIO模式啟動
sh run.sh

MCP集成

本MCP服務器通過標準STDIO協議運行,可與支援MCP的客戶端集成。配置檔案位於 mcp-server.json

API使用說明

1. 搜尋中藥

search_chinese_medicine(keyword="人參", limit=20)

搜尋包含指定關鍵字的中藥,返回詳細的藥物資訊。

2. 搜尋西藥

search_western_medicine(keyword="阿斯匹靈", limit=20)

搜尋包含指定關鍵字的西藥,返回詳細的藥物資訊。

3. 檢查交互作用

check_interactions(chinese_medicine="人參", western_medicine="warfarin")

檢查特定中藥和西藥之間是否存在交互作用。

4. 查詢中藥交互作用

find_interactions_by_chinese_medicine(chinese_medicine="人參")

查找指定中藥與所有西藥的交互作用。

5. 查詢西藥交互作用

find_interactions_by_western_medicine(western_medicine="阿斯匹靈")

查找指定西藥與所有中藥的交互作用。

6. 批次檢查

batch_check_interactions(
    chinese_medicines="人參,當歸,甘草",
    western_medicines="阿斯匹靈,warfarin,胰島素"
)

批次檢查多個中藥與多個西藥的交互作用。

7. 獲取摘要

get_interaction_summary(medicine_name="人參", medicine_type="chinese")

獲取特定藥物的交互作用摘要和風險評估。

資料內容

包含的中藥 (21種)

  • 補氣藥:人參、黃耆、白朮、山藥、紅棗
  • 補血藥:當歸、白芍、熟地黃
  • 活血化瘀藥:川芎、丹參、三七
  • 補陰藥:枸杞、麥冬、石斛
  • 補陽藥:鹿茸、冬蟲夏草
  • 其他:甘草、茯苓、陳皮、五味子、銀杏

包含的西藥 (15種)

  • 心血管藥:ACE抑制劑、β阻斷劑、地高辛
  • 抗凝血藥:warfarin、阿斯匹靈
  • 內分泌藥:胰島素、甲狀腺素
  • 抗感染藥:抗生素
  • 神經系統藥:抗癲癇藥、阿茲海默症藥
  • 其他:普拿疼、威而鋼、利尿劑、抗組織胺、口服避孕藥

交互作用案例

系統包含30多個真實的中西藥交互作用案例,涵蓋:

  • 致命交互作用: 人參與地高辛、丹參與warfarin
  • 重度交互作用: 三七與warfarin、銀杏與阿斯匹靈
  • 中度交互作用: 當歸與阿斯匹靈、甘草與利尿劑
  • 輕度交互作用: 枸杞與口服避孕藥

測試與驗證

系統提供完整的測試套件:

# 執行所有測試
pytest tests/

# 執行特定測試
pytest tests/test_tools.py -v

測試涵蓋:

  • 單元測試:各工具功能測試
  • 整合測試:資料庫操作測試
  • 端到端測試:完整流程驗證

安全性與免責聲明

⚠️ 重要安全提醒

  1. 僅供參考: 本系統提供的資訊僅供參考,不能替代專業醫療建議
  2. 醫師諮詢: 在使用任何藥物前,請務必諮詢合格的醫師或藥師
  3. 個體差異: 不同患者的用藥反應可能存在差異
  4. 即時更新: 藥物資訊需要定期更新,系統資訊可能有延遲

責任限制

  • 本系統不對藥物交互作用的準確性承擔責任
  • 使用本系統的決策風險由使用者自行承擔
  • 緊急醫療情況請立即就醫,勿依賴本系統

開發與貢獻

開發環境設置

# 安裝開發依賴
uv sync --dev

# 程式碼格式化
black src/ tests/
isort src/ tests/

# 類型檢查
mypy src/

貢獻指南

  1. Fork 本專案
  2. 創建特性分支
  3. 提交變更
  4. 推送到分支
  5. 創建 Pull Request

授權條款

本專案採用 MIT 授權條款。詳見 LICENSE 檔案。

聯絡資訊

  • 開發者:MiniMax Agent
  • 專案地址:[GitHub Repository]
  • 問題回報:[Issues Page]

更新日誌

v0.1.0 (2025-11-05)

  • 初始版本發布
  • 基礎搜尋功能實現
  • 交互作用檢查功能
  • 批次處理功能
  • 基礎測試套件

參考資料


最後更新:2025年11月5日

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured