
Mcp Fhir
io.github.pcmedsingePublished by GitHub account pcmedsingev1.1.1Updated Oct 24, 2026
FHIR R4 read/search/validate MCP server — US Core/IPS profiles, SMART-on-FHIR auth (Epic/Cerner).
Overview
Lets an assistant read, search, paginate, and profile-validate FHIR R4 healthcare resources, optionally authenticating to Epic or Cerner sandboxes.
- What you can do
- Exposes five tools over stdio: fhir_capabilities summarizes a FHIR server's CapabilityStatement, fhir_read fetches one resource by type and logical ID, fhir_search runs FHIR query parameters and returns a Bundle with a _next_url when paginated, fhir_search_next follows that pagination link with SSRF guarding, and validate_against_profile checks a resource against US Core or IPS profiles through a HAPI validator sidecar. It can also authenticate to Epic or Cerner EHR sandboxes using SMART-on-FHIR backend services.
- When to use it
- Useful when an assistant needs to explore or query a FHIR R4 clinical data server, pull patient or observation resources, or check resources against US Core and IPS profiles. It fits health-data prototyping and integration work against public demo servers or EHR sandboxes.
- Requirements
- Runs locally as a Python package (Python 3.12+ with uv, launched via uvx). Needs FHIR_BASE_URL pointing at a FHIR R4 server; defaults to the public HAPI demo server. Profile validation needs a HAPI validator sidecar, configured with HAPI_VALIDATOR_URL. SMART authentication requires SMART_ENABLED plus SMART_CLIENT_ID and SMART_CLIENT_SECRET, with SMART_TOKEN_URL optional. Optional LangFuse keys enable observability.
Installation
In SourceWeft
- Open Mcp Fhir in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
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.
[PyPI] [PyPI - Python Version] [CI] [License]
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.
Architecture
Quick start
Claude Desktop config (claude_desktop_config.json)
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):
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):
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 <token> header.
Tokens are cached in-process and refreshed automatically 30 s before expiry.
SMART environment variables
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
- Register at https://fhir.epic.com/ → My Apps → create a backend-services app.
- Note your Client ID and Client Secret.
- Create
.envin the monorepo root (already in.gitignore):
Cerner sandbox quick-start
- Register at https://code.cerner.com/ → create a backend-services app.
- Note your Client ID and the token endpoint URL.
- Update
.env:
Claude Desktop config with SMART auth
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.
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
Profile validation
The validate_against_profile tool supports shorthand aliases:
Profile validation requires the HAPI validator sidecar (included in
docker-compose.yml at repo root).
Development
Architecture
License
Source: packages/mcp-fhir/README.md at commit 07fc507
Tools
0Version history
1- v1.1.1LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.