Are you the author? Sign in to claim
FHIR-first, read-only MCP server for the Practice Fusion EHR — audit-logged, HIPAA-conscious.
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, and documents — running on Practice Fusion's free Open FHIR account.
Read-only by design. Audit-logged. No write access, no scheduling, no patient creation.
flowchart LR
C["MCP client<br/>Claude Desktop / Code · Cursor"] -- stdio --> S
subgraph S["practice-fusion-mcp"]
direction TB
T["12 read tools<br/>patients · providers · appointments<br/>conditions · meds · labs · vitals<br/>allergies · immunizations<br/>encounters · documents"]
A["Audit logger<br/>stderr + optional file<br/>PHI-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.
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) |
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.
env block (shown in step 3). For local development, copy .env.example to .env — pnpm dev loads it automatically.{
"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-----"
}
}
}
}
| 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. |
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.
The other Practice Fusion MCP is built on Practice Fusion's proprietary Unity APIs (paid Integrator tier) and is write-heavy. This one is FHIR-based (runs on the free Open account), read-only (smaller risk surface), and audit-logged.
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 20 and 22. See CONTRIBUTING.md to add a tool.
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases
Official GitHub integration for repos, issues, PRs, and CI/CD workflows