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: Healthpoint MCP Server
Инструменты
Четыре инструмента. Никаких create / update / delete.
Инструмент | Действие |
| GET |
|
|
| GET |
| GET |
Разрешённые типы resourceType: Patient, Observation, Condition, MedicationRequest, Encounter. Всё остальное → { ok: false, error: "resourceType is not in the 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 launch + авторизация | App Launch, PKCE, токен. App Launch (code+PKCE) вне рамок v1. | |
Backend Services |
|
Разрешённый список ISS (конечный слеш удаляется; всё остальное отклоняется):
https://launch.smarthealthit.org/v/r4/fhir(по умолчанию)https://r4.smarthealthit.orghttps://hapi.fhir.org/baseR4
Чтобы направить коннектор на другой ISS, задайте FHIR_ISS другой разрешённой базой. Новый ISS сначала нужно проверить. Не указывайте на «живую» EHR без этой проверки и настоящего client_id.
FHIR_AUTH_MODE | Поведение |
| Сначала discovery, затем FHIR GET без |
| Та же discovery. FHIR GET с |
| Только если есть и |
App Launch (code+PKCE) вне рамок. FHIR_REDIRECT_URI зарезервирован и не используется.
Форма ошибки аутентификации: { ok: false, http_status, issue?, error? }. Никогда не отдаёт выдуманную Patient-запись.
FHIR_WRITE по умолчанию off. В v1 нет инструментов записи, даже если кто-то поставит on. Операции записи никогда не делают POST AuditEvent в FHIR.
Имя | Значение по умолчанию | Примечания |
FHIR_ISS | стандартный лаунчер 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 | не задано | JWT Backend Services |
FHIR_JWKS_URL | не задано | Зарезервирован, если EHR запрашивает JWKS |
FHIR_SCOPE | five system/*.rs types | Переопределение только в режиме JWT |
FHIR_REDIRECT_URI | не задано | Зарезервирован для будущего App Launch |
Строки аудита: ts, tool, iss, mode, resourceType, id?, http_status, entry_count?. Нет тела ресурса, токена, PEM и значений запроса name/MRN.
Ограничения
R5 / R4B по умолчанию. Дополнительные типы ресурсов. CRUD. Bulk. App Launch в браузере / PKCE.
Настоящая EHR / настоящая PHI. Продовый деплой. Публичный bind или Streamable HTTP.
momentum / fhirhydrant / Atrium / Pinecone / Medplum.
Не медицинский продукт. Не диагностирует, не лечит и не хранит PHI.
Никакой PHI. Никаких «живых» EHR.
Available Tools
4 toolsfhir_auth_statusFHIR auth statusA
Report mode, ISS, R4 lock, write=off, token_present, discovery_ok. Never prints token or PEM.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds the behavioral note 'Never prints token or PEM', which is a valuable safety disclosure not available in annotations (since none are provided). It also lists exactly what will be reported. However, it does not state whether the operation is read-only, whether it can fail (e.g., if discovery hasn't been run), or what the response format will be. Given zero annotations, the description carries the burden but provides only partial behavioral transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, tightly written sentence that front-loads the verb 'Report' and then enumerates the status fields. It ends with a concise safety disclaimer. There is no fluff or repetition; every word earns its place. This is an exemplary model of conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter tool with no output schema, the description lists all the status values it reports and adds a safety constraint. It lacks details on the exact output structure (e.g., JSON keys vs. plain text) and does not specify whether the tool requires prior setup (like discovery), but these are minor given the tool's simplicity. Overall, it provides enough context for an agent to call and interpret the results reasonably.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters (schema is an empty object), so the baseline for parameter semantics is 4 according to the rubric. The description correctly mentions the fields that will be reported, which are effectively the tool's 'output' rather than input parameters. Since there are no parameters to document, the description adds what little meaning is needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the verb 'Report' and lists specific status fields (mode, ISS, R4 lock, etc.), making the tool's purpose clear: to report FHIR authentication status. It is distinguishable from siblings like fhir_search and fhir_read by focusing on auth state rather than data operations, and from smart_discover by being a status check. However, it does not explicitly differentiate itself from siblings in the text.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus the sibling tools. It doesn't mention scenarios like 'before calling fhir_search' or 'when you need to verify authentication state'. The purpose is implicit from the name and list of status fields, but no explicit usage context is given, and no exclusions or alternatives are referenced.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
fhir_readFHIR readB
GET {iss}/{resourceType}/{id} as FHIR R4. 404 is not found, not a made-up resource. Same resourceType allowlist as search.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| iss | No | ||
| resourceType | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It does disclose that a 404 means genuinely not found, which is valuable error semantics. It also indicates the response is FHIR R4 format. However, it does not mention authentication requirements, rate limits, or what happens on other errors (e.g., 401, 500). For a read-only GET operation, this is above minimum but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with no wasted words. The URL template is front-loaded, followed by a critical error-handling note and a cross-reference to search. Every sentence earns its place, making it highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple single-resource read, the description covers the URL construction, 404 semantics, and resource type allowlist. It does not explicitly state the tool's overall purpose (fetching one resource) or mention authentication, which might be assumed from a prior auth step. Given no output schema, it could also clarify the response shape, though 'FHIR R4' implies a FHIR resource. Slight gaps remain in purpose clarity and auth context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. The URL template '{iss}/{resourceType}/{id}' gives meaning and ordering to the three parameters, and the allowlist note constrains resourceType. However, it does not explain what iss represents (likely the server base URL) or any format expectations for id or resourceType beyond being strings. This is partial compensation for the lack of schema documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states 'GET {iss}/{resourceType}/{id} as FHIR R4', which clearly indicates a read operation targeting a specific FHIR resource. It also clarifies the 404 semantics, which helps distinguish it from a search that might return empty results. However, it does not explicitly say 'retrieve a single resource by ID', relying on the URL pattern to imply it, and it does not contrast with fhir_search directly beyond the allowlist note.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no explicit guidance on when to use this tool versus fhir_search or other siblings. It only mentions 'Same resourceType allowlist as search', which hints at shared constraints but does not explain the core difference (single resource lookup vs query). A clear statement like 'Use this to fetch one resource by ID; use fhir_search for queries' is missing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
fhir_searchFHIR searchA
GET {iss}/{resourceType} as FHIR R4 searchset. resourceType allowlist: Patient, Observation, Condition, MedicationRequest, Encounter. _count default 10 max 50. One page only. Does not invent Patients.
| Name | Required | Description | Default |
|---|---|---|---|
| iss | No | ||
| params | No | ||
| resourceType | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it declares a GET request, response type (searchset), resourceType allowlist, _count limits, single-page behavior, and explicitly states it does not create resources ('does not invent Patients'). Auth and error handling are absent, but the key read-only and pagination traits are disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise, packing essential details into five short sentences. It front-loads the HTTP method and resource pattern, then lists constraints without filler or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given three parameters including a nested object, zero schema coverage, and no output schema, the description supplies key facts (resourceType allowlist, _count limits, single page, read-only), but omits the meaning of 'iss' and the syntax for search parameters in 'params'. These gaps leave an agent without full construction guidance.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate. It explains resourceType via the allowlist and gives _count default/max, but does not define 'iss' (presumably the FHIR base URL) or the general structure/keys of the 'params' object. Meaning is added for resourceType and partially for _count, but iss and general params remain undocumented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'GET {iss}/{resourceType} as FHIR R4 searchset' with a specific verb and resource, and lists the allowlisted resource types. This distinguishes it from sibling fhir_read (single resource read) and other tools by implying search vs discovery/auth.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies a search/query use case via HTTP GET and resourceType allowlist, but does not explicitly name alternatives or when-not-to-use it. The context suggests fhir_read is for single resources, but no explicit routing is provided; usage is implied rather than stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
smart_discoverSMART discoverA
GET {iss}/.well-known/smart-configuration (SMART App Launch 2.2.0). Optional iss must be v1-allowlisted. Does not invent endpoints.
| Name | Required | Description | Default |
|---|---|---|---|
| iss | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It includes one genuinely useful behavioral note ('Does not invent endpoints'), signaling the tool only returns what the server actually advertises. However, it omits other relevant behavior such as error handling when iss is not allowlisted, whether authentication is needed, or any required scopes, leaving the behavioral profile only partially disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three terse, information-dense sentences with no filler. The endpoint is front-loaded, followed by the spec version, the parameter constraint, and the single most important behavioral caveat. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-optional-parameter discovery tool with no output schema, the description covers the endpoint, the constraint, and the key behavior. Return format is not described, but SMART discovery responses are standardized by the cited spec, reducing the need. Only edge-case behavior (unallowlisted iss handling) is left unspecified, which is minor for this tool's simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate. It does add meaning by substituting iss into the URL path and by stating the v1-allowlist constraint. However, it never explicitly defines iss as the FHIR server base URL or describes the valid format/value domain beyond the allowlist, leaving some semantic burden on inference from the '{iss}' placeholder.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (GET) plus a concrete resource (.well-known/smart-configuration) with a spec version (SMART App Launch 2.2.0). The '{iss}' prefix clarifies it targets a specific FHIR server's discovery document, and it is clearly distinct from the sibling tools (fhir_auth_status, fhir_search, fhir_read) which handle auth status and searches/reads rather than capability discovery.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides a useful precondition (iss must be v1-allowlisted) and clarifies the call is optional-parameter. However, it gives no explicit guidance on when to prefer smart_discover versus sibling tools like fhir_auth_status, nor any exclusion criteria. The 'when to use vs alternatives' context is implied by its distinct purpose but never stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v1.0.0- First observed
fhir_auth_status - First observed
fhir_read - First observed
fhir_search - First observed
smart_discover
TDQS
Scored across 4 tools
Each tool targets a distinct function: smart_discover retrieves server metadata, fhir_auth_status reports client-side authentication state, fhir_search performs list queries, and fhir_read fetches individual resources. There is no overlap or ambiguity between the four operations.
Tools use a consistent prefix pattern (smart_ for auth/discovery, fhir_ for data operations) and each suffix clearly indicates the action (discover, auth_status, search, read). While the prefixes differ by domain, the overall structure is predictable and not chaotic.
Four tools is on the lower end but appropriate for a narrowly scoped read-only FHIR access server focused on discovery and basic querying. It avoids bloat while covering the primary use cases.
The server covers read and search for a limited set of resources, but lacks pagination (only one page), search parameters beyond resource type, and a capability statement. Given the explicit read-only nature, core operations are present but notable gaps exist in search depth and server metadata.
Maintenance
Related MCP Connectors
Read-only ArcadeOps discovery for developer docs, OAuth, OpenAPI and synthetic sandbox.
Synthetic EHR: medications, labs, conditions, allergies, immunizations, FHIR R4. No API key.
HL7 FHIR R4 health-data API for AI agents: free sandbox, 30 synthetic patients, AI-ready context.
141Read-only U.S. lab-test catalog, collection-site search, and reference-range context.
Related MCP Servers
- 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-
- AlicenseAqualityDmaintenanceRead-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.137 npm4MIT
- AlicenseAqualityCmaintenanceProvides safe read-only access to synthetic healthcare data via FHIR R4, enabling AI assistants to search patients, retrieve vitals, and summarize conditions using a public sandbox.48 npmMIT