smart-mcp-server
Click on "Install 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., "@smart-mcp-serverApply the immunization plan definition to Patient/123"
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.
FHIR MCP Server
A Model Context Protocol (MCP) server that provides comprehensive FHIR R4 operations including PlanDefinition $apply, resource management, terminology services, and Questionnaire/StructureMap transformation via Matchbox.
Purpose
This MCP server provides a secure interface for AI assistants to interact with FHIR R4 servers, enabling clinical decision support workflows through PlanDefinitions, resource creation/management, terminology lookups, and structured data capture via Questionnaires.
Features
ImplementationGuide Context Management
fhir_set_implementation_guide_context- Set the IG context for resource validationfhir_get_current_implementation_guide_context- Get the currently set IG contextfhir_get_implementation_guide- Retrieve full IG details by ID or URLfhir_list_implementation_guides- List available IGs on the server
PlanDefinition Operations
fhir_list_plan_definitions- List available PlanDefinitions with filtersfhir_get_plan_definition- Get full PlanDefinition details including actionsfhir_apply_plan_definition- Execute $apply to generate a CarePlan
Generic Resource Operations
fhir_get_resource- Retrieve any FHIR resource by type and IDfhir_search_resources- Search resources with FHIR search parametersfhir_create_resource- Create any FHIR resource using raw JSONfhir_update_resource- Update an existing resourcefhir_delete_resource- Delete a resource
Terminology Services
fhir_list_valuesets- List available ValueSetsfhir_expand_valueset- Expand a ValueSet to get all codesfhir_list_codesystems- List available CodeSystemsfhir_lookup_code- Look up a code's display and properties
Questionnaire Operations
fhir_get_questionnaire- Retrieve a Questionnaire for data capturefhir_list_questionnaires- List available Questionnairesfhir_transform_questionnaire_response- Transform via StructureMap on Matchbox
Server Information
fhir_get_server_capability- Get the server's CapabilityStatement
Prerequisites
Docker Desktop with MCP Toolkit enabled
Docker MCP CLI plugin (
docker mcpcommand)FHIR R4 server running (default: http://localhost:8080/fhir)
Matchbox server for StructureMap transforms (default: http://localhost:8081/matchboxv3/fhir)
Configuration
Environment variables:
FHIR_SERVER_URL- Base URL of the FHIR server (default: http://localhost:8080/fhir)MATCHBOX_SERVER_URL- Base URL of Matchbox server (default: http://localhost:8081/matchboxv3/fhir)
Installation
See the step-by-step instructions provided with the files.
Usage Examples
In Claude Desktop, you can ask:
ImplementationGuide Context
"Set the implementation guide context to the WHO SMART Guidelines IG"
"What implementation guide are we currently using?"
"List all available implementation guides"
PlanDefinition Workflows
"List all active plan definitions"
"Show me the details of the diabetes screening plan definition"
"Apply the immunization plan definition to Patient/123"
"What actions are defined in PlanDefinition/anc-contact?"
Resource Management
"Create a new Patient resource with name John Smith, born 1980-01-15"
"Search for all Observations for Patient/123"
"Get the Condition with ID abc123"
"Delete the Observation with ID temp-obs-1"
Terminology
"List ValueSets related to pregnancy"
"Expand the administrative gender ValueSet"
"Look up LOINC code 8867-4"
"What codes are in the observation category CodeSystem?"
Questionnaire Workflow
"Get the ANC registration questionnaire"
"List all active questionnaires"
"Transform this QuestionnaireResponse using the ANC StructureMap"
Architecture
Claude Desktop → MCP Gateway → FHIR MCP Server → FHIR Server (localhost:8080)
↓
Matchbox Server (localhost:8081)
(for StructureMap transforms)Workflow: Using Questionnaires to Create Resources
Get the Questionnaire: Use
fhir_get_questionnaireto retrieve the questionnaire structureAsk Questions: The agent asks the user each question based on the Questionnaire items
Build QuestionnaireResponse: The agent constructs the QuestionnaireResponse JSON
Transform: Use
fhir_transform_questionnaire_responseto convert to FHIR resources via MatchboxCreate Resources: The transformed Bundle can be processed to create individual resources
Workflow: Applying PlanDefinitions
Set Context: Use
fhir_set_implementation_guide_contextto set the IGFind PlanDefinition: Use
fhir_list_plan_definitionsto find available plansReview Requirements: Use
fhir_get_plan_definitionto see what data is neededPrepare Data: Create required resources (Patient, Observations, etc.)
Apply: Use
fhir_apply_plan_definitionto generate the CarePlanProcess: The agent processes the returned CarePlan activities
Development
Local Testing
# Set environment variables for testing
export FHIR_SERVER_URL="http://localhost:8080/fhir"
export MATCHBOX_SERVER_URL="http://localhost:8081/matchboxv3/fhir"
# Run directly
python fhir_server.py
# Test MCP protocol
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | python fhir_server.pyAdding New Tools
Add the function to
fhir_server.pyDecorate with
@mcp.tool()Use SINGLE-LINE docstrings only
Use empty string defaults for parameters
Update the catalog entry with the new tool name
Rebuild the Docker image
Troubleshooting
Tools Not Appearing
Verify Docker image built successfully
Check catalog and registry files
Ensure Claude Desktop config includes custom catalog
Restart Claude Desktop
FHIR Server Connection Errors
Verify FHIR server is running and accessible
Check the FHIR_SERVER_URL environment variable
Test with:
curl http://localhost:8080/fhir/metadata
Matchbox Transform Errors
Verify Matchbox server is running
Check that the StructureMap exists and is valid
Ensure QuestionnaireResponse references the correct Questionnaire
Validation Errors
Set the ImplementationGuide context before creating resources
Check that resources conform to the expected profiles
Review the OperationOutcome details in error messages
Security Considerations
No authentication configured by default (suitable for local development)
For production, configure FHIR server authentication
Running as non-root user in Docker
Sensitive data never logged
FHIR Resources
FHIR R4 Specification: https://hl7.org/fhir/R4/
PlanDefinition: https://hl7.org/fhir/R4/plandefinition.html
$apply Operation: https://hl7.org/fhir/R4/plandefinition-operation-apply.html
Questionnaire: https://hl7.org/fhir/R4/questionnaire.html
StructureMap: https://hl7.org/fhir/R4/structuremap.html
License
MIT License
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/DigitalSQR/smart-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server