Epic MCP server for AI agents

Live

SMART ON FHIR

CLINICAL RECORDS

AI

Epic gives your agent clinical records in the Epic EHR over FHIR: search and match patients, read conditions, medications, results, and notes, find and book appointment slots, and file allergies, problems, vitals, and notes.

  • Per-user credentials: each call uses the actual user's token, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Epic
agent · Acme Q3
Run
Generate a patient summary for patient Z48213 before her consult.
S
epic_patient_summary
264ms
Clinical agent
The International Patient Summary for patient Z48213 lists 3 active problems, 4 current medications, and a penicillin allergy.
Sources: Epic FHIR $summary
epic
1 document
18:29
Message Claude...

Tools your clinical agent reaches for on Epic, scoped per user.

CALL ANY TOOL
53 tools for clinical records in Epic over FHIR: search and match patients, read conditions, medications, lab results, and clinical notes, find and book appointment slots, and file allergies, problems, vitals, and notes.
epic_allergy_intolerance_create
Create allergy intolerance
File a new allergy or intolerance for a patient in Epic. Returns the created AllergyIntolerance resource. Epic saves it to a holding area with verification status 'unconfirmed' until a clinician reconciles it into the chart. Use this to record an allergy the patient reports. Use epic_allergy_intolerance_search first to avoid filing a duplicate. Requires a patient FHIR ID: run epic_patient_search or epic_patient_match first.
Parameters
Name
Type
Required
Description
patient_id
string
Required
FHIR ID of the patient whose allergy to return. Get it from epic_patient_search or epic_patient_match. Example: 12345.
substance_text
string
Required
Name of the allergen as free text. Example: Penicillin.
category
string
Optional
Category of the allergen: food, medication, environment or biologic. One of: `food`, `medication`, `environment`, `biologic`.
clinical_status
string
Optional
Clinical status of the allergy: active or resolved. A resolved allergy needs an onset end date in the past. One of: `active`, `resolved`.
criticality
string
Optional
Risk of clinical harm: low, high or unable-to-assess. One of: `low`, `high`, `unable-to-assess`.
note
string
Optional
Free-text comment about the allergy. Example: Reported by patient at intake.
onset_date
string
Optional
Date the allergy was identified, as YYYY-MM-DD. Example: 2024-01-15.
reaction
string
Optional
Reaction the patient had, as free text. Example: Hives.
reaction_severity
string
Optional
Severity of the reaction: mild, moderate or severe. Used only when Reaction is set. One of: `mild`, `moderate`, `severe`.
substance_code
string
Optional
Code for the allergen in the system given by Substance System, such as an RxNorm code. Example: 7980.
substance_system
string
Optional
Coding system URI or OID of Substance Code. Example: http://www.nlm.nih.gov/research/umls/rxnorm.
type
string
Optional
Underlying mechanism: allergy or intolerance. One of: `allergy`, `intolerance`.
epic_allergy_intolerance_read
Read allergy intolerance
epic_allergy_intolerance_search
Search allergy intolerance
epic_appointment_book
Appointment book
epic_appointment_find_slots
Appointment find slots
epic_appointment_read
Read appointment
epic_appointment_search
Search appointment
epic_care_plan_read
Read care plan
epic_care_team_search
Search care team
epic_condition_create
Create condition
epic_condition_read
Read condition
epic_coverage_search
Search coverage
epic_diagnostic_report_read
Read diagnostic report
epic_diagnostic_report_search
Search diagnostic report
epic_encounter_read
Read encounter
epic_encounter_search
Search encounter
epic_immunization_read
Read immunization
epic_immunization_search
Search immunization
epic_location_read
Read location
epic_medication_request_read
Read medication request
epic_medication_request_search
Search medication request
epic_observation_create
Create observation
epic_observation_search
Search observation
epic_organization_read
Read organization
epic_patient_match
Patient match
epic_practitioner_read
Read practitioner
epic_practitioner_role_search
Search practitioner role
epic_procedure_read
Read procedure
epic_procedure_search
Search procedure
epic_schedule_get
Get schedule

For more tools, view docs.

Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Epic tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["epic"], toolNames: [
    "epic_patient_search",
    "epic_appointment_find_slots",
    "epic_appointment_book"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "Find Maria Lopez and book her into the next open new patient visit" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["epic"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "Find Maria Lopez and book her into the next open new patient visit" }],
  tools,
});

// Execute the tool call with the user's vaulted Epic OAuth token
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["epic"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Find Maria Lopez and book her into the next open new patient visit" }],
  tools,
});

// Tool call runs with the user's vaulted Epic OAuth token
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["epic"] }, pageSize: 100,
});

const agent = new Agent({
  name: "clinical_agent",
  model: "gemini-2.5-pro",
  instruction: "Epic tools scoped to this user",
  tools,
});

await agent.run("Find Maria Lopez and book her into the next open new patient visit");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Epic tool. Click to copy, paste into your agent, done.
Patient records
Copy the prompt
Copied
Find the Epic patient that matches this name, birth date, and phone number.
Copy the prompt
Copied
List this patient's active problem list items.
Copy the prompt
Copied
Generate an International Patient Summary for this patient.
Results and notes
Copy the prompt
Copied
Show this patient's lab results from the last 30 days.
Copy the prompt
Copied
Find the clinical notes from this patient's last encounter.
Copy the prompt
Copied
List this patient's active medication orders.
Scheduling and charting
Copy the prompt
Copied
Find open appointment times for a new patient visit next week.
Copy the prompt
Copied
Book the 10am time you found for this patient.
Copy the prompt
Copied
File a blood pressure reading of 128/82 to this patient's open encounter.
SEE HOW AUTH WORKS
Each user signs in to Epic once, and Scalekit stores and refreshes their tokens. Credentials stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
Epic
once. We tie it to their identity and the meetings they approved — no shared bot account, no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Epic
token lives in a vault scoped to them. User A's meetings are never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tokens:
auto-refreshed
3
Resolve
When your agent calls a
Epic
tool, we fetch the right token server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Epic
tool call is logged — who triggered it, which meeting was fetched, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other healthcare connectors.
Support and Ops Teams
Meeting prep
Pulls agenda, participant context, and open action items before every meeting.
Engineering Teams
Slack triage
Polls Slack for new messages, classifies bugs and support requests with a LangGraph router, files GitHub issues or Zendesk tickets, and confirms in the thread.
Test other agents
See the same per-user auth pattern across other healthcare connectors.
OPS
Meeting prep agent
Assemble the agenda, HubSpot attendee history, and open action items from Gmail before every meeting on the calendar.
ENGINEERING
Slack triage agent
Classify new Slack messages as bugs or support requests, file the GitHub issue or Zendesk ticket, and reply in the thread.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared Epic token looks fine in a demo. In production every chart read and booking looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared token
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Epic today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Epic as the user or through a shared service account?
As the user. Each user signs in to Epic once with SMART on FHIR, and Scalekit stores and refreshes their tokens. Every chart read and write in your audit trail is attributed to that user, not a shared service account.
Where is the Epic OAuth token stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. Refresh is automatic. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in Epic?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the read and search tools without epic_appointment_book or epic_document_reference_create. The connector has no delete tools. Scalekit also enforces scope checks before every API call.
What happens when a user revokes Epic access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
Is this connector for the Epic EHR?
Yes. It connects to the Epic EHR used by health systems, through its FHIR API, not to Epic Games. The tools work with clinical records in your health system's Epic instance: patients, conditions, encounters, results, notes, and appointments.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""epic"": {
""url"": ""https://mcp.scalekit.com/epic"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.epic]
url = ""https://mcp.scalekit.com/epic""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""epic"": {
""url"": ""https://mcp.scalekit.com/epic"",
""type"": ""http""
}
}
}