FHIR MCP Server

FHIR MCP Server

Provides safe read-only access to synthetic healthcare data via FHIR R4, enabling AI assistants to search patients, retrieve vitals, and summarize conditions using a public sandbox.

Category
Visit Server

README

FHIR MCP Server

An MCP (Model Context Protocol) server that gives AI assistants safe, read-only access to healthcare data using the FHIR R4 standard — built on a public sandbox, so it's completely safe to run, share, and extend.

Instead of an AI assistant guessing at what a "patient," "observation," or "condition" looks like, this server lets it query real FHIR-shaped data through a small set of well-defined, guardrailed tools.

⚠️ Data note: This project connects to the SMART Health IT public sandbox (r4.smarthealthit.org), which serves synthetic, non-real test data for development purposes. No real patient data is used or stored anywhere in this project. This is a technical demonstration of AI-assisted healthcare data workflows — not a clinical or diagnostic tool.


Why this project exists

Healthcare data is one of the most valuable — and most sensitive — domains for AI to work in. Most public MCP examples connect AI to generic APIs (weather, GitHub, Slack). This one demonstrates something closer to real enterprise work: giving an AI assistant controlled, read-only access to structured clinical data, with the same instincts you'd want in a production system — least privilege, hard limits, and no write access at all.

It pairs naturally with an orchestrating agent: point an AI assistant (Claude, or any MCP-compatible client) at this server, and it can look up patients, pull their vitals, and summarize conditions in plain language — all through auditable, typed tool calls instead of free-form scraping.


Tools

Tool What it does
search_patients Search the sandbox for patients by name
get_patient Get demographic details for a patient by id
get_observations Get recent vitals/lab observations for a patient
summarize_conditions Get a plain-language summary of a patient's recorded conditions

All tools are read-only — there is no create, update, or delete capability anywhere in this server, by design.


Guardrails

This server is built with the same discipline you'd want in any production integration:

  • Read-only, always. No write, update, or delete operations exist in the codebase.
  • Result caps. Every query is capped (default 10, max 20 results) to prevent runaway responses.
  • Request timeouts. All outbound FHIR requests time out after 10 seconds.
  • Sandbox-only data source. Points exclusively at a public, synthetic FHIR test server — never a production or real clinical system.

Getting started

Prerequisites

  • Node.js 18+
  • An MCP-compatible client (e.g. Claude Desktop, or any client supporting the MCP stdio transport)

Install & build

git clone https://github.com/brianbastian01/fhir-mcp-server.git
cd fhir-mcp-server
npm install
npm run build

Run it

npm start

The server communicates over stdio, so in practice you'll point your MCP client at it rather than running it standalone. For example, in Claude Desktop's config:

{
  "mcpServers": {
    "fhir": {
      "command": "node",
      "args": ["/absolute/path/to/fhir-mcp-server/dist/index.js"]
    }
  }
}

Restart your MCP client, and the four tools above will be available for the AI to call.

Try it

Once connected, ask your AI assistant something like:

"Search the FHIR sandbox for patients named Smith, then summarize the conditions for the first result."

The assistant will call search_patients, then summarize_conditions, and give you a plain-language answer — all backed by real tool calls you can inspect.


Project structure

fhir-mcp-server/
├── src/
│   └── index.ts       # Server setup + all four tool definitions
├── dist/               # Compiled output (generated by `npm run build`)
├── package.json
├── tsconfig.json
├── LICENSE
└── README.md

Roadmap / ideas for extending this

  • Add a medications tool (FHIR MedicationRequest resource)
  • Add pagination support for large result sets
  • Add an in-memory cache to reduce repeated calls to the sandbox
  • Swap the sandbox URL for a real FHIR server behind proper auth (OAuth2/SMART on FHIR) for a production-grade version
  • Pair with a small orchestrating agent that chains these tools automatically

About

Built by Brian Bastian, Solution Architect with 14+ years in enterprise software, cloud architecture, and — more recently — AI-assisted engineering, agents, and MCP servers.

License

MIT — see LICENSE.

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
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
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
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
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
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