NA

neiltron/apple-health-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

575 stars 24 forks 品質 75 トレンド 29MIT

ローカルファーストのApple Health MCPサーバー。AIアシスタントが、ローカルエクスポートからあなたの睡眠、運動、活動、心拍データに関する質問に答えられます。

概要

SQL を用いて Apple Health データをクエリするための MCP(Model Context Protocol)サーバー。DuckDB で構築され、迅速かつ効率的な健康データ解析が可能。 このプロジェクトは現在、Eric WolterのSimple Health Export CSVアプリに依存しています。アプリの最適な使い方については、以下の「データのエクスポート」をご覧ください。これは、Apple Healthのデータを迅速かつ確実にCSV形式でエクスポートする最も簡単な方法だと私が今感じています。もしより良いデータインポート方法のアイデアがあれば、ぜひ問題を提出してください。 - : MCPクライアントが質問をデータベースクエリに変換 - : Apple Healthデータに対して直接SQLクエリを実行 - : 週次・月次健康サマリーを生成する - : 設定可能な時間ウィンドウで怠惰な読み込み - : TTLによるクエリ結果キャッシュ インストールは不要です!Claude Desktopや他のMCPクライアントを通じてnpxと直接連携して使えます。 Claudeデスクトップの設定(~/ライブラリ/Application Support/Claude/claude_desktop_configに追加してください。

概要(AI 翻訳)

SQL と DuckDB を用いて MCP クライアントから Apple Health データを照会します。サーバーは実行されます ローカルでは、必要に応じてCSVエクスポートを読み取り、スキーマ発見のためのツールを提供します。 分析的なクエリや健康関連の要約。

要件

  • Node.js 22 以降
  • Apple Health CSVエクスポート シンプルヘルスエクスポートCSV

ネイティブのApple Health export.xmlフォーマットは現在サポートされていません。

MCPクライアントの設定

Claude Desktopの場合は、以下を追加してください ~/Library/Application Support/Claude/claude_desktop_config.json:

設定を変更した後はクライアントを再起動してください。他のMCPクライアントは 同じコマンド、引数、環境、そしてstdioのトランスポートです。

環境変数

変数 必須 デフォルト 目的
HEALTH_DATA_DIR はい — エクスポートされたCSVファイルを含むディレクトリ
MAX_MEMORY_MB いいえ 2048 DuckDBメモリ制限(メガバイト単位)
CACHE_SIZE いいえ 100 キャッシュされたクエリ結果の最大数

健康データのエクスポート

  1. iPhoneにSimple Health Export CSVをインストールして開いてください。
  2. Allを選択し、エクスポートする時間範囲を選択します。
  3. アーカイブをMCPクライアントを動かしているコンピュータに転送します。

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Apple Health MCP Server

Query Apple Health data from an MCP client using SQL and DuckDB. The server runs locally, reads CSV exports on demand, and provides tools for schema discovery, analytical queries, and health summaries.

Requirements

The native Apple Health export.xml format is not currently supported.

Configure an MCP client

For Claude Desktop, add the following to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "apple-health": {
      "command": "npx",
      "args": ["-y", "@neiltron/apple-health-mcp"],
      "env": {
        "HEALTH_DATA_DIR": "/path/to/your/unzipped/health-export"
      }
    }
  }
}

Restart the client after changing its configuration. Other MCP clients can use the same command, arguments, environment, and stdio transport.

Environment variables

Variable Required Default Purpose
HEALTH_DATA_DIR Yes — Directory containing the exported CSV files
MAX_MEMORY_MB No 2048 DuckDB memory limit in megabytes
CACHE_SIZE No 100 Maximum number of cached query results

Export health data

  1. Install and open Simple Health Export CSV on your iPhone.
  2. Select All and choose the time range to export.
  3. Transfer the archive to the computer running your MCP client.
  4. Unzip it and set HEALTH_DATA_DIR to the resulting directory.

The server reads the files in place. It does not upload the export or make network requests, although query results returned to your MCP client may be sent to that client’s configured model provider.

Tools

Tool Purpose
health_schema Discover table names, columns, units, and sample rows
health_query Run one DuckDB SELECT-family analytical statement with JSON, CSV, or summary output
health_report Generate a weekly, monthly, or custom health summary

Start with health_schema; table names depend on the files in your export. See Querying Apple Health data for the data model and working examples.

health_query accepts one DuckDB analytical statement. See Query safeguards for supported statements and restricted operations.

Query safeguards

The server limits DuckDB file access to HEALTH_DATA_DIR. It also disables network access and temporary disk storage, and it locks the database settings.

GitHub で README 全文を見る

インストール

npx -y @neiltron/apple-health-mcp
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "apple-health": { "command": "npx", "args": ["-y", "@neiltron/apple-health-mcp"], "env": { "HEALTH_DATA_DIR": "/path/to/your/unzipped/health-export" } } } }