healow-mcp-server

healow-mcp-server

An MCP server that wraps the eClinicalWorks / healow FHIR R4 API so an MCP client (e.g. Claude Desktop) can read patient clinical data from one or more practices.

Category
访问服务器

README

healow-mcp-server

An MCP server that wraps the eClinicalWorks / healow FHIR R4 API so an MCP client (e.g. Claude Desktop) can read patient clinical data from one or more practices.

Auth is SMART on FHIR — Standalone Launch, confidential symmetric client with PKCE. Each practice has its own FHIR base URL and its own OAuth endpoints; endpoints are discovered at runtime from {base}/.well-known/smart-configuration (never hardcoded) and cached per practice.

Security model

  • Secrets live in the OS keychain (macOS Keychain / Windows Credential Locker / Linux Secret Service) via keyring. The SQLite store at $HEALOW_TOKEN_STORE holds only non-secret metadata (practice name, base URL, patient id, token expiry, timestamps). Long-lived refresh tokens — which are standing keys to PHI — never touch the DB file.
  • Logs go only to stderr. stdout is the MCP stdio transport. Tokens, codes, and secrets are never logged.
  • The SQLite file is created 0600, its directory 0700. TLS verification is always on; HTTP uses a 30s timeout with exponential backoff on 429/5xx and a single retry on 401 after a token refresh.

Keychain note: the bootstrap helper and the MCP server should both be launched via uv so macOS Keychain sees the same interpreter identity and does not prompt. (Verified: writing a token in one uv run process and reading it in another produces no prompt.) The definitive confirmation is the first keychain access under the real Claude Desktop launch (uv run --directory … healow-mcp as a subprocess of the GUI app); if macOS ever shows an access prompt there, approve "Always Allow" once.

Requirements

  • Python 3.11+
  • uv
uv sync

Environment variables

Variable Required Description
HEALOW_CLIENT_ID yes OAuth client id issued by healow/eCW.
HEALOW_CLIENT_SECRET yes OAuth client secret (confidential client).
HEALOW_REDIRECT_URI yes Registered redirect URI. A loopback URL (e.g. http://localhost:9999/callback) enables auto-capture during bootstrap.
HEALOW_TOKEN_STORE no SQLite metadata DB path. Default ~/.healow-mcp/tokens.db.

One-time OAuth bootstrap

Connecting a practice is a one-time, human-in-the-loop step. There are two equivalent paths.

A) CLI helper (recommended)

export HEALOW_CLIENT_ID=...      # or set these in your shell profile
export HEALOW_CLIENT_SECRET=...
export HEALOW_REDIRECT_URI=http://localhost:9999/callback

uv run python scripts/oauth_helper.py \
  --name "Acme Family Medicine" \
  --fhir-base-url https://fhir4.eclinicalworks.com/fhir/r4/<orgId>

The helper prints (and opens) the authorize URL. After you log in and consent:

  • if HEALOW_REDIRECT_URI is a loopback URL, the helper runs a temporary local server, captures the code automatically, and finishes the exchange;
  • otherwise it prompts you to paste the code (or the full redirect URL).

On success it prints the connected practice and patient id, with tokens stored in your keychain.

B) Through MCP tools

  1. connect_practice(name, fhir_base_url) → returns {authorize_url, state}.
  2. Open authorize_url in a browser, log in, and consent.
  3. Copy the code from the redirect and call complete_oauth(code, state) → returns {practice, patient_id}.

After connecting, tokens auto-refresh: proactively when the access token has < 60s of life, and reactively on a 401.

MCP tools

Auth / admin: connect_practice, complete_oauth, list_practices, whoami, get_capability_statement.

Generic FHIR: fhir_get(practice, resource, id), fhir_search(practice, resource, params) — return raw resources / Bundles.

Typed wrappers: get_patient, search_encounter, get_coverage, get_practitioner, search_observation(category=…), search_condition(category=…), search_medication_request, get_document_reference, get_binary, list_allergies, list_immunizations, list_care_plans, list_problems.

search_observation/search_condition take a friendly USCDI category (e.g. laboratory, vital-signs, problem-list-item) which maps to the FHIR category search parameter.

Pagination: typed search_*/list_* return the first page Bundle. Follow Bundle.link (rel next) via fhir_search to page further; no auto-pagination.

Claude Desktop config

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "healow": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/healow-mcp-server", "healow-mcp"],
      "env": {
        "HEALOW_CLIENT_ID": "your-client-id",
        "HEALOW_CLIENT_SECRET": "your-client-secret",
        "HEALOW_REDIRECT_URI": "http://localhost:9999/callback"
      }
    }
  }
}

Run the one-time bootstrap (path A or B) before or after adding this entry; tokens persist in your keychain across restarts.

Development

uv run pytest        # tests use httpx MockTransport + an in-memory keychain

Tests cover SMART discovery + caching, PKCE, proactive token refresh, the 401-refresh-retry path, 429 backoff, and an example resource search.

Note on category-qualified scopes

The exact string format for the category-qualified Condition/Observation scopes differs between SMART v1 and v2 granular scopes. It is centralized in healow_mcp/scopes.py (CATEGORY_SCOPE_STYLE / _category_scope) so it is a single edit once confirmed against healow's published scope list for your registered app.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选