
neiltron/apple-health-mcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
로컬 우선 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 데스크탑 설정에 추가하세요 (~/라이브러리/애플리케이션 지원/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 |
캐시된 쿼리 결과 최대 수 |
건강 데이터 내보내기
- 아이폰에 Simple Health Export CSV 파일을 설치하고 엽니다.
- All을 선택하고 내보낼 시간 범위를 선택합니다.
- 아카이브를 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
- Node.js 22 or newer
- An Apple Health CSV export created with Simple Health Export CSV
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
- Install and open Simple Health Export CSV on your iPhone.
- Select All and choose the time range to export.
- Transfer the archive to the computer running your MCP client.
- Unzip it and set
HEALTH_DATA_DIRto 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.
설치
npx -y @neiltron/apple-health-mcp설정
{
"mcpServers": {
"apple-health": {
"command": "npx",
"args": ["-y", "@neiltron/apple-health-mcp"],
"env": {
"HEALTH_DATA_DIR": "/path/to/your/unzipped/health-export"
}
}
}
}