MA

mikipalet/apple-health-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

0 stars 28 forks 质量 62 趋势 4MIT

Apple Watch / Apple Health 数据作为 Claude 的远程 MCP 服务器(所有表面,总是新鲜)

概览

一个远程的MCP服务器,将您的数据暴露给-claude. ai web,克洛德桌面,克洛德移动应用程序,克洛德代码——有近乎新鲜的数据. 公所建会. 麻省理工学院有执照 你的健康数据和秘密从来没有生活在这个repo中——只有代码才会存在. HealthKit只使用iOS,因此数据由健康自动导出应用从你的iPhone被推出. 本地MCP服务器无法到达claude.ai web/mobile,因此这个是远程的. 1. 提供Neon(Vercel Marketplace)并复制连接字符串。 2. 向Vercel部署这批货。 设置嵌入式 vars: - DATABASE URL - 您的Neon字符串 - MCP SECRET - 打开sl rand - hex 32 3. - DATABASE URL=. npm run db: migrate. 4.- 在"健康自动导出"中:- URL:https://.vercel.app/api/ingest-标题:授权:熊克-格式:JSON,所有数据类型,计时表. 5. 各地相同的URL:https://.vercel.app/api/mcp 添加一个自定义连接器与该URL. Claude.

概述(AI 翻译)

一个远程的MCP服务器,将你的APPL Watch / Apple Health数据曝光到每个克洛德表面——claude.ai web,克洛德桌面,克洛德移动应用程序和克洛德代码——有近乎新鲜的数据.

公所建会. 麻省理工学院有执照 你的健康数据和秘密从来没有生活在这个repo中——只有代码才会存在.

如何运作

HealthKit只使用iOS,所以数据由您的iPhone所驱动 健康汽车出口应用. 本地MCP服务器无法到达claude.ai web/mobile,因此这个是远程的.

□ 工具

游戏工具 它会做什么? |-|-|-.

QQ[ [T1]] 在一个范围内查询一个度量衡(raw / hour / daily / avg / sum / min / 最大值) QQ

query_events ECG、精神状态、症状、药物、周期跟踪、人力资源通知 latest_snapshot 每一度的最近值

□自作自受

  1. 数据库——提供尼翁(Vercel Marketplace → Neon)并复制连接字符串.
  2. ** 部署**——在Vercel部署这项再部署。 设置内侧 vars :

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

apple-health-mcp

A remote MCP server that exposes your Apple Watch / Apple Health data to every Claude surface — claude.ai web, Claude Desktop, the Claude mobile app, and Claude Code — with near-fresh data.

Built in public. MIT licensed. Your health data and secrets never live in this repo — only code does.

How it works

Apple Watch → iPhone HealthKit
   → Health Auto Export (iOS app) POSTs to /api/ingest every ~hour
   → Neon Postgres
   → /api/mcp (remote MCP server, this repo)
   → Claude (web · desktop · mobile · Claude Code)

HealthKit is iOS-only, so the data is pushed from your iPhone by the Health Auto Export app. Local MCP servers can’t reach claude.ai web/mobile, so this one is remote.

Tools

Tool What it does
list_metrics Discover available metrics (units, counts, date ranges)
query_metric Query a metric over a range (raw / hourly / daily / avg / sum / min / max)
list_workouts Workouts in a range, optionally by type
query_events ECG, State of Mind, symptoms, medications, cycle tracking, HR notifications
latest_snapshot Most recent value for every metric
health_sql Read-only SELECT over metric_samples, workouts, health_events

Self-host

  1. Database — provision Neon (Vercel Marketplace → Neon) and copy the connection string.
  2. Deploy — deploy this repo to Vercel. Set env vars:
    • DATABASE_URL — your Neon string
    • MCP_SECRET — openssl rand -hex 32
  3. Migrate — DATABASE_URL=... npm run db:migrate.
  4. iOS push — in Health Auto Export: Automations → REST API
    • URL: https://.vercel.app/api/ingest
    • Header: Authorization: Bearer
    • Format: JSON, all data types, schedule hourly.
  5. Connect Claude — same URL everywhere: https://.vercel.app/api/mcp
    • Web / mobile / desktop (claude.ai): add a Custom Connector with that URL. claude.ai requires OAuth, which this server implements: when prompted to sign in, an Authorize page opens — enter your MCP_SECRET as the access secret. That issues a 90-day token; no per-request URL secret.
    • Claude Code: claude mcp add --transport http apple-health https://.vercel.app/api/mcp --header "Authorization: Bearer "

Auth model

  • Claude Code / ingest use the static MCP_SECRET as a bearer (or ?key=).
  • claude.ai web/mobile/desktop require OAuth, so the server ships a minimal, stateless OAuth 2.1 layer (discovery, dynamic client registration, PKCE). The /authorize step is gated by MCP_SECRET (entered as a password), so only the secret-holder can mint a token. Codes and tokens are HMAC-signed — no DB, no deps.

Security notes

  • Treat MCP_SECRET like a password: it’s the ingest bearer and the OAuth login.
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →