Mychart

io.github.kriskraw80由 GitHub 帳號 kriskraw80 發布v1.0.0更新於 Oct 24, 2026

Connects to Epic MyChart patient portals: interactive login, list and download your own test results

已驗證STDIO僅桌面位置與生活檔案與儲存

概覽

AI 產生的概覽

讓助理登入你的 Epic MyChart 病患入口,列出你自己的檢驗結果,並以 PDF 形式閱讀或下載。

可以做什麼
使用 Playwright 操作 MyChart 網站,存取你自己的健康紀錄。工具涵蓋設定服務商網址、開啟可見瀏覽器進行互動式登入與 MFA、檢查工作階段狀態、列出所有檢驗結果並編號、讀取單一結果的數值與參考範圍、將結果下載為 PDF、擷取除錯截圖,以及關閉瀏覽器。工作階段會存到磁碟,之後可在入口工作階段過期前以無介面方式執行。
適用情境
當你希望助理協助你檢視某個沒有簡單公開登入 API 的 MyChart 入口中的個人檢驗資料時適用。適合個人偶爾使用,而非臨床或組織層級的工作流程。
執行需求
以 npm 套件(mychart-mcp-server)透過 stdio 在本機執行,需要 Node.js 以及 Playwright 的 Chromium,或系統安裝的 Chrome、Edge。需要 MyChart 入口網址,可透過 mychart_set_provider 工具或 MYCHART_URL 環境變數提供。選用的 MYCHART_USERNAME 與 MYCHART_PASSWORD 可預先填入登入表單。需要能連線至該入口的網路。
安裝前請注意
登入為互動式,憑證由你在可見的瀏覽器視窗中輸入,但選用的 MYCHART_USERNAME 與 MYCHART_PASSWORD 會將其放入伺服器處理程序環境。工作階段 cookie 會匯出到 ~/.mychart-mcp/ 下的 storage-state.json,該目錄含有敏感資料,不應同步。此伺服器自動化的是 Epic 未正式認可的病患入口,並會將 PDF 與截圖寫入磁碟。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mychart,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

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

ToolPurpose
mychart_set_providerSet your health system's MyChart URL (one-time). Paste any URL from their MyChart site.
mychart_loginOpens a visible browser window; you sign in + complete MFA there.
mychart_session_statusCheck provider config + whether the saved session is still valid.
mychart_list_test_resultsList ALL test results (auto-expands "Show more"), with ids r1, r2, ....
mychart_get_test_resultFull readable content of one result (values, ranges, comments).
mychart_download_test_resultSave a result as PDF to ~/.mychart-mcp/downloads.
mychart_screenshotDebug: full-page PNG of what the automation browser sees.
mychart_close_browserClose the browser process (session stays saved on disk).

Installation

bash
npm install -g mychart-mcp-servernpx playwright install chromium

Or from source:

bash
git clone https://github.com/kriskraw80/mychart-mcp-server.gitcd mychart-mcp-servernpm installnpx playwright install chromiumnpm run build

Register with Claude Code / Claude Desktop

json
{  "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

VariablePurpose
MYCHART_URLDefault provider URL (alternative to mychart_set_provider).
MYCHART_USERNAME / MYCHART_PASSWORDIf 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

  1. mychart_set_provider with your portal URL (e.g. https://mychart.example-health.org/MyChart)
  2. mychart_login → sign in + MFA in the window that opens (check "Remember this device")
  3. mychart_list_test_results → returns r1, r2, ...
  4. mychart_get_test_result r1 or mychart_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 URL
  • browser-profile/ — persistent Chromium profile
  • storage-state.json — exported session cookies (replayed on each launch)
  • results-cache.json — id → result-URL map from the last list call
  • downloads/ — 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_screenshot to see the rendered page; selectors may need a tweak for your provider. Some systems host MyChart on non-obvious domains (e.g. secure.<org>.org rather than mychart.<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_login again.
  • login-helper.mjs, run-direct.mjs, and run-batch.mjs drive the built dist/ code directly — handy for re-login or batch fetching without an MCP client in the loop.

License

MIT

來源:README.md,提交 99e2a65

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分