Prototype · Preview: every server in the official registry, synced every 30 minutes. Sign in with Google to write reviews.Prototype · updated every 30 min
PopNx MCPMCP servers for people who use AI · explained in plain words

MCP FHIR

by pcmedsingeversion 1.1.1i★ 1 (Stars for the whole repo)iRuns on your computerRepository ↗
Registry nameio.github.pcmedsinge/mcp-fhir

How to install

What it does

FHIR R4 read/search/validate MCP server — US Core/IPS profiles, SMART-on-FHIR auth (Epic/Cerner).

  • Connects Runs on your computer
  • Account or key No key needed
  • Category Clinics & health

Why it ranks here

Lists are ordered by a usage score (out of 100) built from these parts

Popularity0/80GitHub stars or weekly downloads: the larger counts 60, the smaller 20
Freshness3/12Full marks for a release or code change within 30 days
Still answering0/8The cloud endpoint answered at the last check
Usage score3/100

Quality: Passed 2/3 basic checks (shown, not used for ordering) · Momentum: No data yet (Used only on the Trending tab)

Install

Pick the AI app you use, then copy the settings.

Let your AI install it with one sentence

Please install MCP FHIR. Follow https://mcp.popnx.com/i/pcmedsinge-mcp-fhir.md, show me the commands and wait for my OK before running them.

Paste it into an AI that can work on your computer (such as Claude Code or Cursor). It reads our steps, shows you the commands and waits for your OK. No key, no sign-up. · See the full text your AI reads

Passed 2/3 checks · Runs on your computer · ✓ Commands checked Nov 14, 2026

First: which AI do you use?

Pick your app and the steps appear below.

Works with Claude, with some setup first

Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone

Let AI install it

Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server MCP FHIR for Claude on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "fhir": { "command": "uvx", "args": [ "mcp-fhir" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the MCP FHIR tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Open the Claude desktop app’s settings file

    SettingsDeveloperEdit Config

  3. Paste these settings and save the file

    {
      "mcpServers": {
        "fhir": {
          "command": "uvx",
          "args": [
            "mcp-fhir"
          ]
        }
      }
    }
  4. Quit Claude and open it again

  5. Try it

    Use MCP FHIR and tell me what you can do for me, then show me one thing

    ✓ If Claude says it is using MCP FHIR or shows a MCP FHIR tool in the answer, you are connected

2 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • FHIR_BASE_URL Base URL of the FHIR R4 server (default: https://hapi.fhir.org/baseR4)
  • SMART_ENABLED Set to 'true' to enable SMART-on-FHIR OAuth 2.0 (Epic/Cerner)

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

ChatGPT cannot connect MCP FHIR yet

MCP FHIR runs on your computer, but ChatGPT can only connect servers that run on the web

What you can do instead

A · Use an app that can connect MCP FHIR

  • Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
  • Install Python (uv) on your computer first (one time)
  • Install Python (uv) on your computer first (one time)
  • Install Python (uv) on your computer first (one time)

B · Others in Clinics & health that work with ChatGPT

Picked from the most used in the same category, only ones that connect by address with no key

Works with Claude Code, with some setup first

Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server MCP FHIR for Claude Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user fhir -- uvx mcp-fhir 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the MCP FHIR tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Open Terminal

    Mac: press Command+Space and type Terminal · Windows: open PowerShell

  3. Paste this command and press Enter

    claude mcp add --scope user fhir -- uvx mcp-fhir
  4. Type /mcp in Claude Code

    You should see MCP FHIR listed as connected

  5. Try it

    Use MCP FHIR and tell me what you can do for me, then show me one thing

    ✓ If Claude Code says it is using MCP FHIR or shows a MCP FHIR tool in the answer, you are connected

2 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • FHIR_BASE_URL Base URL of the FHIR R4 server (default: https://hapi.fhir.org/baseR4)
  • SMART_ENABLED Set to 'true' to enable SMART-on-FHIR OAuth 2.0 (Epic/Cerner)

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Cursor, with some setup first

Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server MCP FHIR for Cursor on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "fhir": { "command": "uvx", "args": [ "mcp-fhir" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the MCP FHIR tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Click this button to open Cursor

    Open in Cursor

    Cursor asks you to confirm; click Install

  3. Open the AI chat in Cursor in Agent mode

  4. Try it

    Use MCP FHIR and tell me what you can do for me, then show me one thing

    ✓ If Cursor says it is using MCP FHIR or shows a MCP FHIR tool in the answer, you are connected

2 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • FHIR_BASE_URL Base URL of the FHIR R4 server (default: https://hapi.fhir.org/baseR4)
  • SMART_ENABLED Set to 'true' to enable SMART-on-FHIR OAuth 2.0 (Epic/Cerner)

Descriptions are as written by the maker.

Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with VS Code, with some setup first

Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server MCP FHIR for VS Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "fhir": { "type": "stdio", "command": "uvx", "args": [ "mcp-fhir" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the MCP FHIR tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Click this button to open VS Code

    Open in VS Code

    VS Code asks you to confirm; click Install

  3. Open the AI chat in VS Code in Agent mode

  4. Try it

    Use MCP FHIR and tell me what you can do for me, then show me one thing

    ✓ If VS Code says it is using MCP FHIR or shows a MCP FHIR tool in the answer, you are connected

2 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • FHIR_BASE_URL Base URL of the FHIR R4 server (default: https://hapi.fhir.org/baseR4)
  • SMART_ENABLED Set to 'true' to enable SMART-on-FHIR OAuth 2.0 (Epic/Cerner)

Descriptions are as written by the maker.

Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.

See every app that uses MCP →

JSON settings are under “For developers” below

Stuck? Ask people who use MCP FHIR💬 Discussion →
For developers: Terminal commands and JSON settings

Installed on your computer

Claude Code

claude mcp add --scope user fhir -- uvx mcp-fhir

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "fhir": {
      "command": "uvx",
      "args": [
        "mcp-fhir"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "fhir": {
      "command": "uvx",
      "args": [
        "mcp-fhir"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "fhir": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-fhir"
      ]
    }
  }
}

Values you fill in

  • FHIR_BASE_URL env
    Base URL of the FHIR R4 server (default: https://hapi.fhir.org/baseR4)
  • SMART_ENABLED env
    Set to 'true' to enable SMART-on-FHIR OAuth 2.0 (Epic/Cerner)

Descriptions are as written by the maker.

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

At a glance

GitHub starsi
1 (Stars for the whole repo)
This repo holds several MCP listings; its stars count once in rankings
Downloads per weeki
22/wk
Licencei
No licence stated
Connection
Runs on your computer
Latest versioni
1.1.1
Published to registryi
Jun 20, 2026
Code last changedi
Jun 21, 2026
Maker
pcmedsinge
Packages
pypi: mcp-fhir
Registry status
Active

Which apps can use it

Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.

Run on your computer in

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

All apps, with pros and cons →

Related guides

What it can do

Runs on your computer; the tool list appears in your AI app after you install it.

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 19, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account pcmedsinge, which owns the repo

  • ✓ Pass

    Still maintained

    Code last changed 5 months ago

  • ! Caution

    Has a licence

    GitHub could not identify the licence type; open the file to check

  • – Not applicable

    Endpoint responds

    This one runs on your computer; there is no internet endpoint

  • – Not applicable

    Sign-in with OAuth

    Runs on your computer and uses local settings instead

  • … Not checked yet

    No hidden instructions in tool descriptions

    Runs on your computer; we can only read tool lists from internet endpoints

Published vulnerabilities (OSV.dev)

No entries on OSV.dev for mcp-fhir@1.1.1

Checks only this package version, not every dependency · checked Nov 16, 2026

What we check → · JSON

Makers: ask for a re-check or report wrong info
For makers: add a badge to your README

If you made this, paste this code into your README. The badge links back to this page.

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/pcmedsinge-mcp-fhir.svg)](https://mcp.popnx.com/en/servers/pcmedsinge-mcp-fhir)

Discussion

Ask, share a tip or report that it does not work. Sorted by what people marked helpful.

No posts yet. Be the first to ask or share.

Posts here are written by users, not the PopNx team.

Sign in to post

User reviews

No reviews yet

Sign in to write a review

Compared with others in Clinics & healthi

  • More stars than 0% of the other 1186 servers in this category
  • Published to the registry more recently than 13% of the other 1186 servers in this category
  • Basic checks equal to or better than 51% of the other 1186 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is MCP FHIR safe?

It passed 2 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

The registry does not list a required key, though some servers ask you to sign in on first use.

Does it run on my computer or in the cloud?

It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).

Is it still maintained?

The GitHub repo last changed 5 months ago, and the latest version (1.1.1) reached the registry 5 months ago.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Python (uv) on your computer.

What can I use instead?

In the same category: Medplum MCP, Mirobody, Codescene MCP Server, WHOOP — MissingMCP, Marrow

Similar alternatives

Same category, other makers, commands already checked. Official ones first, then by stars.

Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

Medplum MCP

Securely access and manage FHIR healthcare data stored in Medplum.

by medplumWidely used★ 2.8KUpdated 4 months ago

Runs in the cloud✓ service owner · medplum.com

Mirobody

Lab results to LOINC codes and UCUM units, symptoms and diagnoses to ICPC-3. Offline, no API key.

by thetahealthGrowing↓ 725/wk★ 1.6KUpdated 9 days ago

Runs on your computer✓ thetahealth.ai

Codescene MCP Server

An MCP server that provides CodeScene Code Health analysis tools.

by codescene-ossGrowing↓ 3.8K/wk★ 85Updated 8 months ago

Runs on your computer✓ service owner · codescene.com

Marrow

Marrow Health: your Apple Health data over MCP, from the free iOS app. Reads, and writes on demand.

by skeletonarmytechEarly↓ 62/wk★ 5Updated 28 days ago

Runs on your computer✓ skeletonarmy.tech
Compared with similar ones
This one
MCP FHIR
Medplum MCPMirobodyCodescene MCP ServerWHOOP — MissingMCPMarrow
Runs whereInstalls on your computerRuns in the cloud, nothing to installInstalls on your computerInstalls on your computerRuns in the cloud, nothing to installInstalls on your computer
Needs a keyNoNoNoNoNoNo
Add with + in ClaudeNoNoNoNoNoNo
Basic checks2/34/43/32/32/43/3
LicenseNOASSERTIONApache-2.0Apache-2.0NOASSERTIONMITMIT
PriceNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registry

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

mcp-fhir

FHIR R4 MCP server — read, search, paginate, validate resources against US Core/IPS profiles,

and authenticate against Epic/Cerner EHR sandboxes via SMART-on-FHIR OAuth 2.0.

Part of the fhir-mcp-suite monorepo.

What it does

mcp-fhir exposes five MCP tools that let any MCP-compatible AI (Claude, GPT-4o, etc.) interact with any FHIR R4 server — and validate resources against US Core and IPS profiles — in a single server process. No other public FHIR MCP server combines search + validation today.

ToolDescription
fhir_capabilitiesCapabilityStatement summary — what the server supports
fhir_readRead a single resource by type + logical ID
fhir_searchSearch a resource type with FHIR query params; returns Bundle with _next_url when paginated
fhir_search_nextFollow a _next_url pagination link (SSRF-guarded)
validate_against_profileValidate a resource via the HAPI validator; supports US Core & IPS aliases

Architecture

Claude Desktop / AI client

│ MCP (stdio or SSE) ▼ ┌───────────────────────────────┐ │ mcp-fhir v1.1 │ │ ┌───────────────────────────┐│ │ │ tools/ ││ │ │ ├─ fhir_capabilities.py ││ │ │ ├─ fhir_read.py ││ │ │ ├─ fhir_search.py ││ ──► FHIR R4 server │ │ └─ validate_profile.py ││ ──► HAPI validator sidecar │ └───────────────────────────┘│ │ fhir-mcp-shared │ │ ├─ LangFuse traces (session) │ │ ├─ Pydantic structured output │ │ └─ structlog JSON logging │ └───────────────────────────────┘

Quick start

# requires Python 3.12+ and uv

uvx mcp-fhir # stdio transport (Claude Desktop, default)

SSE transport (HTTP, for API access)

MCP_TRANSPORT=sse uvx mcp-fhir

Claude Desktop config (claude_desktop_config.json)
{

"mcpServers": { "mcp-fhir": { "command": "uvx", "args": ["mcp-fhir"], "env": { "FHIR_BASE_URL": "https://hapi.fhir.org/baseR4", "HAPI_VALIDATOR_URL": "http://localhost:8082" } } } }

See full installation guide for HAPI validator setup, troubleshooting, and self-hosted FHIR server configuration.

Eval results

Golden query suite — run against the public HAPI demo server (hapi.fhir.org/baseR4):

CategoryCasesPass rate
fhir_capabilities2100 %
fhir_read4100 %
fhir_search6100 %
fhir_search_next2100 %
validate_against_profile6100 %
Total20100 %

CI gate: uv run python evals/mcp-fhir/run_eval.py --ci --threshold 0.9

Validator cases require the HAPI sidecar (docker compose up hapi-validator).

Configuration

All settings via environment variables (see .env.example):

VariableDefaultDescription
FHIR_BASE_URLhttps://hapi.fhir.org/baseR4FHIR server base URL
HAPI_VALIDATOR_URLhttp://localhost:8082HAPI validator sidecar (runs on port 3500 internally; map 8082:3500)
FHIR_TIMEOUT_S30HTTP timeout in seconds
FHIR_MAX_RESULTS20Default _count for searches
MCP_TRANSPORTstdiostdio or sse
MCP_PORT8000Port for SSE transport
LOG_FORMATjsonjson (prod) or console (dev)
LANGFUSE_PUBLIC_KEY_(unset)_LangFuse observability (optional)
LANGFUSE_SECRET_KEY_(unset)_LangFuse observability (optional)

SMART-on-FHIR authentication

mcp-fhir v1.1.0 adds SMART-on-FHIR backend services (client_credentials grant, RFC 6749) so the server can authenticate against real Epic / Cerner sandboxes — no browser redirect needed.

When SMART_ENABLED=true, every FHIR request gets an Authorization: Bearer header. Tokens are cached in-process and refreshed automatically 30 s before expiry.

SMART environment variables
VariableDefaultDescription
SMART_ENABLEDfalseSet true to activate SMART auth
SMART_CLIENT_ID""App client ID from EHR registration portal
SMART_CLIENT_SECRET""Client secret (stored as SecretStr, never logged)
SMART_TOKEN_URL""Token endpoint URL; auto-discovered if blank
SMART_SCOPESsystem/*.readSpace-separated OAuth 2.0 scopes
SMART_GRANT_TYPEclient_credentialsOAuth grant type (only client_credentials supported)
SMART_TOKEN_TIMEOUT_S15.0HTTP timeout for token requests

When SMART_TOKEN_URL is blank the server performs SMART auto-discovery: GET {FHIR_BASE_URL}/.well-known/smart-configuration → token_endpoint. Falls back to {FHIR_BASE_URL}/oauth2/token if discovery returns a non-200.

Epic sandbox quick-start
  1. Register at https://fhir.epic.com/ → My Apps → create a backend-services app.
  2. Note your Client ID and Client Secret.
  3. Create .env in the monorepo root (already in .gitignore):
FHIR_BASE_URL=https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4

SMART_ENABLED=true SMART_CLIENT_ID=your-epic-client-id SMART_CLIENT_SECRET=your-epic-client-secret

SMART_TOKEN_URL is optional — auto-discovered from FHIR_BASE_URL

Cerner sandbox quick-start
  1. Register at https://code.cerner.com/ → create a backend-services app.
  2. Note your Client ID and the token endpoint URL.
  3. Update .env:
FHIR_BASE_URL=https://fhir-ehr-code.cerner.com/r4/your-tenant-id

SMART_ENABLED=true SMART_CLIENT_ID=your-cerner-client-id SMART_CLIENT_SECRET=your-cerner-client-secret SMART_TOKEN_URL=https://authorization.cerner.com/tenants/your-tenant-id/protocols/oauth2/profiles/smart-v1/token

Claude Desktop config with SMART auth
{

"mcpServers": { "mcp-fhir": { "command": "uvx", "args": ["mcp-fhir"], "env": { "FHIR_BASE_URL": "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4", "SMART_ENABLED": "true", "SMART_CLIENT_ID": "your-epic-client-id", "SMART_CLIENT_SECRET": "your-epic-client-secret" } } } }

Programmatic client (LangGraph / any Python agent)

Use StdioServerParameters to point any Python MCP client at a FHIR server. The same pattern works in LangGraph tool nodes, LangChain agents, or plain asyncio scripts.

from mcp import ClientSession, StdioServerParameters

from mcp.client.stdio import stdio_client import asyncio, os

server = StdioServerParameters( command="uv", args=["run", "--package", "mcp-fhir", "mcp-fhir"], env={ **os.environ,

── Public HAPI (no auth) ──────────────────────────────────

"FHIR_BASE_URL": "https://hapi.fhir.org/baseR4", "SMART_ENABLED": "false",

── Epic sandbox (uncomment + fill in) ────────────────────

"FHIR_BASE_URL": "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",

"SMART_ENABLED": "true",

"SMART_CLIENT_ID": os.environ["EPIC_CLIENT_ID"],

"SMART_CLIENT_SECRET": os.environ["EPIC_CLIENT_SECRET"],

── Cerner sandbox (uncomment + fill in) ──────────────────

"FHIR_BASE_URL": "https://fhir-myrecord.cerner.com/r4/ ",

"SMART_ENABLED": "true",

"SMART_CLIENT_ID": os.environ["CERNER_CLIENT_ID"],

"SMART_CLIENT_SECRET": os.environ["CERNER_CLIENT_SECRET"],

"SMART_TOKEN_URL": "https://authorization.cerner.com/tenants/ /...",

}, )

async def main(): async with stdio_client(server) as (read, write): async with ClientSession(read, write) as session: await session.initialize() result = await session.call_tool( "fhir_search", arguments={"resource_type": "Patient", "params": {"_count": "3"}}, ) print(result.content[0].text)

asyncio.run(main())

See demo/fhir_server_configs.py for ready-to-run configs for all supported servers (public HAPI, SMART Health IT, Epic, Cerner, local Docker).

Running SMART integration tests
# Requires real sandbox credentials in .env

uv run pytest packages/mcp-fhir/tests -m smart_integration -v

Profile validation

The validate_against_profile tool supports shorthand aliases:

AliasProfile URL
us-core-patienthttp://hl7.org/fhir/us/core/StructureDefinition/us-core-patient
us-core-observationhttp://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-clinical-result
us-core-conditionhttp://hl7.org/fhir/us/core/StructureDefinition/us-core-condition-problems-health-concerns
us-core-medication-requesthttp://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
us-core-encounterhttp://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter
ips-patienthttp://hl7.org/fhir/uv/ips/StructureDefinition/Patient-uv-ips

Profile validation requires the HAPI validator sidecar (included in docker-compose.yml at repo root).

Development

# From monorepo root

uv sync uv run pytest packages/mcp-fhir/tests -v

Integration tests (requires HAPI public server access)

uv run pytest packages/mcp-fhir/tests -m integration

Architecture

Client (Claude / GPT-4o)

│ MCP protocol (stdio or SSE) ▼ mcp-fhir server (Python, anyio) ├── fhir_read ──────────► FHIR R4 server (configurable) ├── fhir_search ─────────► FHIR R4 server └── validate_against_profile │ ▼ HAPI validator sidecar (markiantorno/validator-wrapper) │ ▼ LangFuse (optional observability)

License

Apache-2.0