Back to Skill Directory
Development

FHIR

BYwso20GRADE B

Model Context Protocol server for Fast Healthcare Interoperability Resources (FHIR) APIs, enabling seamless integration with healthcare data through SMART-on-FHIR authentication and comprehensive FHIR operations.

Config Installation

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "fhir": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-fhir"
      ]
    }
  }
}

* Note: Requires restart of Claude Desktop app.

OWN THIS SKILL?

Apply for the Verified Badge to boost trust and rankings.

Claim & Verify ($99)

Adoption Framework for FHIR

Before installing any skill, define a clear objective and measurable outcome. A useful implementation question is: what workflow becomes faster, safer, or more reliable after this skill is active? If that answer is vague, delay rollout and tighten scope first.

For most teams, a low-risk pattern is preview-first rollout with one owner, one test scenario, and one rollback plan. Capture failures in a structured log so quality decisions are evidence-based. This is especially important for skills that touch file systems, external APIs, or automation chains with downstream side effects.

  • Define success metrics before installation.
  • Validate permission scope against policy boundaries.
  • Run one controlled pilot and document failure categories.
  • Promote only after acceptance checks pass consistently.

Pre-Deployment Review Questions

Use these questions before enabling the skill in shared environments. They reduce surprise incidents and make approval decisions consistent across teams.

  • What data can this skill read, write, or transmit by default?
  • Which failures are recoverable automatically and which require manual stop?
  • Do we have verifiable logs that prove safe behavior under load?
  • Is rollback tested, documented, and assigned to a clear owner?

If any answer is unclear, keep rollout in preview and close the gap before production use.

Editorial Review Snapshot

This listing includes an editorial QA layer in addition to automated rendering. Review status is based on documentation depth, content uniqueness, and operational safety signals from the upstream repository.

  • Last scan date: 2026-01-18
  • README depth: 1057 words
  • Content diversity score: 0.49 (higher is better)
  • Template signal count: 0
  • Index status: Index eligible

Recommendation: Pilot in a bounded environment first. Confirm observability and ownership before promoting to shared workflows.

Skill Implementation Board

Actionable utility module for rollout decisions. Use the inputs below to choose a deployment path, then execute the checklist and record an output note.

Input: Security Grade

B

Input: Findings

0

Input: README Depth

1057 words

Input: Index State

Eligible

Decision TriggerActionExpected Output
Input: risk band moderate, docs partial, findings 0Run a preview pilot with fixed ownership and observability checkpoints.Pilot can start with rollback checklist attached.
Input: page is index-eligibleProceed with external documentation and team onboarding draft.Reusable rollout runbook ready for team adoption.
Input: context tags/scenarios are missingDefine two concrete scenarios before broad rollout.Clear scope definition before further deployment.

Execution Steps

  1. Capture objective, owner, and rollback contact.
  2. Run one preview pilot with fixed test scenario.
  3. Record warning behavior and recovery evidence.
  4. Promote only if pilot output matches expected threshold.

Output Template

skill=fhir
mode=B
pilot_result=pass|fail
warning_count=0
next_step=rollout|patch|hold

🛡️ Security Analysis

SCANNED: 2026-01-18
SCORE: 80/100

Clean Scan Report

Our static analysis engine detected no common vulnerabilities (RCE, API Leaks, Unbounded FS).

DocumentationREADME.md

Note: The content below is automatically rendered from the repository's README file.

Model Context Protocol (MCP) Server for Fast Healthcare Interoperability Resources (FHIR) APIs

License Get Support on Stack Overflow Join the community on Discord X

Table of Contents

Overview

The FHIR MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with FHIR APIs. Designed for developers, integrators, and healthcare innovators, this server acts as a bridge between modern AI/LLM tools and healthcare data, making it easy to search, retrieve, and analyze clinical information.

Demo

Demo with HAPI FHIR server

This video showcases the MCP server's functionality when connected to a public HAPI FHIR server. This example showcases direct interaction with an open FHIR server that does not require an authorization flow.

https://github.com/user-attachments/assets/cc6ac87e-8329-4da4-a090-2d76564a3abf

Demo with EPIC Sandbox

This video showcases the MCP server's capabilities within the Epic EHR ecosystem. It demonstrates the complete OAuth 2.0 Authorization Code Grant flow.

https://github.com/user-attachments/assets/96b433f1-3e53-4564-8466-65ab48d521de

Core Features

  • MCP-compatible transport: Serves FHIR via stdio, SSE, or streamable HTTP

  • SMART-on-FHIR based authentication support: Securely authenticate with FHIR servers and clients

  • Tool integration: Integratable with any MCP client such as VS Code, Claude Desktop, and MCP Inspector

Prerequisites

  • Python 3.8+
  • uv (for dependency management)
  • An accessible FHIR API server.

Installation

You can use the FHIR MCP Server by installing our Python package, or by cloning this repository.

Installing using PyPI Package

  1. Configure Environment Variables:

    To run the server, you must set FHIR_SERVER_BASE_URL.

    • To enable authorization: Set FHIR_SERVER_BASE_URL, FHIR_SERVER_CLIENT_ID, FHIR_SERVER_CLIENT_SECRET, and FHIR_SERVER_SCOPES. Authorization is enabled by default.
    • To disable authorization: Set FHIR_SERVER_DISABLE_AUTHORIZATION to True.

    By default, the MCP server runs on http://localhost:8000, and you can customize the host and port using FHIR_MCP_HOST and FHIR_MCP_PORT.

    You can set these by exporting them as environment variables like below or by creating a .env file (referencing .env.example).

    export FHIR_SERVER_BASE_URL=""
    export FHIR_SERVER_CLIENT_ID=""
    export FHIR_SERVER_CLIENT_SECRET=""
    export FHIR_SERVER_SCOPES=""
    
    export FHIR_MCP_HOST="localhost"
    export FHIR_MCP_PORT="8000"
    
  2. Install the PyPI package and run the server

    uvx fhir-mcp-server
    

Installing from Source

  1. Clone the repository:

    git clone <repository_url>
    cd <repository_directory>
    
  2. Create a virtual environment and install dependencies:

    uv venv
    source .venv/bin/activate
    uv pip sync requirements.txt
    

    Or with pip:

    python -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
    
  3. Configure Environment Variables: Copy the example file and customize if needed:

    cp .env.example .env
    
  4. Run the server:

    uv run fhir-mcp-server
    

Installing using Docker

Running the MCP Server with Docker

You can run the MCP server using Docker for a consistent, isolated environment.

Note on Authorization: When running the MCP server locally via Docker or Docker Compose, authorization should be disabled by setting the environment variable, FHIR_SERVER_DISABLE_AUTHORIZATION=True . This would be fixed in the future releases.

  1. Build the Docker Image or pull the docker image from the container registry:

    • Build from source:
      docker build -t fhir-mcp-server .
      
    • Pull from GitHub Container Registry:
      docker pull wso2/fhir-mcp-server:latest
      
  2. Configure Environment Variables

    Copy the example environment file and edit as needed:

    cp .env.example .env
    # Edit .env to set your FHIR server, client credentials, etc.
    

    Alternatively, you can pass environment variables directly with -e flags or use Docker secrets for sensitive values. See the Configuration section for details on available environment variables.

  3. Run the Container

    docker run --env-file .env -p 8000:8000 fhir-mcp-server
    

    This will start the server and expose it on port 8000. Adjust the port mapping as needed.

Using Docker Compose with HAPI FHIR Server

For a quick setup that includes both the FHIR MCP server and a HAPI FHIR server (with PostgreSQL), use the provided docker-compose.yml. This sets up an instant development environment for testing FHIR operations.

  1. Prerequisites:

    • Docker and Docker Compose installed.
  2. Run the Stack:

    docker-compose up -d
    

    This command will:

  3. Access the Services:

  4. Configure Additional Environment Variables:

    If you need to customize OAuth or other settings, adjust the env variables in the docker-compose.yml. The compose file sets basic configuration; refer to the Configuration section for full options.

Integration with MCP Clients

The FHIR MCP Server is designed for seamless integration with various MCP clients.

VS Code

Install in VS Code Install in VS Code Insiders

Add the following JSON block to your MCP configuration file in VS Code (> V1.104). You can do this by pressing Ctrl + Shift + P and typing MCP: Open User Configuration.

Streamable HTTPSTDIOSSE
"servers": {
    "fhir": {
        "type": "http",
        "url": "http://localhost:8000/mcp",
    }
}
"servers": {
    "fhir": {
        "command": "uv",
        "args": [
            "--directory",
            "/path/to/fhir-mcp-server",
            "run",
            "fhir-mcp-server",
            "--transport",
            "stdio"
        ],
        "env": {
            "FHIR_SERVER_ACCESS_TOKEN": "Your FHIR Access Token"
        }
    }
}
"servers": {
    "fhir": {
        "type": "sse",
        "url": "http://localhost:8000/sse",
    }
}

Claude Desktop

Add the following JSON block to your Claude Desktop settings to connect to your local MCP server.

  • Launch the Claude Desktop app, click on the Claude menu in the top bar, and select "Settings…".
  • In the Settings pane, click “Developer” in the left sidebar. Then click "Edit Config". This will open your configuration file in your file system. If it doesn’t exist yet, Claude will create one automatically at:
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Open the claude_desktop_config.json file in any text editor. R

...(truncated)