@flexpa/mcp-fhir
Connects to FHIR servers using SMART on FHIR authentication, enabling access to FHIR resources, search, read, update, and appointment management.
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., "@@flexpa/mcp-fhirFind available appointment slots for Dr. Smith next Monday"
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.
@flexpa/mcp-fhir
This is an experimental demo not intended for production use.
This is a TypeScript-based MCP server that connects to a FHIR server. It provides core MCP functionality for interacting with FHIR resources by:
Accessing FHIR resources via URIs
Providing search capabilities for FHIR resources
Features
Resources
"Resources" here refers to the MCP definitionnot the FHIR one. MCP Resources are a core primitive in the Model Context Protocol (MCP) that allow servers to expose data and content that can be read by clients and used as context for LLM interactions.
List and access FHIR resources via
fhir://URIsResources are returned in FHIR JSON format
Supports all FHIR Resource types available in the FHIR server's CapabilityStatement
Appointment Management
Find available appointment slots based on practitioner availability and constraints
Schedule new appointments with required patient, practitioner, and timing information
Support for different appointment types and durations
Integration with FHIR Schedule and Appointment resources
Tools
search_fhir- Search FHIR resourcesTakes
resourceTypeandsearchParamsas parametersReturns FHIR search results
read_fhir- Read an individual FHIR resourceTakes
urias a parameterReturns the FHIR resource in JSON format
find_available_slots- Find available appointment slotsTakes
practitionerId,appointmentType,duration,startDate, andendDateas parametersReturns list of available time slots
schedule_appointment- Schedule a new appointmentTakes
patientId,practitionerId,appointmentType,startTime,endTime, and optionalnotesReturns the created FHIR Appointment resource
cancel_appointments_by_date- Cancel all appointments for a specified dateTakes
date(YYYY-MM-DD format) and optionalreasonfor cancellationReturns a list of canceled appointment IDs
update_fhir- Update a FHIR resourceTakes
uriandresourceas parametersReturns the updated FHIR resource
Related MCP server: FHIR MCP Server
Configuration
The server requires the following environment variables:
FHIR_BASE_URL: The base URL of your FHIR serverFHIR_ACCESS_TOKEN: A SMART on FHIR access token for authentication
Development
Install dependencies:
npm installBuild the server:
npm run buildFor development with auto-rebuild:
npm run watchInstallation
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"fhir": {
"command": "/path/to/@flexpa/mcp-fhir/build/index.js"
},
"env": {
"FHIR_BASE_URL": "<FHIR_BASE_URL>",
"FHIR_ACCESS_TOKEN": "<FHIR_ACCESS_TOKEN>"
}
}
}Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
npm run inspectorThe Inspector will provide a URL to access debugging tools in your browser.
Related MCP Connectors
- mcpOAuthcom.medplum
Securely access and manage FHIR healthcare data stored in Medplum.
Read appointments, types, calendars and availability; create, cancel or reschedule bookings.
Hosted MCP server for the Healthie EHR & telehealth API: patients, appointments, charting, tasks.
Read and write patients, facilities, medical documents, and consolidated FHIR records in Metriport.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables LLM-based agents to interact with FHIR healthcare data through natural language prompts, providing full CRUD operations on FHIR resources, document processing, and semantic search capabilities.13100MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables seamless integration with FHIR APIs for healthcare applications, allowing users to search, retrieve, create, update, and analyze clinical information through natural language interactions. Supports SMART-on-FHIR authentication and works with various healthcare systems like EPIC and HAPI FHIR servers.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables LLMs to securely interact with FHIR healthcare servers and HL7 terminology services. Provides comprehensive healthcare data operations with built-in PHI protection, audit logging, and SMART on FHIR authentication.MIT
- FlicenseAqualityDmaintenanceProvides read/write access to any FHIR-compliant healthcare API with built-in validation, supporting resource management, search operations, and granular permissions through natural language.51-