Zepp MCP Server
Read-only Zepp MCP server in Go: activity, sleep, HRV, readiness, stress, workouts, GPS and body composition.
Documentation
β Zepp MCP Server (Go)
Read-only MCP server for the unofficial Zepp cloud. It reads daily activity, sleep,
heart rate, workouts and body composition from an existing apptoken.
31 tools, one Go binary, config in ~/.zepp-mcp/config.json. Built on the official
modelcontextprotocol/go-sdk.
[!IMPORTANT] This is an unofficial client. Zepp can change or block the private API at any time. The apptoken grants access to your account: keep it private. The server never writes to Zepp and never asks for your password.
β¨ Features
- Steps, distance and active calories with daily and weekly aggregates.
- Sleep stages, duration, score and resting heart rate.
- Minute-level passive heart rate for the last seven days.
- Workout history and raw workout details (GPS, heart-rate and pace series when present), plus aerobic/anaerobic training effect, exercise load, RPE, VO2 max and SpO2 range.
- Readiness, HRV, respiratory rate, Body Charge and sleep-breathing (ODI) recovery metrics.
- Weight, BMI, body fat, muscle, water, bone mass, visceral fat and metabolic age.
- Weekly trends and period comparison across eleven metrics.
- Multiple config profiles over one HTTP endpoint via
X-MCP-User. - CSV or JSON export.
- stdio and stateless Streamable HTTP.
- Optional AES-256-GCM encryption for the saved apptoken.
- Failed upstream calls do not leak the apptoken or request URL.
π Why this server
Comparison with typical community Zepp MCP servers, as of November 2026.
| This server | Common community servers | |
|---|---|---|
| Tools | 31 | 3β10 |
| Auth | apptoken only; no password or 2FA | email/password or browser login |
| Runtime | single Go binary | Python, Node or Cloudflare Worker |
| Remote use | stdio + stateless HTTP, profiles via X-MCP-User | usually stdio only |
| Analytics | weekly trends, period comparison | raw data only |
| Export | CSV, JSON and GPX | varies, often JSON only |
Beyond workouts and weight, it exposes recovery and training metrics that most community servers skip: readiness, HRV, respiratory rate, Body Charge, sleep-breathing ODI, stress, training load, sport load, VO2 max, SpO2 and PAI.
π Quick Start
1. Get the apptoken
- Open https://user.huami.com/privacy2/index.html and sign in.
- Open DevTools β Application β Cookies.
- Copy the
apptokencookie value.
The apptoken usually lasts several weeks. When it expires, copy a fresh one and call
setup_credentials again.
2. Run
Grab a binary from Releases, or run the published image:
docker run -i --rm \
-e ZEPP_APPTOKEN=your-apptoken \
ghcr.io/kondratjev/zepp-mcp-go:latest
Build from source:
go build -o zepp-mcp ./cmd/zepp-mcp
3. Configure your client
{
"mcpServers": {
"zepp": {
"command": "/absolute/path/to/zepp-mcp",
"env": {
"ZEPP_APPTOKEN": "your-apptoken"
}
}
}
}
The first tool call syncs the configured history window. Call setup_credentials
when you prefer to save the token through MCP instead of the environment.
π§° Tools
Setup and account
| Tool | Purpose |
|---|---|
check_auth_status | Report the saved profile, region, token presence and cache state without network access. |
setup_credentials | Save and validate an apptoken, optional user id and region. |
get_profile | Return user id, region, timezone and available data counts. |
Health data
| Tool | Purpose |
|---|---|
get_daily_summary | Daily steps, distance and active calories, newest first. |
get_sleep | Sleep sessions with stages, duration, score and resting heart rate. |
get_heart_rate | Resting and minute-level passive heart rate. |
list_workouts | Workout history with type, duration, distance, calories and heart rate. |
get_workout_detail | Raw detail for one workout track id. |
list_devices | Bound devices with model, firmware and serial; device auth keys are never returned. |
get_workout_track | Decoded GPS, altitude, heart rate, cadence and power points for a workout. |
export_workout_gpx | Export one workout with a GPS track as GPX 1.1 text. |
get_stress | Daily stress with zone percentages and 5-minute HRV readings. |
get_training_load | Exercise score, recovery and ATL/CTL/TSB training load. |
get_sport_load | Daily and weekly training load with the optimal range. |
get_vo2_max | VO2 max estimates from qualifying outdoor workouts. |
get_readiness | Readiness score with HRV, resting-HR, skin-temperature, breathing, physical and mental components. |
get_hrv | Daily RMSSD/SDNN ranges; SDNN unit is marked unverified. |
get_respiratory_rate | Daily respiratory rate from overnight per-minute samples. |
get_body_charge | Body Charge min/max/average with mental and physical components. |
get_sleep_breathing | Overnight ODI, desaturation events, measured minutes and sleep-breathing score. |
get_daily_health | Steps, active calories, active minutes and distances with Zepp goals and goal-met flags. |
get_spo2 | Manual SpO2 and oxygen-desaturation events from the blood-oxygen stream. |
get_pai | Daily PAI, rolling total, zone scores/minutes and heart rates. |
get_skin_temperature | Overnight skin-temperature deviation from the personal baseline. |
get_health_events | Generic event stream for respiratory rate, HRV, body battery and similar data. |
get_body_measurements | Weight and body-composition records. |
Analytics and export
| Tool | Purpose |
|---|---|
get_trend | Weekly trend and slope for steps, distance, calories, sleep, resting heart rate, weight or body composition. |
compare_periods | Compare average daily metrics between two date ranges. |
refresh_sync | Bypass the five-minute cache and download a fresh snapshot. |
get_raw_collection | Redacted raw payloads for band, heart_rate, workouts or body. |
export_data | Export daily, sleep, heart-rate, workout or body rows as CSV or JSON. |
Every tool except setup_credentials is read-only.
βοΈ Configuration
Default path: ~/.zepp-mcp/config.json (mode 0600). Override with ZEPP_CONFIG.
Unknown top-level keys survive rewrites. Saves are atomic.
{
"region": "global",
"historyDays": 2200,
"profiles": {
"default": {
"appToken": "enc:v1:...",
"userId": "123456",
"region": "global",
"timezone": "Local"
}
}
}
Environment:
| Variable | Default | Purpose |
|---|---|---|
ZEPP_APPTOKEN | β | Apptoken for the default profile. |
ZEPP_USER_ID | auto | User id; normally discovered from recent band data. |
ZEPP_REGION | global | global, eu or us. |
ZEPP_HISTORY_DAYS | 2200 | History window. Requests are batched in 30-day chunks. |
ZEPP_TIMEZONE | Local | IANA timezone for date boundaries. |
ZEPP_API_BASE | region default | Override the activity API (proxy or tests). |
ZEPP_WEIGHT_API | https://api-mifit.zepp.com | Override the weight API. |
ZEPP_CACHE_TTL | 5m | Snapshot cache duration. |
ZEPP_CONFIG | ~/.zepp-mcp/config.json | Config path. |
ZEPP_CONFIG_KEY | β | AES-256-GCM key for saved secrets. |
ZEPP_CONFIG_KEY_FILE | β | File containing the key. |
PORT | β | Enables stateless HTTP on :PORT; absent means stdio. |
Encryption is optional. Generate a key with openssl rand -hex 32; if it is lost,
run setup_credentials again.
π Remote MCP over HTTP
PORT=8000 ZEPP_CONFIG_KEY=... ./zepp-mcp
POST /mcpβ stateless Streamable HTTP.GET /healthzβ{"status":"ok"}.X-MCP-User: <name>selects a named config profile; without it,defaultis used.
Run behind a TLS reverse proxy. The secret path and apptoken are both credentials.
π³ Docker
docker build -t zepp-mcp .
docker run --rm -i \
-e ZEPP_APPTOKEN=your-apptoken \
-v zepp-config:/home/app/.zepp-mcp \
zepp-mcp
HTTP mode:
docker run --rm -p 8000:8000 \
-e PORT=8000 \
-e ZEPP_APPTOKEN=your-apptoken \
-v zepp-config:/home/app/.zepp-mcp \
zepp-mcp
The image runs as UID 10001 and defaults to stdio.
βοΈ Self-hosted server
The repository includes docker-compose.yml and scripts/deploy.sh for a shared
mcp-edge Caddy proxy:
SYNC_ENV=1 VPS_SSH=user@host VPS_DIR=/root/zepp-mcp-go ./scripts/deploy.sh
The server then listens at:
https://<DOMAIN>/<MCP_SECRET>/zepp/mcp
DOMAIN and MCP_SECRET live in the edge .env, not in this repository. The
container joins the external mcp-edge network and publishes no host ports.
π Security
- Apptoken and request URLs are never logged.
get_raw_collectionand all tool responses recursively redactapptoken,token,password,cookieandauthorization.- Config saves are atomic;
0600file in a0700directory. - Optional AES-256-GCM at rest. A stolen config without the key does not expose the token.
- Only
setup_credentialschanges local state; no tool writes to Zepp.
π οΈ Development
gofmt -l .
go vet ./...
go test -race ./...
go build ./...
The test suite uses fake Zepp servers and requires no account.
β οΈ Limitations
- Unofficial private API; no public developer contract.
- Only
apptokenauthentication; no email/password or 2FA flow. - Minute heart rate is limited to the last seven days.
- Raw workout detail shape depends on the sport and Zepp response.
- No BLE, no writes, no device management.
π License
MIT β see LICENSE.