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)

Go 1.27 MCP 2025-06-18 MIT Tools

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 serverCommon community servers
Tools313–10
Authapptoken only; no password or 2FAemail/password or browser login
Runtimesingle Go binaryPython, Node or Cloudflare Worker
Remote usestdio + stateless HTTP, profiles via X-MCP-Userusually stdio only
Analyticsweekly trends, period comparisonraw data only
ExportCSV, JSON and GPXvaries, 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

  1. Open https://user.huami.com/privacy2/index.html and sign in.
  2. Open DevTools β†’ Application β†’ Cookies.
  3. Copy the apptoken cookie 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

ToolPurpose
check_auth_statusReport the saved profile, region, token presence and cache state without network access.
setup_credentialsSave and validate an apptoken, optional user id and region.
get_profileReturn user id, region, timezone and available data counts.

Health data

ToolPurpose
get_daily_summaryDaily steps, distance and active calories, newest first.
get_sleepSleep sessions with stages, duration, score and resting heart rate.
get_heart_rateResting and minute-level passive heart rate.
list_workoutsWorkout history with type, duration, distance, calories and heart rate.
get_workout_detailRaw detail for one workout track id.
list_devicesBound devices with model, firmware and serial; device auth keys are never returned.
get_workout_trackDecoded GPS, altitude, heart rate, cadence and power points for a workout.
export_workout_gpxExport one workout with a GPS track as GPX 1.1 text.
get_stressDaily stress with zone percentages and 5-minute HRV readings.
get_training_loadExercise score, recovery and ATL/CTL/TSB training load.
get_sport_loadDaily and weekly training load with the optimal range.
get_vo2_maxVO2 max estimates from qualifying outdoor workouts.
get_readinessReadiness score with HRV, resting-HR, skin-temperature, breathing, physical and mental components.
get_hrvDaily RMSSD/SDNN ranges; SDNN unit is marked unverified.
get_respiratory_rateDaily respiratory rate from overnight per-minute samples.
get_body_chargeBody Charge min/max/average with mental and physical components.
get_sleep_breathingOvernight ODI, desaturation events, measured minutes and sleep-breathing score.
get_daily_healthSteps, active calories, active minutes and distances with Zepp goals and goal-met flags.
get_spo2Manual SpO2 and oxygen-desaturation events from the blood-oxygen stream.
get_paiDaily PAI, rolling total, zone scores/minutes and heart rates.
get_skin_temperatureOvernight skin-temperature deviation from the personal baseline.
get_health_eventsGeneric event stream for respiratory rate, HRV, body battery and similar data.
get_body_measurementsWeight and body-composition records.

Analytics and export

ToolPurpose
get_trendWeekly trend and slope for steps, distance, calories, sleep, resting heart rate, weight or body composition.
compare_periodsCompare average daily metrics between two date ranges.
refresh_syncBypass the five-minute cache and download a fresh snapshot.
get_raw_collectionRedacted raw payloads for band, heart_rate, workouts or body.
export_dataExport 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:

VariableDefaultPurpose
ZEPP_APPTOKENβ€”Apptoken for the default profile.
ZEPP_USER_IDautoUser id; normally discovered from recent band data.
ZEPP_REGIONglobalglobal, eu or us.
ZEPP_HISTORY_DAYS2200History window. Requests are batched in 30-day chunks.
ZEPP_TIMEZONELocalIANA timezone for date boundaries.
ZEPP_API_BASEregion defaultOverride the activity API (proxy or tests).
ZEPP_WEIGHT_APIhttps://api-mifit.zepp.comOverride the weight API.
ZEPP_CACHE_TTL5mSnapshot cache duration.
ZEPP_CONFIG~/.zepp-mcp/config.jsonConfig 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, default is 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_collection and all tool responses recursively redact apptoken, token, password, cookie and authorization.
  • Config saves are atomic; 0600 file in a 0700 directory.
  • Optional AES-256-GCM at rest. A stolen config without the key does not expose the token.
  • Only setup_credentials changes 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 apptoken authentication; 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.