Skip to main content
Glama
wso2

FHIR MCP Server

by wso2

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
FHIR_MCP_HOSTNoThe hostname or IP address the MCP server should bind to (e.g., localhost for local-only access, or 0.0.0.0 for all interfaces).localhost
FHIR_MCP_PORTNoThe port on which the MCP server will listen for incoming client requests.8000
FHIR_SERVER_SCOPESNoA space-separated list of OAuth2 scopes to request from the FHIR authorization server (e.g., user/Patient.read user/Observation.read). Add fhirUser openid to enable retrieval of user context for the get_user tool.
FHIR_MCP_SERVER_URLNoIf set, this value will be used as the server's base URL instead of generating it from host and port. Useful for custom URL configurations or when behind a proxy.
FHIR_SERVER_BASE_URLNoThe base URL of the FHIR server (e.g., https://hapi.fhir.org/baseR4). This is used to generate tool URIs and to route FHIR requests.
FHIR_SERVER_CLIENT_IDNoThe OAuth2 client ID used to authorize MCP clients with the FHIR server.
FHIR_MCP_REQUEST_TIMEOUTNoTimeout duration in seconds for requests from the MCP server to the FHIR server.30
FHIR_SERVER_ACCESS_TOKENNoThe access token to use for authenticating requests to the FHIR server. If this variable is set, the server will bypass the OAuth2 authorization flow and use this token directly for all requests.
FHIR_SERVER_CLIENT_SECRETNoThe client secret corresponding to the FHIR client ID. Used during token exchange.
FHIR_SERVER_DISABLE_AUTHORIZATIONNoIf set to True, disables authorization checks on the MCP server, allowing connections to publicly accessible FHIR servers.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_capabilities

Retrieves metadata about a specified FHIR resource type, including its supported search parameters and custom operations. This tool MUST always be invoked before performing any resource operation (such as search, read, create, update, or delete) to discover the valid searchParams and operations permitted for that resource type. Do not use this tool to fetch actual resources.

search

Executes a standard FHIR search interaction on a given resource type, returning a bundle or list of matching resources. Use this when you need to query for multiple resources based on one or more search-parameters. Do not use this tool for create, update, or delete operations, and be aware that large result sets may be paginated by the FHIR server.

read

Performs a FHIR read interaction to retrieve a single resource instance by its type and resource ID, optionally refining the response with search parameters or custom operations. Use it when you know the exact resource ID and require that one resource; do not use it for bulk queries. If additional query-level parameters or operations are needed (e.g., _elements or $validate), include them in searchParam or operation.

create

Executes a FHIR create interaction to persist a new resource of the specified type. It is required to supply the full resource payload in JSON form. Use this tool when you need to add new data (e.g., a new Patient or Observation). Note that servers may reject resources that violate profiles or mandatory bindings.

update

Performs a FHIR update interaction by replacing an existing resource instance's content with the provided payload. Use it when you need to overwrite a resource's data in its entirety, such as correcting or completing a record, and you already know the resource's logical id. Optionally, you can include searchParam for conditional updates (e.g., only update if the resource matches certain criteria) or specify a custom operation (e.g., $validate to run validation before updating) The tool returns the updated resource or an OperationOutcome detailing any errors.

delete

Execute a FHIR delete interaction on a specific resource instance. Use this tool when you need to remove a single resource identified by its logical ID or optionally filtered by search parameters. The optional id parameter must match an existing resource instance when present. If you include searchParam, the server will perform a conditional delete, deleting the resource only if it matches the given criteria. If you supply operation, it will execute the named FHIR operation (e.g., $expunge) on the resource. This tool returns a FHIR OperationOutcome describing success or failure of the deletion.

get_user

Retrieves the authenticated user's FHIR profile. Use this tool when you need to access the current user's demographic and contact details.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/wso2/fhir-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server