
Mcp Fhir
io.github.pcmedsinge由 GitHub 帳號 pcmedsinge 發布v1.1.1更新於 Oct 24, 2026
FHIR R4 read/search/validate MCP server — US Core/IPS profiles, SMART-on-FHIR auth (Epic/Cerner).
概覽
讓助理讀取、搜尋、分頁並依 US Core/IPS 設定檔驗證 FHIR R4 醫療資源,可選向 Epic 或 Cerner 沙箱驗證。
- 可以做什麼
- 透過 stdio 提供五個工具:fhir_capabilities 彙整 FHIR 伺服器的 CapabilityStatement,fhir_read 依資源類型與邏輯 ID 讀取單一資源,fhir_search 使用 FHIR 查詢參數並回傳帶 _next_url 的 Bundle,fhir_search_next 在 SSRF 防護下追蹤分頁連結,validate_against_profile 透過 HAPI 驗證器 sidecar 依 US Core 或 IPS 設定檔驗證資源。也可使用 SMART-on-FHIR 後端服務向 Epic 或 Cerner EHR 沙箱驗證。
- 適用情境
- 適合助理需要瀏覽或查詢 FHIR R4 臨床資料伺服器、取得病人或觀察資源,或依 US Core 與 IPS 設定檔驗證資源的情境。適用於針對公開展示伺服器或 EHR 沙箱的醫療資料原型與整合工作。
- 執行需求
- 以本機 Python 套件執行(需 Python 3.12+ 與 uv,透過 uvx 啟動)。需要 FHIR_BASE_URL 指向 FHIR R4 伺服器,預設使用公開 HAPI 展示伺服器。設定檔驗證需要 HAPI 驗證器 sidecar,由 HAPI_VALIDATOR_URL 設定。SMART 驗證需要 SMART_ENABLED 以及 SMART_CLIENT_ID 和 SMART_CLIENT_SECRET,SMART_TOKEN_URL 為選用。選用的 LangFuse 金鑰可啟用可觀測性。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mcp Fhir,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-fhir
FHIR R4 MCP server — read, search, paginate, validate resources against US Core/IPS profiles, and authenticate against Epic/Cerner EHR sandboxes via SMART-on-FHIR OAuth 2.0.
Part of the fhir-mcp-suite monorepo.
[PyPI] [PyPI - Python Version] [CI] [License]
What it does
mcp-fhir exposes five MCP tools that let any MCP-compatible AI (Claude, GPT-4o, etc.)
interact with any FHIR R4 server — and validate resources against US Core and IPS profiles —
in a single server process. No other public FHIR MCP server combines search + validation today.
Architecture
Quick start
Claude Desktop config (claude_desktop_config.json)
See full installation guide for HAPI validator setup, troubleshooting, and self-hosted FHIR server configuration.
Eval results
Golden query suite — run against the public HAPI demo server (hapi.fhir.org/baseR4):
CI gate:
uv run python evals/mcp-fhir/run_eval.py --ci --threshold 0.9
Validator cases require the HAPI sidecar (docker compose up hapi-validator).
Configuration
All settings via environment variables (see .env.example):
SMART-on-FHIR authentication
mcp-fhir v1.1.0 adds SMART-on-FHIR backend services (client_credentials grant, RFC 6749)
so the server can authenticate against real Epic / Cerner sandboxes — no browser redirect needed.
When SMART_ENABLED=true, every FHIR request gets an Authorization: Bearer <token> header.
Tokens are cached in-process and refreshed automatically 30 s before expiry.
SMART environment variables
When SMART_TOKEN_URL is blank the server performs SMART auto-discovery:
GET {FHIR_BASE_URL}/.well-known/smart-configuration → token_endpoint.
Falls back to {FHIR_BASE_URL}/oauth2/token if discovery returns a non-200.
Epic sandbox quick-start
- Register at https://fhir.epic.com/ → My Apps → create a backend-services app.
- Note your Client ID and Client Secret.
- Create
.envin the monorepo root (already in.gitignore):
Cerner sandbox quick-start
- Register at https://code.cerner.com/ → create a backend-services app.
- Note your Client ID and the token endpoint URL.
- Update
.env:
Claude Desktop config with SMART auth
Programmatic client (LangGraph / any Python agent)
Use StdioServerParameters to point any Python MCP client at a FHIR server.
The same pattern works in LangGraph tool nodes, LangChain agents, or plain asyncio scripts.
See demo/fhir_server_configs.py for ready-to-run
configs for all supported servers (public HAPI, SMART Health IT, Epic, Cerner, local Docker).
Running SMART integration tests
Profile validation
The validate_against_profile tool supports shorthand aliases:
Profile validation requires the HAPI validator sidecar (included in
docker-compose.yml at repo root).
Development
Architecture
License
來源:packages/mcp-fhir/README.md,提交 07fc507
工具
0版本歷史
1- v1.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。