
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 验证器边车对照 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 验证器边车,由 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 分
请在仓库或注册中心条目中声明许可证。