Connects to Epic MyChart patient portals to log in, list test results, and download them as PDFs so an AI assistant can help understand your own lab work.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Connects to Epic MyChart patient portals to log in, list test results, and download them as PDFs so an AI assistant can help understand your own lab work. list my recent lab test results and explain what they mean"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MyChart MCP Server
An MCP (Model Context Protocol) server that connects to any Epic MyChart patient portal to log in, list your test results, and download them as PDFs — so an AI assistant can help you understand your own lab work.
Epic offers no simple public login API (the official FHIR route requires per-organization app registration), so this server drives the MyChart website with Playwright:
Login is interactive and private — a visible browser window opens; you type your username/password and complete MFA yourself. Credentials never pass through the AI, the MCP protocol, or this server's tool arguments.
Session persists — cookies (including MyChart's session-scoped auth cookie) are exported to disk after login and replayed on every launch, so subsequent operations run headless until the portal expires the session server-side.
Works across MyChart versions — scraping tries the modern SPA routes (
/app/test-results) first, then classic routes, with permissive selectors.
Tools
Tool | Purpose |
| Set your health system's MyChart URL (one-time). Paste any URL from their MyChart site. |
| Opens a visible browser window; you sign in + complete MFA there. |
| Check provider config + whether the saved session is still valid. |
| List ALL test results (auto-expands "Show more"), with ids |
| Full readable content of one result (values, ranges, comments). |
| Save a result as PDF to |
| Debug: full-page PNG of what the automation browser sees. |
| Close the browser process (session stays saved on disk). |
Related MCP server: AgentCare
Installation
npm install -g mychart-mcp-server
npx playwright install chromiumOr from source:
git clone https://github.com/kriskraw80/mychart-mcp-server.git
cd mychart-mcp-server
npm install
npx playwright install chromium
npm run buildRegister with Claude Code / Claude Desktop
{
"mcpServers": {
"mychart": {
"command": "npx",
"args": ["mychart-mcp-server"]
}
}
}(Or point command at node with args: ["<path>/dist/index.js"] for a source checkout.) Restart your MCP client after config changes.
Optional environment variables
Variable | Purpose |
| Default provider URL (alternative to |
| If set on the server process, the login form is pre-filled (MFA is still completed by you in the window). Optional — typing in the window is the default and safest. |
Typical flow
mychart_set_providerwith your portal URL (e.g.https://mychart.example-health.org/MyChart)mychart_login→ sign in + MFA in the window that opens (check "Remember this device")mychart_list_test_results→ returnsr1, r2, ...mychart_get_test_result r1ormychart_download_test_result r1
Data locations
Everything lives in ~/.mychart-mcp/ — keep it out of synced folders (the Chromium profile does not tolerate file sync):
config.json— provider URLbrowser-profile/— persistent Chromium profilestorage-state.json— exported session cookies (replayed on each launch)results-cache.json— id → result-URL map from the last list calldownloads/— PDFs and screenshots
Notes & limitations
Personal use, no warranty. This tool automates the MyChart web portal to access your own health records — a right you have under HIPAA — but portal scraping is not officially sanctioned by Epic. Use at your own discretion.
MyChart's DOM varies by health system and Epic version. If listing finds nothing, use
mychart_screenshotto see the rendered page; selectors may need a tweak for your provider. Some systems host MyChart on non-obvious domains (e.g.secure.<org>.orgrather thanmychart.<org>.org) — paste the URL straight from your browser.The server prefers your system-installed Chrome (then Edge, then Playwright's bundled Chromium) — real Chrome's app-bound cookie encryption requires the whole profile to stay on one browser brand, and some Windows machines can't run the bundled build.
PDF download renders the result detail page via headless Chrome (
page.pdf), which is version-independent, rather than hunting for per-version "Download" buttons.Sessions expire server-side after idle time; just run
mychart_loginagain.login-helper.mjs,run-direct.mjs, andrun-batch.mjsdrive the builtdist/code directly — handy for re-login or batch fetching without an MCP client in the loop.
License
MIT
Available Tools
8 toolsmychart_close_browserClose MyChart BrowserAIdempotent
Close the automation browser. The login session itself is preserved in the persistent profile on disk — this only frees the browser process. The next tool call relaunches it automatically.
Inputs: no named parameters.
mychart_download_test_resultDownload MyChart Test Result as PDFAIdempotent
Save one test result as a PDF file on disk (rendered from the result detail page). Requires a logged-in session.
Args:
result_id (string): An id from mychart_list_test_results (e.g. "r3"), or a full result-detail URL.
filename (string, optional): Base filename for the PDF; defaults to " .pdf".
Files are saved to ~/.mychart-mcp/downloads. Returns: { path, bytes, id, name, date }.
Inputs: result_id (required), filename.
mychart_get_test_resultGet MyChart Test Result DetailsARead-onlyIdempotent
Open one test result and return its full readable content — component values, reference ranges, flags, and provider comments — as text. Requires a logged-in session.
Args:
result_id (string): An id from mychart_list_test_results (e.g. "r3"), or a full result-detail URL.
Returns: { id, name, date, url, text, truncated }. If truncated is true, use mychart_download_test_result for the complete PDF.
Inputs: result_id (required).
mychart_list_test_resultsList MyChart Test ResultsARead-onlyIdempotent
Fetch the full list of test results from the MyChart portal (labs, imaging, pathology, etc.). Automatically expands lazy-loaded lists ("Show more") so every available result is returned, newest first as displayed by MyChart. Requires a logged-in session.
Returns: JSON with schema: { "count": number, "listUrl": string, // the portal page that was scraped "results": [ { "id": string, // stable id for this session, e.g. "r1" — use with mychart_get_test_result / mychart_download_test_result "name": string, // test name, e.g. "CBC WITH DIFFERENTIAL" "date": string?, // collection/result date as shown by MyChart "url": string // direct link to the result detail page } ] }
Error Handling:
"Not logged in" -> run mychart_login first.
If no results are recognized, use mychart_screenshot to inspect what the portal is showing.
Inputs: no named parameters.
mychart_loginLog in to MyChartAIdempotent
Open a VISIBLE browser window at the configured MyChart login page and wait for the sign-in to complete. The user types their username/password and completes any MFA prompt directly in that window — credentials are never passed through the MCP client. (Optionally, if MYCHART_USERNAME and MYCHART_PASSWORD environment variables are set on the server process, the login form is pre-filled.)
Tip: check "Remember this device" during MFA so future logins skip the code.
The session is stored in a persistent browser profile (~/.mychart-mcp/browser-profile), so once logged in, all other tools work headlessly without repeating login until the session expires.
Args:
timeout_seconds (number): How long to wait for the user to finish signing in (default 300, max 900).
Returns: { success, landedUrl, message }
Inputs: timeout_seconds.
mychart_screenshotScreenshot Current MyChart PageARead-only
Debug aid: capture a full-page PNG of whatever page the automation browser is currently on (or the MyChart home page if idle). Useful when list/detail scraping reports nothing recognizable — the screenshot shows what the portal actually rendered.
Args:
name (string, optional): Base filename for the PNG.
Returns: { path, url }. Screenshot is saved to ~/.mychart-mcp/downloads.
Inputs: name.
mychart_session_statusCheck MyChart SessionARead-onlyIdempotent
Check whether a MyChart provider is configured and whether the saved browser session is still logged in. Runs headless; safe to call any time.
Returns: { configured, baseUrl, loggedIn, landedUrl }. If loggedIn is false, run mychart_login.
Inputs: no named parameters.
mychart_set_providerSet MyChart ProviderAIdempotent
Configure which health system's MyChart site to use. Every hospital system runs its own MyChart instance at its own URL, so this must be set once before logging in.
Args:
url (string): Any URL from the provider's MyChart site — the login page URL pasted from a browser works fine (e.g. "https://mychart.virtua.org/MyChartPRD/Authentication/Login"). It is normalized to the instance root automatically.
Returns: The normalized base URL that was saved.
The setting persists in ~/.mychart-mcp/config.json. Changing providers invalidates any saved login session for the previous provider only in the sense that tools will now target the new site.
Inputs: url (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a distinct role: configure provider, login, check session, list results, get detail, download PDF, screenshot for debugging, and close browser. No overlapping purposes that would confuse an agent.
All tools share the 'mychart_' prefix and most use verb_noun (set_provider, list_test_results, get_test_result, download_test_result, close_browser). Minor deviations include 'login', 'session_status', and 'screenshot', but the pattern remains recognizable and predictable.
Eight tools is a well-scoped size for a MyChart portal connector. Each tool covers a necessary step in the workflow (setup, auth, status, list, retrieve, download, debug, cleanup) without redundancy or bloat.
The tool set fully covers the stated purpose: configure a provider, log in, verify session, list test results, retrieve readable content, download PDFs, and debug if scraping fails. There are no obvious gaps for the intended use case.
Maintenance
Related MCP Connectors
MCP server for lacita - appointment management software
MCP server for Support & Service Management
Hosted MCP server for the Healthie EHR & telehealth API: patients, appointments, charting, tasks.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP Server Integration with Apple Shortcuts2563 npm355Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides healthcare tools for interacting with FHIR data and medical resources on EMRs like Cerner and Epic1MIT
- MIT
- AlicenseNot gradedqualityBmaintenanceOfficial Medplum MCP server for healthcare automation4,744 npm2,786Apache 2.0