FHIR-first, read-only MCP server for the Practice Fusion EHR

Practice fusion MCP

by CDVolvik · MIT license · ★ 4 on GitHub · updated Nov 3

Practice fusion MCP cover

FHIR-first, read-only MCP server for the Practice Fusion EHR — audit-logged, HIPAA-conscious.

<p align="center">
  <img src="assets/banner.svg" alt="practice-fusion-mcp — FHIR-first, read-only MCP server for Practice Fusion" width="100%">
</p>

# practice-fusion-mcp

[![npm](https://img.shields.io/npm/v/practice-fusion-mcp?logo=npm&color=cb3837)](https://www.npmjs.com/package/practice-fusion-mcp)
[![CI](https://github.com/CDVolvik/practice-fusion-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/CDVolvik/practice-fusion-mcp/actions/workflows/ci.yml)
[![Glama score](https://glama.ai/mcp/servers/CDVolvik/practice-fusion-mcp/badges/score.svg)](https://glama.ai/mcp/servers/CDVolvik/practice-fusion-mcp)
![License: MIT](https://img.shields.io/badge/license-MIT-green)
![Node](https://img.shields.io/badge/node-%3E%3D22-brightgreen?logo=nodedotjs&logoColor=white)
![MCP](https://img.shields.io/badge/MCP-server-0a0a14)
![FHIR R4](https://img.shields.io/badge/FHIR-R4-orange)
![Access](https://img.shields.io/badge/access-read--only-blue)

An open-source, **FHIR-first, read-only** [Model Context Protocol](https://modelcontextprotocol.io) server for **Practice Fusion**. Connect Claude (Desktop / Code), Cursor, or any MCP client to a Practice Fusion EHR to search patients and providers and review appointments, conditions, medications, labs, vitals, allergies, immunizations, encounters, documents, procedures, diagnostic reports, care plans, and goals — running on Practice Fusion's **free Open FHIR account**.

Read-only by design. Audit-logged. No write access, no scheduling, no patient creation.

Overview

[](https://www.npmjs.com/package/practice-fusion-mcp) [](https://github.com/CDVolvik/practice-fusion-mcp/actions/workflows/ci.yml) [](https://glama.ai/mcp/servers/CDVolvik/practice-fusion-mcp)

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • README.md23.2 KB
Read README.md here
CDVolvik/master1 file
README.md
Show the full text358 lines

practice-fusion-mcp — FHIR-first, read-only MCP server for Practice Fusion

practice-fusion-mcp

npm CI Glama score License: MIT Node MCP FHIR R4 Access

An open-source, FHIR-first, read-only Model Context Protocol server for Practice Fusion. Connect Claude (Desktop / Code), Cursor, or any MCP client to a Practice Fusion EHR to search patients and providers and review appointments, conditions, medications, labs, vitals, allergies, immunizations, encounters, documents, procedures, diagnostic reports, care plans, and goals — running on Practice Fusion's free Open FHIR account.

Read-only by design. Audit-logged. No write access, no scheduling, no patient creation.

Contents

Architecture

flowchart LR
    C["MCP client<br/>Claude Desktop / Code · Cursor"] -- stdio --> S

    subgraph S["practice-fusion-mcp"]
      direction TB
      T["18 read tools<br/>patients · providers · appointments<br/>conditions · meds · labs · vitals<br/>allergies · immunizations · encounters<br/>documents · coverage · procedures · reports<br/>care plans · goals · everything"]
      A["Audit logger<br/>stderr + optional file<br/>free text redacted"]
      F["FHIR client<br/>Bundle unwrap · shapers<br/>pagination · sanitized errors"]
      TP["SMART backend-services<br/>TokenProvider<br/>signed JWT assertion · token cache"]
      T -. audited .-> A
      T --> F
      F --> TP
    end

    TP -- "OAuth2 client-credentials" --> AUTH["PF token endpoint"]
    F -- "read-only FHIR R4" --> PF["Practice Fusion<br/>Open FHIR API"]
    AUTH -- access token --> F

Every tool call flows through the audit logger; the FHIR client only ever holds a short-lived token minted from a signed JWT assertion (SMART backend-services), and long free-text parameters are redacted before anything is logged.

Tools

All tools are namespaced with a practicefusion_ prefix (so they don't collide when loaded alongside other MCP servers), carry a readOnlyHint annotation, and return a typed outputSchema / structuredContent. List tools accept an optional limit (default 50, max 200) and report count and has_more.

Patients & providers

Tool What it does
practicefusion_search_patients Find patients by name / birthdate / gender / identifier
practicefusion_get_patient One patient's demographics by id
practicefusion_search_practitioners Find providers by name / identifier

Clinical

Tool What it does
practicefusion_get_conditions A patient's problems / diagnoses
practicefusion_get_medications A patient's medication requests
practicefusion_get_lab_results A patient's laboratory observations
practicefusion_get_vitals A patient's vital-sign observations
practicefusion_get_allergies A patient's allergies & intolerances
practicefusion_get_immunizations A patient's immunizations

Records

Tool What it does
practicefusion_get_appointments Appointments by patient / status / date
practicefusion_get_encounters A patient's clinical encounters (visits)
practicefusion_get_documents A patient's document references (note metadata)
practicefusion_get_coverage A patient's insurance Coverage (status, payer, period)

Summary

Tool What it does
practicefusion_get_everything Pre-visit summary for a single patient — per-type counts plus a bounded sample of raw resources (FHIR $everything with a per-type-search fallback)

Procedures & care planning

Tool What it does
practicefusion_get_procedures A patient's procedures
practicefusion_get_diagnostic_reports A patient's diagnostic (lab / imaging) reports
practicefusion_get_care_plans A patient's care plans
practicefusion_get_goals A patient's care goals

Prompts & resources

Beyond tools, the server exposes the other two MCP primitives.

Prompts — ready-made templates a client can surface:

Prompt Args What it does
pre_visit_summary patientId Guides the assistant to assemble a one-minute pre-visit summary from the read tools
medication_review patientId Reviews a patient's medications against their problems and allergies (decision support, not prescribing)

Resources — readable by URI:

Resource URI What it returns
Patient summary practicefusion://patient/{patientId}/summary Every resource linked to a patient (FHIR $everything), as JSON

Resource reads are audit-logged like tool calls.

Example

Ask an MCP client a question and it composes the tools:

You: What are Ana Rivera's active medications?

// 1. resolve the patient
practicefusion_search_patients { "name": "Ana Rivera" }
// → { "results": [{ "id": "abc123", "name": "Ana Rivera", "birthDate": "1984-02-11" }], "count": 1, "has_more": false }

// 2. read her medications
practicefusion_get_medications { "patientId": "abc123" }
// → { "results": [
//      { "medication": "Lisinopril 10 mg", "status": "active" },
//      { "medication": "Atorvastatin 20 mg", "status": "active" }
//    ], "count": 2, "has_more": false }

Assistant: Ana Rivera has 2 active medications: Lisinopril 10 mg and Atorvastatin 20 mg.

Because every tool returns structuredContent, the client gets typed objects — not just text — so it can chain calls reliably.

Demo mode

You can run everything above with no Practice Fusion account. Demo mode serves in-memory synthetic fixtures — no credentials, no network, no PHI — and the example query returns exactly what's shown.

One command, nothing to clone:

npx -y practice-fusion-mcp --demo

Or from a clone:

pnpm install
pnpm dev --demo

Or point an MCP client at it with the --demo flag (or set PF_DEMO=1 in its env):

{
  "mcpServers": {
    "practice-fusion-demo": {
      "command": "npx",
      "args": ["-y", "practice-fusion-mcp", "--demo"]
    }
  }
}

The fixtures cover two patients across every resource type — conditions, medications, labs, vitals, allergies, immunizations, appointments, encounters, documents, and coverage — so each tool returns something. It's the quickest way to see the tools before wiring real credentials.

Setup

  1. Register a free Practice Fusion Open FHIR developer account and create a System / backend-services app. Note your FHIR base URL, token URL, client id, and register your app's public key.
  2. Provide the environment variables below. In production, use your MCP client's env block (shown in step 3). For local development, copy .env.example to .env — pnpm dev loads it automatically.
  3. Add to your MCP client config, e.g. Claude Desktop:
{
  "mcpServers": {
    "practice-fusion": {
      "command": "npx",
      "args": ["-y", "practice-fusion-mcp"],
      "env": {
        "PF_FHIR_BASE_URL": "https://fhir.practicefusion.com/r4",
        "PF_TOKEN_URL": "https://auth.practicefusion.com/token",
        "PF_CLIENT_ID": "your-client-id",
        "PF_PRIVATE_KEY": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
      }
    }
  }
}
Environment variables
Var Required Default Notes
PF_FHIR_BASE_URL yes — FHIR R4 base URL
PF_TOKEN_URL yes — OAuth2 token endpoint
PF_CLIENT_ID yes — Backend-services client id
PF_PRIVATE_KEY yes — PKCS8 PEM private key (matches the registered public key)
PF_SCOPES no system/*.read Requested scopes
PF_TOKEN_ALG no RS384 JWT signing alg
PF_AUDIT_LOG no — Optional file path for audit records (always also written to stderr)
PF_AUDIT_LOG_FORMAT no text Audit log file format: text (multi-line, human-readable) or ndjson (one JSON object per line, SIEM-friendly). stderr always uses text.
PF_RETRY_MAX_ATTEMPTS no 4 Total attempts for transient FHIR responses (429/502/503/504). 1 = no retry.
PF_RETRY_BASE_MS no 500 Initial backoff in ms. Doubles each attempt (500 → 1000 → 2000 …) up to PF_RETRY_CAP_MS.
PF_RETRY_CAP_MS no 8000 Maximum backoff between retries. Retry-After from the server is always honored.

MCP clients

The server speaks the Model Context Protocol over stdio, so it works in any MCP client that supports a local command + args + env config. Pick your client:

Client Tested Setup
Claude Desktop ✅ docs/clients/claude-desktop.md
Claude Code ✅ docs/clients/claude-code.md
Cursor ✅ docs/clients/cursor.md
VS Code + GitHub Copilot (Agent mode) ✅ docs/clients/vscode-copilot.md
OpenCode ✅ below — Other clients
Codex CLI ✅ below — Other clients
Cline / Roo Cline ✅ below — Other clients
Windsurf ✅ below — Other clients
Continue.dev ✅ below — Other clients
T3 code — GUI wrapper — install the MCP server in the underlying agent (Codex, Claude, Cursor, or OpenCode); the configs above apply
R21 Hermes Agent (R21-internal) ✅ below — R21 fleet
R21 OpenClaw host (R21-internal) — host (not a client) — install the MCP server in whichever agent runs on the machine (Claude Code / OpenCode / Codex CLI); the configs above apply

The same PF_* environment variables apply everywhere. The package is published on npm, so every config uses the same command: npx / args: ["-y", "practice-fusion-mcp"] pair; only the file location and JSON key (mcpServers vs servers vs mcp etc.) differ.

Other clients (one-liner configs)

All five use the same { command, args, env } shape. Only the config file location and JSON key differ.

OpenCode — global ~/.config/opencode/config.json or per-project opencode.json:

{
  "mcp": {
    "practice-fusion": {
      "type": "local",
      "command": ["npx", "-y", "practice-fusion-mcp"],
      "environment": {
        "PF_FHIR_BASE_URL": "https://fhir.practicefusion.com/r4",
        "PF_TOKEN_URL": "https://auth.practicefusion.com/token",
        "PF_CLIENT_ID": "your-client-id",
        "PF_PRIVATE_KEY": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
      }
    }
  }
}

Codex CLI — ~/.codex/config.toml:

[mcp_servers.practice-fusion]
command = "npx"
args = ["-y", "practice-fusion-mcp"]

[mcp_servers.practice-fusion.env]
PF_FHIR_BASE_URL = "https://fhir.practicefusion.com/r4"
PF_TOKEN_URL = "https://auth.practicefusion.com/token"
PF_CLIENT_ID = "your-client-id"
PF_PRIVATE_KEY = """-----BEGIN PRIVATE KEY-----
...your key...
-----END PRIVATE KEY-----"""

Cline / Roo Cline — Cline MCP settings panel, or .cline/mcp_settings.json directly (same shape as Claude Desktop — see Setup).

Windsurf — ~/.codeium/windsurf/mcp_config.json (same shape as Claude Desktop).

Continue.dev — ~/.continue/config.json under the mcpServers key (same shape as Claude Desktop).

Models

practice-fusion-mcp is model-agnostic — it doesn't care which LLM sits behind the client. Use Anthropic Claude (in any of the above clients), OpenAI GPT (Codex, Cursor, Continue), Google Gemini (Continue, Cline), local Ollama models, or NVIDIA Nemotron served via NIM inside any of the clients that accept a custom OpenAI-compatible endpoint (most do). The model you pick only changes answer quality, not which tools the server exposes.

R21 fleet

The maintainer (R21 Digital) runs practice-fusion-mcp across two R21-internal surfaces:

  • Hermes Agent — R21's multi-agent orchestration. Wire the MCP server into the Hermes sub-agent that handles healthcare/EHR work; the npx -y practice-fusion-mcp invocation is wrapped in a Make.com scenario or a Hermes tool spec. The deployer-friendly error banner (see Troubleshooting) plays well with Hermes' tool-call surfaces.
  • OpenClaw — one of the R21 fleet machines. OpenClaw is a host, not a client — the right setup is whichever agent runs there (typically Claude Code or OpenCode on the R21 fleet). Use the per-client config above for whichever agent you launch the MCP from.

For deeper R21-internal deployment notes (Make.com scenarios, Hermes sub-agent patterns, fleet-wide credential rotation), see the R21-internal docs/clients/hermes.md and docs/clients/openclaw.md (R21 Digital workspace, not this public repo).

Troubleshooting

If the server fails to start, the boot path prints a deployer-friendly error instead of a raw Zod dump. Each line names the env var and the fix:

practicefusion-mcp: configuration error
  ✗ PF_CLIENT_ID: required env var is missing
      Set it in your MCP client config or .env, e.g. the client_id from your SMART backend-services app
  ✗ PF_PRIVATE_KEY: required env var is missing
      Key must start with -----BEGIN PRIVATE KEY----- and be PKCS8 format
  ✗ PF_FHIR_BASE_URL: Invalid URL
      Must be a URL, e.g. https://fhir.practicefusion.com/r4
  … and 2 more (set PF_VERBOSE=1 for full output)

Values are never echoed — only the env var name. Set PF_VERBOSE=1 in your MCP client config to get the raw Zod issue tree when the friendly output isn't enough. The server exits 1 on any configuration error so the host can surface it.

Security & HIPAA

This server handles Protected Health Information. You, the deployer, are the covered entity or business associate: you are responsible for your own Business Associate Agreement (BAA) with Veradigm/Practice Fusion and for running this in a HIPAA-appropriate environment. Every tool call is audit-logged (stderr, plus optional file) with long free-text parameters redacted. Tokens and keys are never logged. This project ships code, not a hosted data service. See SECURITY.md for details. Not legal advice.

Known limits

  • No writes. No scheduling, no charting, no patient creation. That is the boundary, not a roadmap item.
  • The audit log contains patient identifiers. Redaction is by length: free-text parameters over 64 characters become [redacted:N], shorter structured values — a name, a birthdate — are written as sent. That is deliberate; an audit trail that cannot say who was accessed is no use for an accounting of disclosures. Treat the log as PHI and store it accordingly. See ADR 0005.
  • Shaped summaries drop fields. Each shaper keeps what the task needs. practicefusion_get_everything is the escape hatch when that is not enough.
  • One tenant per process. A single credential set and a single TokenProvider. Serving several practices means running several processes.
  • Most paths are covered against mocks. The unit suite runs with no credentials; live coverage against a real tenant is bounded by partner-account approval.

How it differs from the alternative

The other way to reach a Practice Fusion EHR is the proprietary Unity APIs. The official Practice Fusion Integrator tier is built on them and needs a Veradigm partnership; community MCP servers built on the same APIs have shown up in the directories too, and they tend to be read-write — creating patients, booking appointments, editing insurance.

This server takes the FHIR route instead. It runs on Practice Fusion's free Open FHIR account with no partnership, and it is read-only and audit-logged on purpose: a deliberately small risk surface for putting an EHR behind an LLM. If you need to write data or manage scheduling, a proprietary-API server will fit you better; if you want EHR reads you can reason about, this is the one.

If you arrived here looking for "any Practice Fusion MCP" and now want the wider FHIR / EHR / healthcare MCP landscape:

Glama's MCP directory lists all of these plus ~62k others. This server is on Glama as practice-fusion-mcp.

Development

pnpm install
pnpm test          # unit tests (mocked FHIR — no credentials needed)
pnpm typecheck     # tsc --noEmit
pnpm lint          # eslint
pnpm format        # prettier --write
pnpm build         # bundle to dist/

CI (GitHub Actions) runs Prettier, ESLint, typecheck, tests, and build on Node 22 and 24. See CONTRIBUTING.md to add a tool, and docs/adr for the architecture decisions behind the design.

1<p align="center">
2 <img src="assets/banner.svg" alt="practice-fusion-mcp — FHIR-first, read-only MCP server for Practice Fusion" width="100%">
3</p>
4 
5# practice-fusion-mcp
6 
7[![npm](https://img.shields.io/npm/v/practice-fusion-mcp?logo=npm&color=cb3837)](https://www.npmjs.com/package/practice-fusion-mcp)
8[![CI](https://github.com/CDVolvik/practice-fusion-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/CDVolvik/practice-fusion-mcp/actions/workflows/ci.yml)
9[![Glama score](https://glama.ai/mcp/servers/CDVolvik/practice-fusion-mcp/badges/score.svg)](https://glama.ai/mcp/servers/CDVolvik/practice-fusion-mcp)
10![License: MIT](https://img.shields.io/badge/license-MIT-green)
11![Node](https://img.shields.io/badge/node-%3E%3D22-brightgreen?logo=nodedotjs&logoColor=white)
12![MCP](https://img.shields.io/badge/MCP-server-0a0a14)
13![FHIR R4](https://img.shields.io/badge/FHIR-R4-orange)
14![Access](https://img.shields.io/badge/access-read--only-blue)
15 
16An open-source, **FHIR-first, read-only** [Model Context Protocol](https://modelcontextprotocol.io) server for **Practice Fusion**. Connect Claude (Desktop / Code), Cursor, or any MCP client to a Practice Fusion EHR to search patients and providers and review appointments, conditions, medications, labs, vitals, allergies, immunizations, encounters, documents, procedures, diagnostic reports, care plans, and goals — running on Practice Fusion's **free Open FHIR account**.
17 
18Read-only by design. Audit-logged. No write access, no scheduling, no patient creation.
19 
20## Contents
21 
22- [Architecture](#architecture)
23- [Tools](#tools)
24- [Prompts & resources](#prompts--resources)
25- [Example](#example)
26- [Demo mode](#demo-mode)
27- [Setup](#setup)
28 - [Environment variables](#environment-variables)
29 - [MCP clients](#mcp-clients)
30 - [Troubleshooting](#troubleshooting)
31- [Security & HIPAA](#security--hipaa)
32- [Known limits](#known-limits)
33- [How it differs from the alternative](#how-it-differs-from-the-alternative)
34- [Development](#development)
35 
36## Architecture
37 
38```mermaid
39flowchart LR
40 C["MCP client<br/>Claude Desktop / Code · Cursor"] -- stdio --> S
41 
42 subgraph S["practice-fusion-mcp"]
43 direction TB
44 T["18 read tools<br/>patients · providers · appointments<br/>conditions · meds · labs · vitals<br/>allergies · immunizations · encounters<br/>documents · coverage · procedures · reports<br/>care plans · goals · everything"]
45 A["Audit logger<br/>stderr + optional file<br/>free text redacted"]
46 F["FHIR client<br/>Bundle unwrap · shapers<br/>pagination · sanitized errors"]
47 TP["SMART backend-services<br/>TokenProvider<br/>signed JWT assertion · token cache"]
48 T -. audited .-> A
49 T --> F
50 F --> TP
51 end
52 
53 TP -- "OAuth2 client-credentials" --> AUTH["PF token endpoint"]
54 F -- "read-only FHIR R4" --> PF["Practice Fusion<br/>Open FHIR API"]
55 AUTH -- access token --> F
56```
57 
58Every tool call flows through the audit logger; the FHIR client only ever holds a short-lived token minted from a signed JWT assertion (SMART backend-services), and long free-text parameters are redacted before anything is logged.
59 
60## Tools
61 
62All tools are namespaced with a `practicefusion_` prefix (so they don't collide when loaded alongside other MCP servers), carry a `readOnlyHint` annotation, and return a typed `outputSchema` / `structuredContent`. List tools accept an optional `limit` (default 50, max 200) and report `count` and `has_more`.
63 
64**Patients & providers**
65 
66| Tool | What it does |
67| ------------------------------------- | ------------------------------------------------------- |
68| `practicefusion_search_patients` | Find patients by name / birthdate / gender / identifier |
69| `practicefusion_get_patient` | One patient's demographics by id |
70| `practicefusion_search_practitioners` | Find providers by name / identifier |
71 
72**Clinical**
73 
74| Tool | What it does |
75| ---------------------------------- | ------------------------------------ |
76| `practicefusion_get_conditions` | A patient's problems / diagnoses |
77| `practicefusion_get_medications` | A patient's medication requests |
78| `practicefusion_get_lab_results` | A patient's laboratory observations |
79| `practicefusion_get_vitals` | A patient's vital-sign observations |
80| `practicefusion_get_allergies` | A patient's allergies & intolerances |
81| `practicefusion_get_immunizations` | A patient's immunizations |
82 
83**Records**
84 
85| Tool | What it does |
86| --------------------------------- | ------------------------------------------------------ |
87| `practicefusion_get_appointments` | Appointments by patient / status / date |
88| `practicefusion_get_encounters` | A patient's clinical encounters (visits) |
89| `practicefusion_get_documents` | A patient's document references (note metadata) |
90| `practicefusion_get_coverage` | A patient's insurance Coverage (status, payer, period) |
91 
92**Summary**
93 
94| Tool | What it does |
95| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
96| `practicefusion_get_everything` | Pre-visit summary for a single patient — per-type counts plus a bounded sample of raw resources (FHIR `$everything` with a per-type-search fallback) |
97 
98**Procedures & care planning**
99 
100| Tool | What it does |
101| --------------------------------------- | ---------------------------------------------- |
102| `practicefusion_get_procedures` | A patient's procedures |
103| `practicefusion_get_diagnostic_reports` | A patient's diagnostic (lab / imaging) reports |
104| `practicefusion_get_care_plans` | A patient's care plans |
105| `practicefusion_get_goals` | A patient's care goals |
106 
107## Prompts & resources
108 
109Beyond tools, the server exposes the other two MCP primitives.
110 
111**Prompts** — ready-made templates a client can surface:
112 
113| Prompt | Args | What it does |
114| ------------------- | ----------- | -------------------------------------------------------------------------------------------------------- |
115| `pre_visit_summary` | `patientId` | Guides the assistant to assemble a one-minute pre-visit summary from the read tools |
116| `medication_review` | `patientId` | Reviews a patient's medications against their problems and allergies (decision support, not prescribing) |
117 
118**Resources** — readable by URI:
119 
120| Resource | URI | What it returns |
121| --------------- | ---------------------------------------------- | ---------------------------------------------------------------- |
122| Patient summary | `practicefusion://patient/{patientId}/summary` | Every resource linked to a patient (FHIR `$everything`), as JSON |
123 
124Resource reads are audit-logged like tool calls.
125 
126## Example
127 
128Ask an MCP client a question and it composes the tools:
129 
130> **You:** What are Ana Rivera's active medications?
131 
132```jsonc
133// 1. resolve the patient
134practicefusion_search_patients { "name": "Ana Rivera" }
135// → { "results": [{ "id": "abc123", "name": "Ana Rivera", "birthDate": "1984-02-11" }], "count": 1, "has_more": false }
136 
137// 2. read her medications
138practicefusion_get_medications { "patientId": "abc123" }
139// → { "results": [
140// { "medication": "Lisinopril 10 mg", "status": "active" },
141// { "medication": "Atorvastatin 20 mg", "status": "active" }
142// ], "count": 2, "has_more": false }
143```
144 
145> **Assistant:** Ana Rivera has 2 active medications: Lisinopril 10 mg and Atorvastatin 20 mg.
146 
147Because every tool returns `structuredContent`, the client gets typed objects — not just text — so it can chain calls reliably.
148 
149## Demo mode
150 
151You can run everything above with no Practice Fusion account. Demo mode serves in-memory synthetic fixtures — no credentials, no network, no PHI — and the example query returns exactly what's shown.
152 
153One command, nothing to clone:
154 
155```bash
156npx -y practice-fusion-mcp --demo
157```
158 
159Or from a clone:
160 
161```bash
162pnpm install
163pnpm dev --demo
164```
165 
166Or point an MCP client at it with the `--demo` flag (or set `PF_DEMO=1` in its `env`):
167 
168```json
169{
170 "mcpServers": {
171 "practice-fusion-demo": {
172 "command": "npx",
173 "args": ["-y", "practice-fusion-mcp", "--demo"]
174 }
175 }
176}
177```
178 
179The fixtures cover two patients across every resource type — conditions, medications, labs, vitals, allergies, immunizations, appointments, encounters, documents, and coverage — so each tool returns something. It's the quickest way to see the tools before wiring real credentials.
180 
181## Setup
182 
1831. Register a free Practice Fusion **Open FHIR** developer account and create a **System / backend-services** app. Note your FHIR base URL, token URL, client id, and register your app's public key.
1842. Provide the environment variables below. In production, use your MCP client's `env` block (shown in step 3). For local development, copy `.env.example` to `.env` — `pnpm dev` loads it automatically.
1853. Add to your MCP client config, e.g. Claude Desktop:
186 
187```json
188{
189 "mcpServers": {
190 "practice-fusion": {
191 "command": "npx",
192 "args": ["-y", "practice-fusion-mcp"],
193 "env": {
194 "PF_FHIR_BASE_URL": "https://fhir.practicefusion.com/r4",
195 "PF_TOKEN_URL": "https://auth.practicefusion.com/token",
196 "PF_CLIENT_ID": "your-client-id",
197 "PF_PRIVATE_KEY": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
198 }
199 }
200 }
201}
202```
203 
204### Environment variables
205 
206| Var | Required | Default | Notes |
207| ----------------------- | -------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
208| `PF_FHIR_BASE_URL` | yes | — | FHIR R4 base URL |
209| `PF_TOKEN_URL` | yes | — | OAuth2 token endpoint |
210| `PF_CLIENT_ID` | yes | — | Backend-services client id |
211| `PF_PRIVATE_KEY` | yes | — | PKCS8 PEM private key (matches the registered public key) |
212| `PF_SCOPES` | no | `system/*.read` | Requested scopes |
213| `PF_TOKEN_ALG` | no | `RS384` | JWT signing alg |
214| `PF_AUDIT_LOG` | no | — | Optional file path for audit records (always also written to stderr) |
215| `PF_AUDIT_LOG_FORMAT` | no | `text` | Audit log file format: `text` (multi-line, human-readable) or `ndjson` (one JSON object per line, SIEM-friendly). stderr always uses `text`. |
216| `PF_RETRY_MAX_ATTEMPTS` | no | `4` | Total attempts for transient FHIR responses (429/502/503/504). 1 = no retry. |
217| `PF_RETRY_BASE_MS` | no | `500` | Initial backoff in ms. Doubles each attempt (500 → 1000 → 2000 …) up to `PF_RETRY_CAP_MS`. |
218| `PF_RETRY_CAP_MS` | no | `8000` | Maximum backoff between retries. `Retry-After` from the server is always honored. |
219 
220## MCP clients
221 
222The server speaks the [Model Context Protocol](https://modelcontextprotocol.io) over stdio, so it works in any MCP client that supports a local `command + args + env` config. Pick your client:
223 
224| Client | Tested | Setup |
225| ------------------------------------- | :----: | ------------------------------------------------------------------------------------------------------------------------------------------------- |
226| Claude Desktop | ✅ | [`docs/clients/claude-desktop.md`](docs/clients/claude-desktop.md) |
227| Claude Code | ✅ | [`docs/clients/claude-code.md`](docs/clients/claude-code.md) |
228| Cursor | ✅ | [`docs/clients/cursor.md`](docs/clients/cursor.md) |
229| VS Code + GitHub Copilot (Agent mode) | ✅ | [`docs/clients/vscode-copilot.md`](docs/clients/vscode-copilot.md) |
230| OpenCode | ✅ | below — _Other clients_ |
231| Codex CLI | ✅ | below — _Other clients_ |
232| Cline / Roo Cline | ✅ | below — _Other clients_ |
233| Windsurf | ✅ | below — _Other clients_ |
234| Continue.dev | ✅ | below — _Other clients_ |
235| T3 code | — | GUI wrapper — install the MCP server in the underlying agent (Codex, Claude, Cursor, or OpenCode); the configs above apply |
236| R21 Hermes Agent (R21-internal) | ✅ | below — _R21 fleet_ |
237| R21 OpenClaw host (R21-internal) | — | host (not a client) — install the MCP server in whichever agent runs on the machine (Claude Code / OpenCode / Codex CLI); the configs above apply |
238 
239The same `PF_*` environment variables apply everywhere. The package is published on npm, so every config uses the same `command: npx` / `args: ["-y", "practice-fusion-mcp"]` pair; only the file location and JSON key (`mcpServers` vs `servers` vs `mcp` etc.) differ.
240 
241### Other clients (one-liner configs)
242 
243All five use the same `{ command, args, env }` shape. Only the config file location and JSON key differ.
244 
245**OpenCode** — global `~/.config/opencode/config.json` or per-project `opencode.json`:
246 
247```json
248{
249 "mcp": {
250 "practice-fusion": {
251 "type": "local",
252 "command": ["npx", "-y", "practice-fusion-mcp"],
253 "environment": {
254 "PF_FHIR_BASE_URL": "https://fhir.practicefusion.com/r4",
255 "PF_TOKEN_URL": "https://auth.practicefusion.com/token",
256 "PF_CLIENT_ID": "your-client-id",
257 "PF_PRIVATE_KEY": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
258 }
259 }
260 }
261}
262```
263 
264**Codex CLI** — `~/.codex/config.toml`:
265 
266```toml
267[mcp_servers.practice-fusion]
268command = "npx"
269args = ["-y", "practice-fusion-mcp"]
270 
271[mcp_servers.practice-fusion.env]
272PF_FHIR_BASE_URL = "https://fhir.practicefusion.com/r4"
273PF_TOKEN_URL = "https://auth.practicefusion.com/token"
274PF_CLIENT_ID = "your-client-id"
275PF_PRIVATE_KEY = """-----BEGIN PRIVATE KEY-----
276...your key...
277-----END PRIVATE KEY-----"""
278```
279 
280**Cline / Roo Cline** — Cline MCP settings panel, or `.cline/mcp_settings.json` directly (same shape as Claude Desktop — see [Setup](#setup)).
281 
282**Windsurf** — `~/.codeium/windsurf/mcp_config.json` (same shape as Claude Desktop).
283 
284**Continue.dev** — `~/.continue/config.json` under the `mcpServers` key (same shape as Claude Desktop).
285 
286### Models
287 
288`practice-fusion-mcp` is model-agnostic — it doesn't care which LLM sits behind the client. Use Anthropic Claude (in any of the above clients), OpenAI GPT (Codex, Cursor, Continue), Google Gemini (Continue, Cline), local Ollama models, or **NVIDIA Nemotron** served via NIM inside any of the clients that accept a custom OpenAI-compatible endpoint (most do). The model you pick only changes answer quality, not which tools the server exposes.
289 
290### R21 fleet
291 
292The maintainer (R21 Digital) runs practice-fusion-mcp across two R21-internal surfaces:
293 
294- **Hermes Agent** — R21's multi-agent orchestration. Wire the MCP server into the Hermes sub-agent that handles healthcare/EHR work; the `npx -y practice-fusion-mcp` invocation is wrapped in a Make.com scenario or a Hermes tool spec. The deployer-friendly error banner (see [Troubleshooting](#troubleshooting)) plays well with Hermes' tool-call surfaces.
295- **OpenClaw** — one of the R21 fleet machines. OpenClaw is a host, not a client — the right setup is whichever agent runs there (typically Claude Code or OpenCode on the R21 fleet). Use the per-client config above for whichever agent you launch the MCP from.
296 
297For deeper R21-internal deployment notes (Make.com scenarios, Hermes sub-agent patterns, fleet-wide credential rotation), see the R21-internal `docs/clients/hermes.md` and `docs/clients/openclaw.md` (R21 Digital workspace, not this public repo).
298 
299## Troubleshooting
300 
301If the server fails to start, the boot path prints a deployer-friendly error instead of a raw Zod dump. Each line names the env var and the fix:
302 
303```
304practicefusion-mcp: configuration error
305 ✗ PF_CLIENT_ID: required env var is missing
306 Set it in your MCP client config or .env, e.g. the client_id from your SMART backend-services app
307 ✗ PF_PRIVATE_KEY: required env var is missing
308 Key must start with -----BEGIN PRIVATE KEY----- and be PKCS8 format
309 ✗ PF_FHIR_BASE_URL: Invalid URL
310 Must be a URL, e.g. https://fhir.practicefusion.com/r4
311 … and 2 more (set PF_VERBOSE=1 for full output)
312```
313 
314Values are never echoed — only the env var name. Set `PF_VERBOSE=1` in your MCP client config to get the raw Zod issue tree when the friendly output isn't enough. The server exits 1 on any configuration error so the host can surface it.
315 
316## Security & HIPAA
317 
318This server handles Protected Health Information. **You**, the deployer, are the covered entity or business associate: you are responsible for your own Business Associate Agreement (BAA) with Veradigm/Practice Fusion and for running this in a HIPAA-appropriate environment. Every tool call is audit-logged (stderr, plus optional file) with long free-text parameters redacted. Tokens and keys are never logged. This project ships code, not a hosted data service. See [SECURITY.md](SECURITY.md) for details. **Not legal advice.**
319 
320## Known limits
321 
322- **No writes.** No scheduling, no charting, no patient creation. That is the boundary, not a roadmap item.
323- **The audit log contains patient identifiers.** Redaction is by length: free-text parameters over 64 characters become `[redacted:N]`, shorter structured values — a name, a birthdate — are written as sent. That is deliberate; an audit trail that cannot say who was accessed is no use for an accounting of disclosures. Treat the log as PHI and store it accordingly. See [ADR 0005](docs/adr/0005-audit-log-scope.md).
324- **Shaped summaries drop fields.** Each shaper keeps what the task needs. `practicefusion_get_everything` is the escape hatch when that is not enough.
325- **One tenant per process.** A single credential set and a single `TokenProvider`. Serving several practices means running several processes.
326- **Most paths are covered against mocks.** The unit suite runs with no credentials; live coverage against a real tenant is bounded by partner-account approval.
327 
328## How it differs from the alternative
329 
330The other way to reach a Practice Fusion EHR is the proprietary Unity APIs. The official Practice Fusion Integrator tier is built on them and needs a Veradigm partnership; community MCP servers built on the same APIs have shown up in the directories too, and they tend to be **read-write** — creating patients, booking appointments, editing insurance.
331 
332This server takes the FHIR route instead. It runs on Practice Fusion's **free** Open FHIR account with no partnership, and it is **read-only** and **audit-logged** on purpose: a deliberately small risk surface for putting an EHR behind an LLM. If you need to write data or manage scheduling, a proprietary-API server will fit you better; if you want EHR reads you can reason about, this is the one.
333 
334## Related MCP servers
335 
336If you arrived here looking for "any Practice Fusion MCP" and now want the wider FHIR / EHR / healthcare MCP landscape:
337 
338- [wso2/fhir-mcp-server](https://github.com/wso2/fhir-mcp-server) — generic FHIR R4 MCP server, language-agnostic, MIT.
339- [the-momentum/fhir-mcp-server](https://github.com/the-momentum/fhir-mcp-server) — FHIR MCP server for medical data standards.
340- [erikhoward/azure-fhir-mcp-server](https://github.com/erikhoward/azure-fhir-mcp-server) — FHIR R4 against Azure Health Data Services (similar shape, Microsoft stack).
341- [jcafazzo/fhir-mcp](https://github.com/jcafazzo/fhir-mcp) — enhanced FHIR MCP with data-quality assessment and broader clinical coverage.
342- [DhairyaShah981/fhir-mcp](https://github.com/DhairyaShah981/fhir-mcp) — clinical-data bridge with reversible keyed de-identification and CDS Hooks.
343 
344Glama's [MCP directory](https://glama.ai/mcp/servers) lists all of these plus ~62k others. This server is on Glama as [practice-fusion-mcp](https://glama.ai/mcp/servers/CDVolvik/practice-fusion-mcp).
345 
346## Development
347 
348```bash
349pnpm install
350pnpm test # unit tests (mocked FHIR — no credentials needed)
351pnpm typecheck # tsc --noEmit
352pnpm lint # eslint
353pnpm format # prettier --write
354pnpm build # bundle to dist/
355```
356 
357CI (GitHub Actions) runs Prettier, ESLint, typecheck, tests, and build on Node 22 and 24. See [CONTRIBUTING.md](CONTRIBUTING.md) to add a tool, and [docs/adr](docs/adr/) for the architecture decisions behind the design.
358 
View all files on GitHub →

Details

Updated
Nov 3, 2026
License
MIT
Stars on the repo
★ 4
Checked
Source
CDVolvik/practice-fusion-mcp ↗
Creator
CDVolvik · 1 listing
View creator

Similar MCP servers

See all →
SkillTests in real browsers via Chrome DevTools MCPBrowser testing with devtoolsaddyosmani/agent-skills · by addyosmaniTests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.★ 98.7k GitHub starsAgentThis MCP server attempts to exercise all the featuresEverything MCP Servermodelcontextprotocol/servers · by modelcontextprotocolThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test…★ 90.5k GitHub starsAgentA Model Context Protocol server that provides web contentFetch MCP Servermodelcontextprotocol/servers · by modelcontextprotocolA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content…★ 90.5k GitHub starsAgentNode.js server implementing Model Context ProtocolFilesystem MCP Servermodelcontextprotocol/servers · by modelcontextprotocolNode.js server implementing Model Context Protocol (MCP) for filesystem operations.★ 90.5k GitHub starsSkillAbout libraries, frameworks, API referencesContext7 MCPupstash/context7 · by upstashThis skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.★ 62.3k GitHub starsSkillUses Chrome DevTools via MCP for efficient debuggingChromeDevTools/chrome-devtools-mcp · by ChromeDevToolsUses Chrome DevTools via MCP for efficient debugging, troubleshooting and browser automation. Use when debugging web pages, automating browser interactions, analyzing performance, or inspecting network requests. This skill does not apply to `--slim` mode (MCP configuration).★ 52.4k GitHub stars