FHIR MCP Server

FHIR MCP Server

Enables AI applications to query and retrieve healthcare data (patients, conditions, observations, medications) from a public FHIR R4 server via MCP tools.

Category
Visit Server

README

šŸ„ FHIR MCP Server

A FastMCP server that exposes healthcare data from the Public HAPI FHIR R4 Server using the Model Context Protocol (MCP).

This project demonstrates how AI applications can interact with standardized Electronic Health Record (EHR) data through FHIR resources.


Features

  • Search patients by name
  • Retrieve patient demographics
  • Retrieve medical conditions
  • Retrieve observations
  • Retrieve medication requests
  • Async communication using HTTPX
  • Compatible with MCP Inspector
  • Built using FastMCP

Technologies

  • Python 3.11+
  • FastMCP
  • MCP
  • HTTPX
  • FHIR R4
  • Public HAPI FHIR Server

Project Structure

fhir-mcp-server/
│
ā”œā”€ā”€ server.py
ā”œā”€ā”€ requirements.txt
ā”œā”€ā”€ README.md
ā”œā”€ā”€ LICENSE
ā”œā”€ā”€ .gitignore
│
ā”œā”€ā”€ screenshots/
│   ā”œā”€ā”€ home.png
│   ā”œā”€ā”€ search_patient.png
│   ā”œā”€ā”€ get_patient.png
│   ā”œā”€ā”€ get_conditions.png
│   ā”œā”€ā”€ get_observations.png
│   ā”œā”€ā”€ get_medications.png
│   └── architecture.png
│
└── docs/
    └── architecture.md

Installation

Clone the repository:

git clone https://github.com/baala-saravanan/fhir-mcp-server.git
cd fhir-mcp-server

Create a virtual environment:

python -m venv .venv

Activate the environment:

Windows:

.venv\Scripts\activate

Install dependencies:

pip install -r requirements.txt

Running the Project

Launch the MCP development server:

mcp dev server.py

The MCP Inspector will open automatically in your browser.


Available MCP Tools

Tool Description
search_patient Search patients by name
get_patient Retrieve patient demographics
get_conditions Retrieve patient conditions
get_observations Retrieve laboratory results and observations
get_medications Retrieve medication history

Data Source

Public HAPI FHIR R4 Test Server

https://hapi.fhir.org/baseR4

This server provides synthetic healthcare data for development and testing.


Architecture

The application follows the Model Context Protocol (MCP) architecture.

See:

  • docs/architecture.md
  • screenshots/architecture.png

Screenshots

The project includes screenshots demonstrating the available MCP tools.

  • Home
  • Search Patient
  • Get Patient
  • Get Conditions
  • Get Observations
  • Get Medications
  • Architecture Diagram

Future Improvements

  • Patient Timeline
  • Clinical Summary
  • Laboratory Trend Analysis
  • Medication Intelligence
  • Clinical Decision Support
  • AI-powered Patient Summaries
  • Streamlit Dashboard
  • FastAPI Backend
  • LLM Integration

License

This project is licensed under the MIT License.

See the LICENSE file for details.


Author

Bala Saravanan Muthukumar

  • Data Scientist
  • Biomedical Engineer
  • AI & Healthcare Enthusiast

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured