fhir-mcp-server

fhir-mcp-server

1

This project is a C#-based MCP server designed for interaction with FHIR servers, specifically targeting developers using FHIR R4 implementations. It supports a range of operations including CRUD, search, and FHIR transactions, and can be used with VS Code and Docker for setup.

MCP Server for FHIR

A C#-based Model Context Protocol (MCP) server that enables interaction with FHIR servers. This server is primarily designed for developers working with FHIR R4 implementations.

Demo

This demo highlights some of the MCP server's when combined with Claude client:

  1. Generating synthetic data
  2. Searching for patients and related resources
  3. Visualizing the results through a graphical representation.

Demo

Here is a link of the full demo:

Tools

CRUD, Search and Other Helpful Operations

  • CreateResource: Create a new resource on the server.
  • ReadResource: Retrieve a resource by its ID.
  • UpdateResource: Update an existing resource.
  • DeleteResource: Delete a resource from the server.
  • SearchResources: Search for resources based on specific criteria.
  • FindNumberOfResources: Count the number of resources that match a search criteria.
  • GetResourceHistory: Retrieve the history of a resource.
  • ExecuteTransaction: Execute a FHIR transaction.

FHIR Server Capability Statements

  • GetFhirVersion: Get the FHIR version of the server.
  • ListSupportedFormats: List the formats supported by the server.
  • ListResourceTypes: List the resource types supported by the server.
  • ListResourceCapabilities: List the capabilities of a specific resource type.

Getting Started

Use MCP Server in VS Code

For detailed setup information follow the official documentation.

You can use the configuration file located under . You need to update your path to point to the .csproj in you local machine.

Setting Up Infrastructure

To set up a local FHIR server environment, run:

docker compose up -d --wait

This will start two FHIR servers using Docker Compose:

  1. HAPI FHIR Server - Comes pre-loaded with sample data
  2. Azure FHIR Server - Starts with an empty database