health-os

io.github.andronaft由 GitHub 帳號 andronaft 發布v0.3.0更新於 Oct 24, 2026

Local-first personal health record: labs, meds, wearables, food log, deterministic safety checks

發布方自己的服務:Health OS

概覽

AI 產生的概覽

本地優先的個人健康紀錄 MCP 伺服器:檢驗、用藥、穿戴裝置與飲食紀錄存於自建 Postgres,並附確定性安全檢查。

可以做什麼
  • 從 PDF 或照片匯入檢驗報告,正規化名稱與單位,並逐列核准或拒絕待審紀錄
  • 讀取與更新健康紀錄:檢驗、診斷、用藥、穿戴裝置匯入與飲食日誌
  • 產生趨勢、異常偵測、篩檢行事曆、週報與就診摘要
  • 對危急值發出確定性警示,並提供固定的危機與藥物交互作用回應
  • 記錄餐點的 41 項營養概況、RDA 百分比與缺乏或過量標記
適用情境
適合希望助理在本機查詢與維護個人健康資料的人,例如詢問 LDL 趨勢、待審檢驗結果或本週營養缺口,同時把資料庫留在自己的機器上。
執行需求
以本機 Docker 容器透過 stdio 執行。完整安裝需要 Docker 與 Python 3.12+、一個 PostgreSQL 16 + pgvector 資料庫(須先執行遷移與種子資料),以及 DATABASE_URL 連線字串;建議另設 READONLY_DATABASE_URL 供唯讀 SQL 使用。另提供含虛構病患的一鍵示範。
安裝前請注意
涉及敏感醫療資料:資料庫檔案在磁碟上為明文,建議啟用磁碟加密。連接雲端助理時,工具回傳的內容會傳送給該服務商。伺服器可寫入與更新紀錄,但暫存的檢驗列須經明確核准。它不是醫療器材,也不提供醫療建議。DATABASE_URL 與 READONLY_DATABASE_URL 皆為機密資訊。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

health-os

[tests] [Listed on mcpservers.org]

Local-first personal health record, exposed over MCP. Your labs, diagnoses, medications, wearable data and food log live in your own Postgres; any MCP client — one running a local model or a cloud assistant — can read and update them through guarded tools. Critical values, drug-safety rules and screening schedules are deterministic code, not LLM judgement.

[An MCP session with the demo patient: LDL trend and the pending-review queue]

Medical disclaimer. This is not a medical device and does not give medical advice. Critical-value alerts and screening reminders are only a signal to contact a doctor — never a diagnosis and never a reason to delay care. Use at your own risk.

What it does

  • Lab results — drop a PDF or photo into your MCP client; the model extracts the values, health-os normalizes names (uk/ru/en/Latin synonyms) and units, and stages the panel as pending. Nothing counts as fact until you approve it.
  • Safety net in code — critical values alert immediately (log, macOS notification, optional Telegram); critical findings in narrative reports are flagged; drug-interaction questions are refused and redirected to a doctor/pharmacist (only deterministic checks run: total daily paracetamol across products, biotin before lab tests); a crisis tool returns a fixed response with hotlines, independent of the model.
  • Trends and analytics — Mann-Kendall trends with a per-year slope, anomalies against your own baseline (get_anomalies), a screening calendar, a weekly report, a doctor-visit brief. Risk calculators (SCORE2, ASCVD, FRAX) so far only enforce their validated age range; the formulas aren't implemented yet.
  • Food log — meals with a 41-nutrient profile, %RDA, deficiency/excess flags, meal templates.
  • Devices — Apple Health export and Garmin import.
  • 38 MCP tools + server instructions — the safety rules are sent to every client on connect; see mcp_server/README.md.

Try it in one command

Only Docker needed. Starts a throwaway database with a fictional patient — two years of labs (LDL creeping up), blood pressure, medications, a food log and a lab panel awaiting approval:

bash
git clone https://github.com/andronaft/health-os && cd health-osmake demo                             # or: cd demo && docker compose up -d --build

Point your MCP client at it:

json
{  "mcpServers": {    "health-os-demo": {      "command": "docker",      "args": ["run", "-i", "--rm", "--network", "health-os-demo",               "-e", "DATABASE_URL=postgresql+psycopg://health:demo@db:5432/health_os",               "-e", "READONLY_DATABASE_URL=postgresql+psycopg://health_readonly:demo_ro@db:5432/health_os",               "health-os:local"]    }  }}

Ask "show my health summary", "is my LDL trending up?", "what's pending review?", "what am I short on nutritionally?". Remove it all with make demo-down.

Install for your own data

Requires Docker and Python 3.12+.

bash
git clone https://github.com/andronaft/health-os && cd health-oscp .env.example .env                  # set the passwordsdocker compose up -d db               # Postgres 16 + pgvectorpython3 -m venv .venv && .venv/bin/pip install -e ".[dev]".venv/bin/alembic upgrade head        # schema.venv/bin/python -m seed.load         # marker catalog, synonyms, units, nutrients.venv/bin/python -m seed.demo         # optional: a fictional demo patient to play with

Then connect an MCP client — config for LM Studio, Open WebUI, Ollama CLI and Claude is in mcp_server/README.md. Try: "show my health summary", "LDL trend", "what am I short on nutritionally this week?".

Local models: the server speaks standard MCP over stdio, so any MCP client that runs a local model can use it. Verified so far: the server itself with the official MCP Python client (CI + the Docker demo). Not yet verified end-to-end with a local model — see #9; reports welcome.

Browser UI (preview)

bash
make ui                               # or: .venv/bin/python -m web [--port N] [--no-browser]

Starts a local, read-only web page on 127.0.0.1:8765 (port: UI_PORT in .env) and opens it with this run's session link. Only this machine can reach it: the server listens on 127.0.0.1, refuses requests with a foreign Host, and its API answers only GET requests that carry the session token. So far the page only shows whether it is connected to the server and the health-os version — the data pages come in 0.4.0 (milestone).

How it works

[Architecture: MCP client over stdio to mcp_server; read tools query approved views, write tools go through core/services into pending; safety, analytics, PostgreSQL with pgvector, ingestion]

A lab result, from report to fact

Every row of a staged panel ends up pending — nothing becomes a fact without an explicit approve. A row the catalog can't place is kept, not dropped:

[How a lab result row moves from stage_lab_panel through pending states to approved]

Unmapped and pending rows show up in list_pending_reviews and in the health summary's "awaiting review" block; a learned name maps automatically on the next panel.

DirectoryWhat's inside
core/config, DB, normalization, services, dedup, health summary
mcp_server/MCP server, read and write tools
safety/deterministic safety rules and alert delivery
analytics/trends, baselines, calculators, screening, nutrition, reports
ingestion/extraction schema, confidence scoring, device importers, embeddings
migrations/Alembic schema
seed/reference catalog + the demo patient
evals/red-team scenarios (injections, hidden critical values, unit tricks)
scripts/backup/restore (restic; install_launchd.sh schedules them on macOS), read-only role setup, importers

Privacy / local-first

  • Your data stays in your own database. Postgres runs locally in Docker; data/ and .env are outside git. Nothing is sent anywhere by health-os itself.
  • What leaves the machine depends on the MCP client you connect. With a local model (LM Studio, Open WebUI + Ollama, …) nothing does. With a cloud assistant, whatever the tools return is sent to that provider — use one whose terms fit medical data (no training on your data, zero/short retention).
  • The goal is fully local: local models for chat and extraction, local embeddings for search (already supported via fastembed). Cloud clients remain optional.
  • Optional alert channel (Telegram) sends only a generic "check your health system" text, never values.
  • Encrypt the disk (FileVault / LUKS / BitLocker) — the database files are plaintext at rest.
  • Never put real medical data in issues, PRs or tests — synthetic data only.

Tests

bash
make test              # everything (needs Postgres for the integration part)make test-unit         # pure unit tests — no database neededmake test-integration  # only tests marked `integration`

Integration tests never touch the working database: tests/conftest.py drops and recreates <POSTGRES_DB>_test on the same server (migrations + seed) on every run. Override with TEST_DATABASE_URL (the name must end in _test). Without Postgres, integration tests are skipped locally; CI sets REQUIRE_DB=1 so they fail instead.

Development history: PROGRESS.md.

License

AGPL-3.0-or-later. You may use, modify and fork health-os; if you distribute it or run a modified version as a network service, you must publish your source under the same license.

Want to use it in a closed-source or commercial product without those obligations? A separate commercial license is available from the author — reach out via GitHub (@andronaft).

Contributions are welcome — see CONTRIBUTING.md (includes a short CLA).

來源:README.md,提交 fbcdf5c

工具

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

版本歷史

3
  1. v0.3.0最新Oct 18, 2026
  2. v0.2.1Oct 1, 2026
  3. v0.2.0Sep 30, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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

其他 Health-Os 整合