
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
fhir-mcp-server
Advanced tools
Model Context Protocol server for FHIR R4 with validation, narrative generation, and comprehensive resource management
A comprehensive MCP (Model Context Protocol) server for FHIR R4 with AI-powered clinical insights, intelligent validation explanations, enhanced narrative generation, and complete resource management capabilities.
The server is configured entirely through command line flags. All configuration must be provided via named parameters - no environment variables or config files are used.
# Basic usage - FHIR URL is required
node dist/index.js -f http://localhost:3000/fhir
node dist/index.js --fhir-url https://your-fhir-server.com/fhir
# Custom timeout
node dist/index.js -f http://localhost:3000/fhir --timeout 60000
# Legacy API key support
node dist/index.js -f http://localhost:3000/fhir --api-key your-api-key
# View all available options
node dist/index.js --help
# Check version
node dist/index.js --version
The FHIR MCP Server includes a comprehensive authentication system supporting multiple authentication modes for secure FHIR server connections. All authentication is configured via CLI flags.
No authentication required - suitable for development and open FHIR servers:
node dist/index.js -f http://localhost:3000/fhir
# --auth-type defaults to 'none'
Static bearer token for API access:
node dist/index.js -f http://localhost:3000/fhir \
--auth-type bearer \
--auth-token your-bearer-token
Dynamic OAuth token management with automatic refresh:
node dist/index.js -f http://localhost:3000/fhir \
--auth-type client_credentials \
--oauth-client-id your-client-id \
--oauth-client-secret your-client-secret \
--oauth-token-url https://auth.server.com/oauth/token \
--oauth-scope "user/*.read" \
--oauth-auto-discover
# Required
-f, --fhir-url <url> FHIR server base URL
# Optional Configuration
-t, --timeout <ms> Request timeout in milliseconds (default: 30000)
--auth-type <type> Authentication type: none, bearer, client_credentials (default: none)
# Bearer Token Authentication
--auth-token <token> Bearer token for authentication
# OAuth 2.0 Client Credentials
--oauth-token-url <url> OAuth token endpoint URL
--oauth-client-id <id> OAuth client ID
--oauth-client-secret <secret> OAuth client secret
--oauth-scope <scope> OAuth scope
--oauth-auto-discover Auto-discover OAuth endpoints from FHIR server
# Legacy Support
--api-key <key> Legacy API key (deprecated)
# Utility
-V, --version Output the version number
-h, --help Display help for command
Basic Configuration (No Auth):
{
"mcpServers": {
"fhir": {
"command": "node",
"args": [
"C:\\projects\\fhir-mcp\\dist\\index.js",
"-f",
"http://localhost:3000/fhir"
]
}
}
}
With Bearer Token:
{
"mcpServers": {
"fhir": {
"command": "node",
"args": [
"C:\\projects\\fhir-mcp\\dist\\index.js",
"-f",
"https://your-fhir-server.com/fhir",
"--auth-type",
"bearer",
"--auth-token",
"your-bearer-token"
]
}
}
}
With OAuth 2.0 Client Credentials:
{
"mcpServers": {
"fhir": {
"command": "node",
"args": [
"C:\\projects\\fhir-mcp\\dist\\index.js",
"-f",
"https://your-fhir-server.com/fhir",
"--auth-type",
"client_credentials",
"--oauth-client-id",
"your-client-id",
"--oauth-client-secret",
"your-client-secret",
"--oauth-token-url",
"https://auth.server.com/oauth/token",
"--oauth-scope",
"user/*.read"
]
}
}
}
The server provides built-in tools for OAuth configuration and management:
fhir_auth_configure
Configure authentication settings dynamically:
{
"tool": "fhir_auth_configure",
"args": {
"authType": "client_credentials",
"tokenUrl": "https://auth.server.com/oauth/token",
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"scope": "user/*.read"
}
}
fhir_auth_test
Test current authentication configuration:
{
"tool": "fhir_auth_test"
}
fhir_token_status
Check OAuth token status and expiry:
{
"tool": "fhir_token_status"
}
fhir_token_refresh
Force refresh OAuth tokens:
{
"tool": "fhir_token_refresh"
}
fhir_oauth_discover
Auto-discover OAuth endpoints from FHIR server:
{
"tool": "fhir_oauth_discover",
"args": {
"fhirUrl": "https://your-fhir-server.com/fhir"
}
}
Automatically discover OAuth endpoints from FHIR server .well-known
configuration:
FHIR_OAUTH_AUTO_DISCOVER=true
Searches these endpoints automatically:
{fhirUrl}/.well-known/smart_configuration
{fhirUrl}/.well-known/smart-configuration
{baseUrl}/.well-known/smart_configuration
ā Multiple Auth Modes: Support for none, bearer token, and OAuth 2.0 client credentials ā Automatic Token Management: Background token refresh with caching ā SMART on FHIR Compatible: Auto-discovery of OAuth endpoints ā Dynamic Configuration: Runtime authentication configuration changes ā Comprehensive Testing: Built-in tools for testing authentication ā Secure Implementation: Industry-standard OAuth 2.0 compliance ā Explicit Configuration: All settings visible in command line arguments ā Production Ready: Robust error handling and token management
Invalid Client Credentials:
{
"error": "OAuth token request failed: invalid_client"
}
FHIR_OAUTH_CLIENT_ID
and FHIR_OAUTH_CLIENT_SECRET
Token Endpoint Not Found:
{
"error": "Could not discover OAuth endpoints for FHIR server"
}
FHIR_OAUTH_TOKEN_URL
manuallyExpired Bearer Token:
{
"error": "Request failed: 401 Unauthorized"
}
FHIR_AUTH_TOKEN
with valid tokenTest your authentication setup:
# Test with bearer token
node dist/index.js -f http://localhost:3000/fhir \
--auth-type bearer \
--auth-token your-token
# Test with OAuth
node dist/index.js -f http://localhost:3000/fhir \
--auth-type client_credentials \
--oauth-client-id your-id \
--oauth-client-secret your-secret \
--oauth-token-url https://auth.server.com/oauth/token
The OAuth authentication system ensures secure, standards-compliant access to FHIR servers while providing flexibility for different deployment scenarios.
npm install
npm run build
# Development mode with CLI flags
npm run build
node dist/index.js -f http://localhost:3000/fhir
npm run build
node dist/index.js -f https://your-fhir-server.com/fhir
fhir_search
: Search FHIR resources by type and parametersfhir_read
: Read a specific FHIR resource by IDfhir_create
: Create new FHIR resources with validationfhir_update
: Update existing FHIR resourcesfhir_delete
: Delete FHIR resources by IDfhir_capability
: Get FHIR server capabilities and supported resourcesfhir_create_interactive
: Create FHIR resources with guided input collection for missing fieldsfhir_search_guided
: Search with interactive parameter collection and guidancepatient_identify
: Interactive patient identification with disambiguation for multiple matcheselicit_input
: Request specific user input with healthcare context and validationfhir_validate
: Validate FHIR resources against R4 specification with AI-powered error explanationsfhir_generate_narrative
: Generate AI-enhanced human-readable narratives for resourcesfhir_clinical_insights
: Generate AI-powered clinical insights and analysis from patient data
fhir_list_prompts
: List available contextual prompts by tag or resource typefhir_get_prompt
: Get specific prompts with parameter substitutionfhir_context_prompt
: Get contextual prompts for clinical workflowsfhir_auth_configure
: Configure authentication settings dynamicallyfhir_auth_test
: Test current authentication configurationfhir_token_status
: Check OAuth token status and expiryfhir_token_refresh
: Force refresh OAuth tokensfhir_oauth_discover
: Auto-discover OAuth endpoints from FHIR serverget_config
: Get current server configurationsend_feedback
: Send feedback about server performanceping
: Test server connectivityThe server provides intelligent auto-completion functionality to enhance the user experience when working with FHIR resources. This system offers contextual suggestions for resource types, search parameters, and other FHIR-related inputs.
Parameter: resourceType
Input: "Pat" ā Suggestions: ["Patient"]
Input: "Med" ā Suggestions: ["Media", "Medication", "MedicationRequest", ...]
Parameter: parameters
Input: "_" ā Suggestions: ["_id", "_lastUpdated", "_tag", "_profile", ...]
Input: "birth" ā Suggestions: ["birthdate"]
Input: "family" ā Suggestions: ["family"]
_id
, _lastUpdated
, _include
, _sort
, _count
, etc.identifier
, active
, name
, subject
, patient
, etc.date
, code
, value
, status
, category
, performer
Parameter: status
Input: "act" ā Suggestions: ["active"]
Input: "comp" ā Suggestions: ["completed"]
Input: "prel" ā Suggestions: ["preliminary"]
active
, inactive
, completed
, draft
, final
, preliminary
requested
, accepted
, in-progress
, on-hold
, stopped
Parameter: code
Input: "loinc" ā Suggestions: ["http://loinc.org"]
Input: "snomed" ā Suggestions: ["http://snomed.info/sct"]
Input: "hl7" ā Suggestions: ["http://hl7.org/fhir/administrative-gender", ...]
Patient: identifier, family, given, birthdate, gender, address, phone, email
Observation: subject, code, value-quantity, date, category, component-code
Condition: clinical-status, verification-status, severity, onset-date
MedicationRequest: medication, intent, priority, authored-on, requester
Encounter: class, type, participant, date, period, location
hasMore
flag indicates additional resultsThe completion system is built with clean, modular architecture:
// Core completion manager
class FHIRCompletionManager {
handleCompletion(params): Promise<CompletionResult>
getResourceTypeCompletions(value): CompletionResult
getSearchParameterCompletions(value): CompletionResult
getStatusCompletions(value): CompletionResult
getCodeCompletions(value): CompletionResult
getResourceSpecificSearchParameters(resourceType, value): CompletionResult
}
completions: {}
capability declaredCompleteRequestSchema
handler registered// User types "Pat" in resourceType field
{
"ref": { "name": "resourceType", "value": "Pat" },
"completion": {
"values": ["Patient"],
"total": 1,
"hasMore": false
}
}
// User types "_" in parameters field
{
"ref": { "name": "parameters", "value": "_" },
"completion": {
"values": ["_id", "_lastUpdated", "_tag", "_profile", ...],
"total": 12,
"hasMore": false
}
}
// User types "act" in status field
{
"ref": { "name": "status", "value": "act" },
"completion": {
"values": ["active"],
"total": 1,
"hasMore": false
}
}
ā Improved Productivity: Faster parameter entry with intelligent suggestions ā Reduced Errors: Fewer typos and invalid parameter usage ā Enhanced Discovery: Learn FHIR parameters through contextual suggestions ā MCP Integration: Native completion support in MCP-compatible tools ā Extensible Design: Easy to add new completion types and logic ā Performance Optimized: Fast response times for real-time user experience
The auto-completion system transforms FHIR development from manual parameter lookup to an intelligent, guided experience that accelerates workflow and reduces cognitive load.
config://server
: Server configuration informationThe server includes a comprehensive FHIR R4 documentation provider that gives Claude deep insight into the FHIR specification:
fhir://r4/specification
- Complete FHIR R4 specification overview and key conceptsfhir://r4/resources
- All 145+ FHIR resource types with descriptions and HL7.org linksfhir://r4/datatypes
- Primitive, complex, and special data types referencefhir://r4/search
- Search parameters, modifiers, chaining, and examplesfhir://r4/validation
- Validation rules, invariants, and profile conformancefhir://r4/terminology
- Code systems, value sets, and terminology servicesā Specification Compliance: Claude has direct access to official FHIR R4 specification ā Resource Expertise: Detailed knowledge of all FHIR resource types and their purposes ā Validation Guidance: Understanding of FHIR validation rules and requirements ā Search Mastery: Advanced search capabilities with proper parameter usage ā Terminology Awareness: Code systems, value sets, and binding requirements ā Implementation Support: Best practices for FHIR API development and integration
The FHIR MCP Server integrates MCP Sampling to provide sophisticated AI-powered clinical intelligence while maintaining client control over model access and selection.
Transform technical FHIR validation errors into actionable guidance:
ā Traditional: "Element 'Patient.name': minimum required = 1, but only found 0"
ā
AI-Enhanced: "The Patient resource requires at least one name. Add a name with at least a family name or given name. For example: {'family': 'Smith'} or {'given': ['John']}. This ensures the patient can be properly identified in clinical workflows."
Features:
AI-powered clinical narratives with multiple styles:
š„ Clinical Style: "Patient John Doe, DOB 1985-06-15, presents with elevated blood pressure readings (140/90 mmHg) recorded on 2024-01-15. Clinical assessment indicates hypertension requiring monitoring and potential intervention."
š„ Patient-Friendly: "This is John Doe, born June 15, 1985. His recent blood pressure reading was higher than normal at 140/90. This means his blood pressure needs to be watched and may need treatment."
š§ Technical: "Patient resource (ID: patient-123) with HumanName elements and Observation references. Blood pressure Observation uses LOINC code 85354-9 with Quantity value and mmHg UCUM unit."
Features:
AI-powered insights and analysis from patient data:
š Clinical Summary: "Jane Smith shows well-controlled diabetes with recent HbA1c of 6.8%. Blood pressure trending upward (current: 145/92). Medication adherence appears good based on prescription fills."
š Care Gaps: "Missing: Annual diabetic eye exam (last: 2022), Foot examination (overdue by 4 months), Lipid panel (last: 8 months ago)."
ā ļø Risk Assessment: "Moderate cardiovascular risk due to diabetes + hypertension combination. Blood pressure elevation trend warrants attention."
š Next Steps: "1. Schedule ophthalmology referral for diabetic screening, 2. Consider ACE inhibitor adjustment for BP control, 3. Order lipid panel and HbA1c follow-up."
Analysis Types:
ā Client Control: LLM remains with client, server never has direct model access ā Permission Respect: Honors client model selection and usage policies ā Graceful Degradation: All features work with or without sampling support ā Clinical Boundaries: Appropriate disclaimers and scope limitations ā Data Privacy: No patient data sent to external AI services
# Validate with AI explanations
fhir_validate --resourceType Patient --resource {...}
# Generate AI-enhanced narratives
fhir_generate_narrative --resourceType Patient --resource {...} --style clinical
# Get clinical insights
fhir_clinical_insights --patientData {...} --analysisType summary
The documentation system is powered by the FHIRDocumentationProvider
class, ensuring maintainable and up-to-date FHIR knowledge.
The server implements comprehensive MCP Resource Templates for parameterized, discoverable resource access patterns:
fhir://r4/{docType}
docType
ā [specification
, resources
, datatypes
, search
, validation
, terminology
]fhir://r4/specification
, fhir://r4/resources
, etc.prompt://fhir/{category}/{promptId}
category
ā [clinical
, security
, technical
, workflow
]promptId
- Specific prompt identifierprompt://fhir/clinical/patient-assessment
prompt://fhir/resource/{resourceType}
resourceType
ā [Patient
, Observation
, Condition
, MedicationRequest
, ...]prompt://fhir/resource/Patient
context://fhir/{workflow}/{userType}
workflow
ā [admission
, discharge
, medication-review
, care-planning
, billing
, scheduling
]userType
ā [clinical
, administrative
, technical
, billing
] (default: clinical
)context://fhir/admission/clinical
config://{configType}
configType
ā [server
, fhir
, security
, prompts
, documentation
]config://fhir
, config://prompts
validation://fhir/{resourceType}/{level}
resourceType
- Any FHIR resource typelevel
ā [structure
, cardinality
, terminology
, profile
, invariants
] (default: structure
)validation://fhir/Patient/terminology
examples://fhir/{resourceType}/search
resourceType
- Any FHIR resource typeexamples://fhir/Observation/search
ā Discoverable API: Templates make all resource patterns visible in MCP Inspector ā Parameter Validation: Built-in validation for enum values and required parameters ā Dynamic Construction: Claude can programmatically build resource URIs ā Interactive Testing: Easy parameter substitution in development tools ā Self-Documenting: Templates show available parameters and allowed values ā Type Safety: Full schema validation with clear error messages
Templates are automatically discovered by MCP clients and displayed in tools like MCP Inspector:
// List all available templates
const templates = await client.listResourceTemplates();
// Use resolved template URIs
const docContent = await client.readResource('fhir://r4/validation');
const promptContent = await client.readResource('prompt://fhir/clinical/patient-assessment');
const contextContent = await client.readResource('context://fhir/admission/clinical');
The template system is powered by the ResourceTemplateManager
class, providing a structured approach to resource discovery and access.
The server implements comprehensive MCP Roots functionality for file system access patterns:
The FHIR MCP server provides 5 specialized root systems for healthcare development:
file://fhir-ig
file://fhir-test-data
file://fhir-config
file://fhir-terminology
file://fhir-profiles
ā File System Integration: Direct access to FHIR development assets ā Development Workflow: Seamless integration with MCP-enabled tools ā Version Control: Easy management of FHIR artifacts in repositories ā Collaboration: Shared access to FHIR resources across teams ā Testing Support: Organized test data and validation resources ā Configuration Management: Centralized server and profile configuration
Roots are automatically discovered by MCP clients and provide file system access:
// List all available roots
const roots = await client.listRoots();
// Access FHIR Implementation Guides
// Files under file://fhir-ig/ become accessible
// Access test data resources
// Files under file://fhir-test-data/ become accessible
// Access configuration files
// Files under file://fhir-config/ become accessible
The root system enables Claude and other AI assistants to directly access, read, modify, and manage FHIR development files, making it easier to:
The server includes a comprehensive prompt management system providing contextual AI assistance for FHIR operations:
# List all available prompts
fhir_list_prompts
# Get prompts for specific resource type
fhir_list_prompts --resourceType=Patient
# Get prompts by category/tag
fhir_list_prompts --tag=clinical
# Get a specific prompt with parameters
fhir_get_prompt --id=patient-assessment --args='{"patientAge":"65","condition":"diabetes"}'
# Get contextual prompt for workflow
fhir_context_prompt --resourceType=Patient --workflow=admission --userType=clinical
Claude can access comprehensive FHIR R4 documentation through MCP resources:
// Access FHIR specification overview
await client.readResource('fhir://r4/specification')
// Get complete resource type definitions
await client.readResource('fhir://r4/resources')
// Learn about FHIR data types
await client.readResource('fhir://r4/datatypes')
// Master FHIR search capabilities
await client.readResource('fhir://r4/search')
// Understand validation requirements
await client.readResource('fhir://r4/validation')
// Access terminology guidance
await client.readResource('fhir://r4/terminology')
These resources provide Claude with deep knowledge of FHIR R4 specifications, enabling more accurate and compliant healthcare integrations.
The server includes a sophisticated elicitation system that provides interactive user input collection for complex healthcare workflows. This system transforms static FHIR operations into guided, conversational experiences.
fhir_create_interactive
Creates FHIR resources with step-by-step guidance for missing information:
// Example: Create a patient with guided input
{
"tool": "fhir_create_interactive",
"args": {
"resourceType": "Patient",
"resource": {
"resourceType": "Patient"
// Missing required fields will trigger prompts
}
}
}
// Response: Elicitation request for missing data
{
"requiresInput": true,
"elicitation": {
"prompt": "Please provide the status for Patient during creation...",
"context": "fhir_create - status elicitation",
"required": true,
"validation": { "type": "string", "enum": ["active", "inactive"] },
"examples": ["active", "inactive"]
}
}
fhir_search_guided
Provides interactive search parameter collection:
// Example: Search patients with guidance
{
"tool": "fhir_search_guided",
"args": {
"resourceType": "Patient"
// No parameters triggers guidance
}
}
// Response: Search parameter elicitation
{
"requiresInput": true,
"elicitation": {
"prompt": "To continue with this healthcare workflow, please provide...",
"examples": [
"family=Smith&given=John",
"birthdate=1990-01-15",
"identifier=MRN12345"
]
}
}
patient_identify
Handles patient identification with disambiguation:
// Example: Multiple patients found
{
"tool": "patient_identify",
"args": {
"searchParams": { "family": "Smith" }
}
}
// Response: Disambiguation request
{
"requiresInput": true,
"multipleMatches": 3,
"elicitation": {
"prompt": "Multiple patient options were found:\n\n1. Smith, John (DOB: 1990-01-01, ID: patient-001)\n2. Smith, Jane (DOB: 1985-05-15, ID: patient-002)\n3. Smith, Robert (DOB: 1978-11-30, ID: patient-003)\n\nPlease respond with the number of your choice (1-3).",
"validation": { "type": "number", "minimum": 1, "maximum": 3 }
}
}
elicit_input
Direct input requests with healthcare context:
// Example: Custom input with validation
{
"tool": "elicit_input",
"args": {
"prompt": "Please enter the patient's medical record number",
"validation": {
"type": "string",
"pattern": "^MRN\\d+$"
},
"examples": ["MRN12345", "MRN67890"]
}
}
The elicitation system provides comprehensive validation for healthcare data:
// FHIR ID validation
{ "type": "string", "pattern": "^[A-Za-z0-9\\-\\.]{1,64}$" }
// Birth date validation
{ "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }
// Medical record number validation
{ "type": "string", "pattern": "^MRN\\d+$" }
// Gender codes
{ "type": "string", "enum": ["male", "female", "other", "unknown"] }
// Observation status
{ "type": "string", "enum": ["final", "preliminary", "amended", "cancelled"] }
// Age validation
{ "type": "number", "minimum": 0, "maximum": 150 }
// Priority selection
{ "type": "number", "minimum": 1, "maximum": 5 }
The system intelligently formats healthcare resources for disambiguation:
1. Smith, John (DOB: 1990-01-01, ID: patient-001)
2. Johnson, Mary (DOB: 1985-05-15, ID: patient-002)
1. Dr. Jane Smith (Cardiology)
2. Dr. Robert Johnson (Emergency Medicine)
"This field is required and cannot be empty."
"Value must be a valid number."
"Value does not match the required format."
ā Reduced Errors: Comprehensive validation prevents invalid healthcare data entry ā Improved UX: Guided workflows make complex FHIR operations accessible ā Clinical Context: Healthcare-appropriate prompts and validation patterns ā Workflow Integration: Seamless integration with admission, discharge, and care workflows ā Multi-User Support: Tailored experiences for clinicians, administrators, and technical users ā Comprehensive Testing: 415+ test cases ensure robust validation and error handling
The elicitation system transforms static FHIR operations into intelligent, conversational experiences that guide users through complex healthcare data collection with clinical accuracy and regulatory compliance.
Add to your Claude Desktop configuration:
{
"mcpServers": {
"fhir": {
"command": "node",
"args": [
"C:\\projects\\fhir-mcp\\dist\\index.js",
"-f",
"http://localhost:3000/fhir",
"--api-key",
"your-api-key"
]
}
}
}
The FHIR MCP Server includes a comprehensive notification system powered by the dedicated FHIRNotificationManager
class that provides real-time updates about server operations, connection status, and progress tracking. These notifications appear in the Server Notifications section of MCP Inspector and other MCP-compatible tools.
The notification system is built with a clean, modular architecture:
class FHIRNotificationManager {
// Core notification methods
notifyConnectionStatus(status, details?)
notifyProgress(operation, progress, details?)
notifyError(error, context?)
notifyResourceOperation(operation, resourceType, details?)
notifyValidation(type, message, resourceType?, details?)
// Enhanced notification methods
notifyServerStartup(capabilities, transport?)
notifyOperationStart(operation, resourceType?, details?)
notifyOperationComplete(operation, resourceType?, details?)
notifyBatchOperation(operation, resourceTypes, count, details?)
notifyValidationSummary(resourceType, errorCount, warningCount, details?)
notifyConnectionTest(success, responseTime?, details?)
notifyOperationTimeout(operation, timeout, details?)
}
ConnectionStatusData
: Connection monitoring with status trackingOperationProgressData
: Progress updates with automatic value clamping (0-100)ResourceOperationData
: FHIR operation tracking with resource contextErrorData
: Error reporting with detailed context informationValidationData
: Validation results with error/warning categorizationReal-time FHIR server connection monitoring:
{
"type": "connection_status",
"status": "connected",
"fhirUrl": "http://localhost:3000",
"message": "Successfully connected to FHIR server",
"timeout": 30000,
"timestamp": "2025-09-14T15:30:00.000Z"
}
Status Types:
connecting
: Attempting to connect to FHIR serverconnected
: Successful connection establishederror
: Connection failed (ECONNREFUSED, ENOTFOUND, ETIMEDOUT)disconnected
: Connection lost or terminatedReal-time progress tracking for long-running operations:
{
"type": "operation_progress",
"operation": "search",
"progress": 75,
"resourceType": "Patient",
"message": "Search completed: found 42 Patient resources",
"resultCount": 42,
"timestamp": "2025-09-14T15:30:15.000Z"
}
Progress Stages:
Detailed tracking of all FHIR operations:
{
"type": "resource_operation",
"operation": "create",
"resourceType": "Patient",
"resourceId": "patient-123",
"message": "Creating Patient resource",
"parameters": { "validate": true },
"timestamp": "2025-09-14T15:30:30.000Z"
}
Operation Types:
create
: Resource creation operationsread
: Resource retrieval by IDupdate
: Resource modificationdelete
: Resource removalsearch
: Resource queries and filteringComprehensive error reporting with actionable context:
{
"type": "error",
"message": "Failed to create Patient resource",
"context": {
"resourceType": "Patient",
"error": "Validation failed: missing required field 'status'",
"statusCode": 400,
"errorCode": "VALIDATION_ERROR"
},
"timestamp": "2025-09-14T15:30:45.000Z"
}
Error Categories:
FHIR resource validation results with detailed feedback:
{
"type": "validation",
"validationType": "warning",
"message": "Validation passed with 2 warning(s)",
"resourceType": "Patient",
"errorCount": 0,
"warningCount": 2,
"timestamp": "2025-09-14T15:31:00.000Z"
}
Validation Types:
error
: Critical validation failures preventing resource creationwarning
: Non-critical issues that allow resource creation but need attentionComprehensive server initialization status:
{
"type": "server_startup",
"message": "FHIR MCP Server started successfully",
"transport": "StdioServerTransport",
"fhirUrl": "http://localhost:3000",
"capabilities": {
"tools": true,
"resources": true,
"notifications": true
},
"timestamp": "2025-09-14T15:25:00.000Z"
}
All notifications automatically appear in MCP Inspector's Server Notifications section:
ā Real-time Monitoring: Track FHIR operations as they execute ā Debugging Support: Detailed error context and validation feedback ā Performance Analysis: Operation timing and progress tracking ā Connection Health: Live FHIR server connectivity status ā Validation Feedback: Immediate FHIR compliance reporting ā Operational Insights: Complete audit trail of server activities
Notifications work automatically with any MCP-compatible tool:
logging/message
eventsThe notification system provides unprecedented visibility into FHIR operations, making development, debugging, and monitoring significantly more efficient.
Current Version: 1.10.1 FHIR Version: R4 Node.js: 16+ required TypeScript: 5.0+
ā Core FHIR Operations - Full CRUD operations with validation ā OAuth Authentication System - Comprehensive authentication with support for none, bearer token, and OAuth 2.0 client credentials with automatic token management ā FHIR Auto-Completion System - Intelligent completion for resource types, search parameters, status values, and code systems with MCP specification compliance ā Interactive Elicitation System - Guided user input collection with healthcare context and validation ā AI-Powered Clinical Insights - MCP sampling integration for intelligent clinical analysis, care gap identification, and decision support ā Real-Time Notifications - Modular notification system with dedicated FHIRNotificationManager class providing 12 notification methods for comprehensive monitoring ā Intelligent Validation - Complete R4 specification compliance checking with AI-powered error explanations ā Enhanced Narrative Generation - AI-enhanced human-readable resource descriptions with multiple style options ā Comprehensive FHIR Documentation - Built-in R4 specification, resource types, data types, search, validation, and terminology guidance ā MCP Resource Templates - 7 parameterized template categories for discoverable, dynamic resource access ā MCP Roots - 5 specialized file system roots for FHIR development assets (Implementation Guides, test data, configuration, terminology, profiles) ā Intelligent Prompts - 50+ contextual AI prompts for healthcare workflows ā Patient Disambiguation - Smart handling of multiple patient matches with clinical context ā Healthcare Validation - FHIR-specific patterns for IDs, dates, codes, and clinical data ā Security Framework - HIPAA-compliant data handling and audit logging ā Multi-Server Support - Works with any FHIR R4 compatible server ā MCP Integration - Full Model Context Protocol compatibility with Inspector support ā TypeScript - Complete type safety and IntelliSense support ā Comprehensive Testing - 500+ test cases with full validation coverage ā Modular Architecture - Clean separation with dedicated providers for prompts, documentation, templates, elicitation, and completions
npm run dev # Development mode with hot reload
npm run build # Build TypeScript to JavaScript
npm run start # Start production server
npm run lint # ESLint code quality check
npm run debug # Debug mode with inspector
npm run inspect # MCP Inspector for testing
npm run release # Semantic release (automated)
This project uses automated code review powered by Claude AI:
@claude
in PR comments for specific feedbackSee Claude Setup Guide for configuration details.
npm test # Run comprehensive Jest test suite (500+ tests)
npm run lint # Code style and quality checks
npm run build # TypeScript compilation validation
npm run inspect # Interactive MCP testing with inspector
The project includes:
FAQs
Model Context Protocol server for FHIR R4 with validation, narrative generation, and comprehensive resource management
The npm package fhir-mcp-server receives a total of 45 weekly downloads. As such, fhir-mcp-server popularity was classified as not popular.
We found that fhir-mcp-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.