vghsdk-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@vghsdk-mcp Get patient info for ID 12345"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
vghsdk_mcp
VGH 榮總內網爬蟲 MCP Server - 使用 FastMCP 框架。
⚠️ 注意: 僅能在 VGH 內網環境中使用。
功能
🔧 27 個 MCP Tools - 病人、手術、門診、住院、同意書、IVI 查詢
🔐 統一認證 - 每次呼叫提供 EIP 帳密
⚡ Session 共享 - 同一帳號重用 session
📅 統一日期格式 - 所有日期參數使用 ISO
YYYY-MM-DD格式
Related MCP server: Intelligent Medical Assistant
需求
Python ≥ 3.10
VGH 內網
安裝
git clone https://github.com/eyeduck-ai/vghsdk-mcp.git
cd vghsdk-mcp
uv sync啟動
uv run python -m vghsdk_mcpMCP Client 設定
支援 Claude Desktop、ChatGPT、Google CLI 等 MCP 客戶端,設定格式相同:
{
"mcpServers": {
"vghsdk": {
"command": "uv",
"args": ["--directory", "/path/to/vghsdk-mcp", "run", "python", "-m", "vghsdk_mcp"]
}
}
}設定檔位置:
Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.jsonCursor:
.cursor/mcp.json(專案根目錄)
認證
所有 Tools 需要:
參數 | 說明 |
| EIP 帳號 |
| EIP 密碼 |
日期格式
統一規則: 所有日期參數使用 YYYY-MM-DD 格式 (ISO 8601)。
# 所有函數都使用相同格式
await surgery_doc_schedule_list(..., date='2025-12-30')
await doc_opd_patient_list_previous(..., date='2025-12-19')
await patient_op_note(..., dt='2025-11-04')
await patient_ad_note(..., adidate='2025-09-30')函數會自動轉換為內網 API 需要的格式 (民國/西元)。
可用 Tools (27 個)
Patient (15)
Tool | 說明 |
| 搜尋病人 |
| 基本資料 |
| 門診清單 |
| 門診 SOAP |
| 門診搜尋 (regex) |
| 已完成手術紀錄 |
| 預定手術排程 |
| 手術病歷 |
| 住院清單 |
| 住院病歷 |
| 用藥清單 |
| 用藥詳細 |
| 會診清單 |
| 會診內容 |
| 掃描病歷 |
Surgery (3)
Tool | 說明 |
| 醫師手術排程 |
| 科別手術排程 |
| 手術詳細 |
Doctor (4)
Tool | 說明 |
| 過去看診名單 (僅限過去日期) |
| 未來門診清單 |
| 掛號名單 |
| 批次門診病歷 (含防護機制) |
Consent (4)
Tool | 說明 |
| 手術排程 |
| 同意書清單 |
| 搜尋同意書 |
| 下載 PDF |
IVI (1)
Tool | 說明 |
| IVI 排程 |
回傳格式
{
"success": true,
"data": [...],
"message": "",
"count": 15
}專案結構
vghsdk-mcp/
├── vghsdk_mcp.py # FastMCP 入口
├── pyproject.toml
└── vghsdk/
├── core.py # SessionManager, VghClient
├── utils.py # 日期轉換
└── tools/ # 27 個 MCP Tools
├── patient.py
├── surgery.py
├── doctor.py
├── consent.py
└── ivi.py測試
MCP Inspector
npx @modelcontextprotocol/inspector uv --directory /path/to/vghsdk run python -m vghsdk_mcp授權
Private - Internal Use Only
作者
ZMH
Available Tools
27 toolsconsent_listB
取得病人同意書清單。
Args: start_date: YYYY-MM-DD (預設 40 天前) end_date: YYYY-MM-DD (預設今天)
Returns: jobs 陣列,含 JOB_DOC_ID, TEMP_NAME, JOB_STATUS
Inputs: hisno (required), eip_id (required), eip_password (required), end_date, +1 more.
consent_opscheduleB
查詢病人手術排程 (同意書系統)。
Returns: 排程日期, 手術名稱, 主刀醫師, 預定時間
Inputs: hisno (required), eip_id (required), eip_password (required).
consent_pdf_bytesA
下載同意書 PDF (Base64)。
需先用 consent_search 取得 jid。
Inputs: jid (required), eip_id (required), eip_password (required).
consent_searchB
搜尋同意書 (預設眼科+已完成)。
Args: target_keyword: 關鍵字 (預設 "手術") return_id: 只回傳 JOB_DOC_ID
Inputs: hisno (required), eip_id (required), eip_password (required), end_date, +3 more.
doc_batch_opd_noteA
批次取得門診 SOAP (耗時操作)。
Args: date_start: 開始日期 (YYYY-MM-DD) date_end: 結束日期 (YYYY-MM-DD),預設同 date_start limit: 最大處理數量 (預設 50) target_depts: 科別代碼清單,預設眼科 ['010', '110', '0PH', '1PH']
Returns: 含 S, O, P, soap, drugs 欄位
防護機制: - 基本延遲 1 秒 + 隨機 0~0.5 秒 - 每 50 筆額外休息 10 秒 - 錯誤時加倍延遲,連續 3 錯暫停 30 秒
Inputs: eip_id (required), date_start (required), eip_password (required), limit, +2 more.
doc_opd_patient_list_appointmentA
取得醫師特定門診時段的掛號名單。
Args: date: 門診日期 (YYYY-MM-DD),由 doc_opd_schedule 返回的 掛號日期_iso ect: 科代碼,由 doc_opd_schedule 返回 (如 '010') room: 診間代碼,由 doc_opd_schedule 返回 (如 '08')
Returns: 號碼, 病歷號, 姓名, 性別, 生日, 身份, 電話
Example: # 步驟 1: 取得門診掛號日期清單 schedule = await doc_opd_schedule(...) # → [{'掛號日期_iso': '2025-12-22', '科代碼': '010', '診間代碼': '08', '掛號數': '61', ...}]
# 步驟 2: 用參數取得該時段的掛號名單
patients = await doc_opd_patient_list_appointment(..., date='2025-12-22', ect='010', room='08')內部轉換: API 需要 YYYYMMDD 格式,會自動轉換。
Inputs: ect (required), date (required), room (required), eip_id (required), +1 more.
doc_opd_patient_list_previousA
取得醫師過去看診名單。
注意: 僅能查詢過去日期。查詢當天或未來日期將無法取得資料。
Args: date: 單一日期 (YYYY-MM-DD),例如 '2025-12-08' date_start/date_end: 日期範圍 (YYYY-MM-DD)
Returns: 病歷號, 姓名, 門診日期, 門診時間, 門診科別, 門診醫師, 主診斷(ICD9), 主診斷(IC10), date_iso
內部轉換: API 需要 YYYYMMDD 格式,會自動轉換。
Inputs: eip_id (required), eip_password (required), date, date_end, +1 more.
doc_opd_scheduleB
取得醫師未來門診掛號日期清單。
Returns: 掛號日期, 掛號日期_iso, 時段, 科代碼, 診間代碼, 醫師, 科診名稱, 科診位置, 掛號數
Note: 返回的 掛號日期_iso, 科代碼, 診間代碼 可用於 doc_opd_patient_list_appointment 取得該時段的掛號名單。
Inputs: eip_id (required), eip_password (required).
ivi_fetch_scheduleA
從 CKS 下載 IVI 排程。
不允許查詢未來日期。
Args: date: 單一日期 (YYYY-MM-DD) start_date/end_date: 日期範圍
Returns: hisno, name, schedule_name, schedule_date, vs_code, vs_name, op_start, op_end, diagnosis, side, drug, charge_type, raw_content
Inputs: eip_id (required), eip_password (required), date, end_date, +1 more.
patient_ad_listA
取得病人住院清單。
Returns: 住院日期, 住院日期_iso, 科別, caseno, adidate
Note: 返回的 caseno 和 住院日期_iso 可用於 patient_ad_note 取得住院病歷詳情。
Inputs: hisno (required), eip_id (required), eip_password (required).
patient_ad_noteA
取得住院病歷摘要 (HTML)。
Args: caseno: 住院案件號,由 patient_ad_list 返回 adidate: 入院日期 (YYYY-MM-DD 或 YYYYMMDD),由 patient_ad_list 返回的 住院日期_iso
Example: # 步驟 1: 取得住院清單 ad_list = await patient_ad_list(..., hisno) # → [{'住院日期': '20250930', '住院日期_iso': '2025-09-30', 'caseno': '33365977', ...}]
# 步驟 2: 用 caseno 和 住院日期_iso 取得住院病歷
ad_note = await patient_ad_note(..., hisno, caseno='33365977', adidate='2025-09-30')內部轉換: API 需要 YYYYMMDD 格式,會自動轉換。
Inputs: hisno (required), caseno (required), eip_id (required), adidate (required), +1 more.
patient_consult_listB
取得病人會診清單。
Returns: 會診日期, 會診日期_iso, 病房床號, 所屬科別, 會診科別, 會診醫師一, 會診醫師二, caseno, oseq
Note: 返回的 caseno 和 oseq 可用於 patient_consult_note 取得會診詳情。
Inputs: hisno (required), eip_id (required), eip_password (required).
patient_consult_noteB
取得會診內容 (HTML)。
Args: caseno: 會診案件號,由 patient_consult_list 返回 oseq: 會診序號,由 patient_consult_list 返回
Example: # 步驟 1: 取得會診清單 consult_list = await patient_consult_list(..., hisno) # → [{'會診日期': '20250929', '會診日期_iso': '2025-09-29', 'caseno': 'I3364930', 'oseq': '0001', ...}]
# 步驟 2: 用 caseno 和 oseq 取得會診詳情
consult_note = await patient_consult_note(..., hisno, caseno='I3364930', oseq='0001')
Inputs: oseq (required), hisno (required), caseno (required), eip_id (required), +1 more.
patient_drug_contentA
取得用藥詳細內容。
Args: caseno: 案件號,由 patient_drug_list 返回 dt: 日期 (YYYY-MM-DD 或 YYYYMMDD) type: 類別 (O=門診, I=住院, E=急診) dept: 科別代碼 dt1: 結束日期 (僅住院需要),可為空
Returns: 學名, 商品名, 劑量, 單位, 途徑, 頻次, 開始日, 結束日, 狀態, 總量
Example: # 步驟 1: 取得用藥清單 drug_list = await patient_drug_list(..., hisno) # → [{'日期_iso': '2025-12-17', 'caseno': '20251217', 'type': 'O', 'dept': '010', 'dt1': '', ...}]
# 步驟 2: 用參數取得用藥詳情
drug = await patient_drug_content(..., caseno='20251217', dt='2025-12-17', type='O', dept='010')內部轉換: API 需要 YYYYMMDD 格式,會自動轉換。
Inputs: dt (required), dept (required), type (required), hisno (required), +4 more.
patient_drug_listA
取得病人用藥清單。
Returns: 日期, 日期_iso, 類別, 科別, caseno, dt, type, dept, dt1
Note: 返回的參數可用於 patient_drug_content 取得用藥詳情。
Inputs: hisno (required), eip_id (required), eip_password (required).
patient_infoB
取得病人完整基本資料。
Returns: 病歷號, 姓名, 生日, 性別, 血型, 身份證號, 科別, 身分, 電話1, 電話2, 行動電話, 地址, 緊急聯絡人等
Inputs: hisno (required), eip_id (required), eip_password (required).
patient_opd_listB
取得病人門診清單。
Args: hisno: 病歷號 old_than_four_years: 包含 4 年前紀錄
Returns: 門診日期, 門診時間, 門診醫師, 科別, 門診主診斷碼
Inputs: hisno (required), eip_id (required), eip_password (required), old_than_four_years.
patient_opd_list_searchB
搜尋門診清單 (支援 regex 過濾)。
Args: doc_regex: 醫師過濾 (如 "王|李") dept_regex: 科別過濾 (如 "OPH|眼")
Inputs: hisno (required), eip_id (required), eip_password (required), doc_regex, +2 more.
patient_opd_noteA
取得門診 SOAP 病歷。
需先用 patient_opd_list 取得 dt、dept 參數。
Returns: S, O, P, soap, drugs, orders
Inputs: dt (required), dept (required), hisno (required), eip_id (required), +3 more.
patient_op_listA
取得病人已完成的手術紀錄清單。
查詢過去已執行完成的手術。若要查詢未來預定的手術排程,請使用 patient_op_schedule。
Returns: 手術日期, 手術日期_iso, 手術名稱, 主刀醫師
Note: 使用 patient_op_note 時可直接傳入 手術日期_iso 欄位。
Inputs: hisno (required), eip_id (required), eip_password (required).
patient_op_noteC
取得手術病歷 (HTML)。
Args: dt: 日期 (YYYY-MM-DD),例如 '2025-11-04'
Returns: 手術病歷 HTML 內容
內部轉換: API 需要民國 8 位格式 (01141104),會自動轉換。
Inputs: dt (required), hisno (required), eip_id (required), eip_password (required).
patient_op_scheduleA
取得病人預定的手術排程清單。
查詢未來已排定的手術。若要查詢過去已完成的手術紀錄,請使用 patient_op_list。
Returns: 排程日期, 排程日期_iso, 排程時間, 科別, 房號, 主刀, 手術名稱
Inputs: hisno (required), eip_id (required), eip_password (required).
patient_scaned_noteC
取得科別掃描病歷清單。
Inputs: eip_id (required), eip_password (required), tdept.
patient_searchA
搜尋病人 - 用病歷號/身分證號/姓名查詢。
至少需提供 hisno、pidno、name 其中之一。
Args: eip_id: EIP帳號 eip_password: EIP密碼 hisno: 病歷號 pidno: 身分證號 name: 姓名 ward: 病房號 (預設不限)
Returns: 病歷號, 姓名, 性別, 出生日, 病房床號
Inputs: eip_id (required), eip_password (required), name, ward, +2 more.
surgery_dept_schedule_listA
查詢科別的手術排程。
Args: query: 科別代碼 (如 "OPH") date: 日期 (YYYY-MM-DD),空白=今天。例如 '2025-12-23'
Returns: 同 surgery_doc_schedule_list
內部轉換: API 需要民國 7 位格式,會自動轉換。
Inputs: query (required), eip_id (required), eip_password (required), date.
surgery_doc_schedule_listB
查詢醫師的手術排程。
Args: query: 醫師燈號 (如 "4050") date: 日期 (YYYY-MM-DD),空白=今天。例如 '2025-12-23'
Returns: 手術日期, 時間, 病歷號, 姓名, 病房床號, 科部, 開刀房號, 主刀, 狀態, link, 術前診斷, 手術名稱, 麻醉
內部轉換: API 需要民國 7 位格式,會自動轉換。
Inputs: query (required), eip_id (required), eip_password (required), date.
surgery_schedule_detailA
取得手術詳細資訊。
需先用 surgery_*_schedule_list 取得 link_url。
Returns: 病歷號, 姓名, 性別, 年齡, 手術科部, 病房床號, 手術日期, 時間, 房號, 主刀, 助手, 麻醉方式, 術前診斷, 手術方式, 手術室資訊, 已開同意書
Inputs: eip_id (required), link_url (required), eip_password (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Most tools have clear list/detail pairings (e.g., patient_drug_list vs patient_drug_content), but there is potential confusion between consent_list and consent_search, and between patient_op_schedule and consent_opschedule. patient_opd_list_search also overlaps with patient_opd_list.
Tool names mostly follow a snake_case pattern with domain prefixes (e.g., patient_*, surgery_*, doc_*). Minor deviations like consent_opschedule and ivi_fetch_schedule break the noun_verb pattern, but overall the convention is consistent.
27 tools is heavy, but the server covers multiple hospital subsystems (patient records, surgery, OPD, drugs, consents, schedules). The count feels justified for the broad scope, though some consolidation could reduce redundancy.
The surface covers most hospital workflows: patient demographics, OPD/admission notes, surgery records and schedules, drug lists, consult notes, and consent management. Minor gaps exist (e.g., no lab results or allergy data), but the core needs are well covered.
Maintenance
Related MCP Connectors
MCP server for US nursing facility search and ownership lookup (NursingHomeDatabase).
MCP server for lacita - appointment management software
MCP server for querying and analyzing data from ad platforms, analytics tools, and spreadsheets
Hosted MCP server for the Healthie EHR & telehealth API: patients, appointments, charting, tasks.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides healthcare tools for interacting with FHIR data and medical resources on EMRs like Cerner and Epic2MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server and web application that enables natural language medical queries and patient data analysis powered by Gemini AI. It allows users to track and analyze patient biometrics, including vitals, sleep patterns, and laboratory results, through a comprehensive set of automated medical tools.-
- FlicenseNot gradedqualityDmaintenanceMCP server with a fictitious clinical database to develop and test agents, providing tools to search patients and retrieve full medical records (inpatient, outpatient, emergency) via HTTP streamable transport.-
- FlicenseAqualityBmaintenanceRead-only MCP server providing pediatric CKD patient master data with tools for patient profiles, diagnosis, nutrition ceilings, guardian verification, and patient lists, designed for the CKDNutri project.5-