smart-fhir
smart-fhir
一个不会凭空捏造患者的连接器。
安装
仅支持 stdio。TypeScript 构建完成后,添加一个本地连接器:
name: smart-fhir
command: node
args: dist/index.jsnpm install
npm run build为它添加以下环境变量(默认值,非机密信息):
FHIR_ISS = https://launch.smarthealthit.org/v/r4/fhir
FHIR_VERSION = R4
FHIR_AUTH_MODE = open
FHIR_WRITE = off
FHIR_AUDIT_PATH = ./audit/audit.jsonl不要把机密值放进仓库。不要开放公共 HTTP 端口。不要绑定 TCP。
晨间快捷方式(相同环境变量)
npx -y tsx src/index.ts参见 package.json 脚本:install、build、test、prove。
Related MCP server: smart-mcp-server
工具
四个工具。没有 create / update / delete。
工具 | 行为 |
| 对 |
| 返回 |
| 对 |
| 对 |
resourceType 允许列表: Patient | Observation | Condition | MedicationRequest | Encounter。任何其他值 → { ok: false, error: "resourceType not in v1 allowlist" }。
工作原理
FHIR_VERSION 必须是 R4。其他任何值都会拒绝启动。
内容 | URL | 说明 |
FHIR 索引(发布页面是 R5 5.0.0) | 仅限官方索引。未实现。 | |
FHIR R4(v1) | FHIR Release 4,4.0.1。资源模型。 | |
SMART App Launch 2.2.0(STU 2.2) | 当前已发布的 SMART IG。基于 FHIR R4。 | |
APP 启动 + 授权 | 发现、standalone/EHR 启动、PKCE、token。App Launch(code+PKCE)不在 v1 范围内。 | |
Backend Services | client_credentials + 私钥 JWT。已实现;除非设置了环境变量,否则不用。 |
ISS 允许列表(去掉尾部斜杠,其他一律拒绝):
https://launic.smartfirhealthit.org/v/r4/smartivor(默认)https://r4.smarthealthit.orghttps://hapi.fhir.org/baseR4
把 FHIR_ISS 设为允许列表中另一个 base,即可指向其他 ISS。新 ISS 需要先评审。没有评审且没有真实 client_id,不要指向生产环境的 EHR。
FHIR_AUTH_MODE | 行为 |
| 先 discovery,然后不带 Authorization 执行 FHIR GET。在 open 模式中 discovery 返回 404 不是致命的(记日志;继续)。FHIR 返回 401/403 → |
| 同样的 discovery。FHIR GET 携带 Authorization Bearer token。 |
| 仅当 |
App Launch(code+PKCE)不在范围内。FHIR_REDIRECT_URI 已保留但未使用。
认证失败返回:{ ok: false, http_status, issue?, error? }。绝不会出现人为制造的 Patient。
FHIR_WRITE 默认为 off。即使有人把它设为 on,v1 也没有写入工具。写入永远不会向 FHIR POST AuditEvent。
名称 | 默认值 | 说明 |
FHIR_ISS\t | 默认启动器 R4 | 必须在允许列表内 |
FHIR_VERSION | R4 | 拒绝其他任何值 |
FHIR_AUTH_MODE | open | open / bearer / backend_jwt |
FHIR_WRITE | off | v1 中写入保持关闭 |
FHIR_AUDIT_PATH |
| 只增不改的 JSONL;本地设为 |
FHIR_ACCESS_TOKEN | 未设置 | 仅用于 Bearer |
FHIR_CLIENT_ID | 未设置 | Backend Services |
SMART_CLIENT_ID | 未设置 | FHIR_CLIENT_ID 的别名 |
FHIR_PRIVATE_KEY_PEM | 未设置 | Backend Services JWT |
FHIR_JWKS_URL | 未设置 | 预留,供需要 JWKS 的 EHR 使用 |
FHIR_SCOPE | 五个 system/*.rs 类型 | JWT 模式覆盖 |
FHIR_REDIRECT_URI | 未设置 | 为后续 App Launch 预留 |
审计行:ts、tool、iss、mode、resourceType、id?、http_status、entry_count?。不记录资源正文、token、PEM,也不记录姓名/MRN 查询值。
限制
R5 / R4B 作为默认。额外资源类型。CRUD。Bulk。App Launch 浏览器/PKCE。
真实 EHR / 真实 PHI。生产部署。公网绑定或 Streamable HTTP。
momentum / fhirhydrant / Atrium / Pinecone / Medplum。
不是医疗产品。不诊断、不治疗、不存取 PHI。
无 PHI。不连接一个 LiveEHR。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI applications to securely search and manage healthcare data from FHIR R4-compliant servers with built-in safety validation for AI-generated clinical observations, preventing recording of physiologically impossible values.8MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely interact with FHIR R4 servers for clinical decision support workflows, including PlanDefinition execution, FHIR resource management, terminology services, and Questionnaire/StructureMap transformation via Matchbox.1
- AlicenseAqualityAmaintenanceRead-only MCP server for licensed Healthpoint HL7 FHIR API access.101Apache 2.0
- AlicenseAqualityAmaintenanceEnables read-only FHIR access to Practice Fusion EHR to search patients, appointments, conditions, medications, and lab results.13223MIT
Related MCP Connectors
Securely access and manage FHIR healthcare data stored in Medplum.
Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.
Guardrailed FHIR access for AI agents: PHI redaction, audit trail, step-up auth, tenant isolation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/swami8791/smart-fhir-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server