
picooc-mcp-go
io.github.kondratjev/picooc-mcp-go
Read-only Picooc MCP server: 15 tools for weight, body composition, blood pressure and reports.
Documentation
⚖️ Picooc MCP Server (Go)
[!IMPORTANT] This is not an official Picooc server. It uses a private cloud API that can change without notice. It is read-only: no measurements, users, devices or blood-pressure records are created, changed or deleted.
An MCP server for Picooc scales and family roles: weight, body composition, body girth, blood pressure and the server's body report. Ask your AI assistant for history, trends, comparisons and family progress — over stdio or Streamable HTTP.
One static Go binary, no runtime. Config lives in ~/.picooc-mcp/config.json.
Built on the official modelcontextprotocol/go-sdk.
✨ Features
- ⚖️ Body composition — weight, BMI, fat, water, muscle, skeletal muscle, bone mass, visceral fat, subcutaneous fat, BMR, body age and impedance.
- 📏 Body girth — shoulders, bust, waist, hips, arms, thighs and calves.
- 🩺 Blood pressure — systolic, diastolic and pulse history.
- 🧠 Server body report — Picooc body type, score, BMI report, doctor comment and recommendations for a measurement.
- 👨👩👧 Family roles — one account can hold several roles; read the active role or pass another role id/name.
- 📈 Analytics — weekly trend, kg/week slope, goal-style weight change, date-to-date comparison and family overview.
- 🔐 Encryption at rest — optional AES-256-GCM for the saved password and session fields.
- 🌐 Two transports — stdio for desktop clients, stateless Streamable HTTP
with
X-MCP-Userfor self-hosting. - 🧯 Raw escape hatch — redacted roles, body and blood-pressure rows.
🏆 Why this server
- ✅ 15 read-only tools, including body girth and server body reports — not just a weight list.
- ✅ Handles multiple Picooc family roles behind one account.
- ✅ Works with the international, Russian and Chinese Picooc clouds.
- ✅ Single binary, no Node/Python runtime.
- ✅ Optional encryption for the password that Picooc requires for relogin.
- ✅ Docker image, GitHub releases and Official MCP Registry entry.
🌍 Regions
| Region | API host | Notes |
|---|---|---|
intl | api2.picooc-int.com | Default, international accounts |
ru | api2.picoocru.com | Russian accounts |
cn | api2.picooc.com | Chinese accounts |
Picooc has no public developer API and no refresh token. The client logs in again for each sync, so the password must be available to the process.
🚀 Quick Start
Build from source (Go 1.27+):
go build -o picooc-mcp ./cmd/picooc-mcp
Release binaries are on
Releases. Build from
source to include changes on main before the next tag.
Add to your MCP client:
{
"mcpServers": {
"picooc": {
"command": "/absolute/path/to/picooc-mcp",
"env": {
"PICOOC_EMAIL": "you@example.com",
"PICOOC_PASSWORD": "your-password",
"PICOOC_REGION": "intl"
}
}
}
}
On first use:
check_auth_status— shows credentials, region, active role and cache.setup_credentials— validates the login and saves the profile.- Call any read tool — the first read downloads the configured history window.
OpenCode
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"picooc": {
"type": "remote",
"url": "https://<DOMAIN>/<MCP_SECRET>/picooc/mcp",
"enabled": true
}
}
}
🐳 Docker
docker build -t picooc-mcp .
# stdio
docker run --rm -i \
-v picooc-config:/home/app/.picooc-mcp \
-e PICOOC_EMAIL=you@example.com \
-e PICOOC_PASSWORD=your-password \
-e PICOOC_REGION=intl \
picooc-mcp
# stateless HTTP
docker run -d --name picooc-mcp -p 8000:8000 \
-v picooc-config:/home/app/.picooc-mcp \
-e PORT=8000 \
-e PICOOC_EMAIL=you@example.com \
-e PICOOC_PASSWORD=your-password \
-e PICOOC_REGION=intl \
picooc-mcp
The named picooc-config volume keeps the non-root container's config across
rebuilds.
🌐 HTTP
Set PORT to serve stateless Streamable HTTP at /mcp with /healthz.
X-MCP-User selects a named profile; stdio uses default.
PORT=8000 PICOOC_EMAIL=... PICOOC_PASSWORD=... ./picooc-mcp
curl -s localhost:8000/healthz # {"status":"ok"}
Use a reverse proxy with TLS. Plain HTTP is only for a trusted network.
🌍 Self-Hosted Server
The shared edge repository mcp-edge terminates HTTPS and discovers this server's route from Compose labels. Set it up once:
git clone https://github.com/kondratjev/mcp-edge.git
cd mcp-edge
cp .env.example .env # set DOMAIN and MCP_SECRET
SYNC_ENV=1 VPS_SSH=user@host VPS_DIR=/opt/mcp-edge ./scripts/deploy.sh
Then deploy this server:
cp .env.example .env # Picooc credentials, region and optional key
SYNC_ENV=1 VPS_SSH=user@host VPS_DIR=/opt/picooc-mcp-go ./scripts/deploy.sh
The endpoint is https://<DOMAIN>/<MCP_SECRET>/picooc/mcp; health is
.../picooc/healthz. The picooc-config volume keeps credentials across
rebuilds. Remote MCP clients cannot send auth headers, so guard the secret URL
like a password.
🛠️ Tools
All tools are read-only except setup_credentials.
| Tool | Purpose |
|---|---|
| 🔐 Setup & roles | |
check_auth_status | Local credentials, active role, cache age |
setup_credentials | Validate login and save credentials |
list_users | Family roles/profiles |
| ⚖️ Measurements | |
get_latest_measurement | Latest body composition |
get_measurement_history | History by role and time |
| 📏 Girth & report | |
get_body_girth_history | Waist, chest, hip, arms, thighs, calves |
get_body_analysis | Server body report: type, score, BMI report, advice |
| 📈 Analytics | |
get_body_composition_summary | Latest, min/max/average, deltas |
get_trend | Weekly trend and kg/week slope |
compare_measurements | Two points in time with deltas |
get_family_overview | Per-role count and weight change |
| 🩺 Blood pressure | |
get_blood_pressure_history | Systolic, diastolic, pulse |
| 📤 Export & raw | |
get_raw_collection | Redacted raw roles/body/pressure rows |
refresh_sync | Bypass the snapshot cache |
export_data | CSV or JSON export |
Tool arguments accept RFC3339 timestamps or YYYY-MM-DD dates. Times are UTC.
Date-only comparison inputs mean end of day.
⚙️ Configuration
~/.picooc-mcp/config.json, directory 0700, file 0600. The password is
needed for relogin because Picooc has no refresh token. Set
PICOOC_CONFIG_KEY (or PICOOC_CONFIG_KEY_FILE) to encrypt it and the saved
role/session fields with AES-256-GCM; without a key the file stays plaintext.
Environment variables:
| Variable | Meaning | Default |
|---|---|---|
PICOOC_EMAIL | Initial email | empty |
PICOOC_PASSWORD | Initial password | empty |
PICOOC_REGION | intl, ru or cn | intl |
PICOOC_API_BASE | Override API host | region default |
PICOOC_HISTORY_DAYS | Sync window | 2200 |
PICOOC_CACHE_TTL | Snapshot cache TTL | 5m |
PICOOC_CONFIG | Alternate config path | ~/.picooc-mcp/config.json |
PICOOC_CONFIG_KEY | Encrypt saved secrets at rest | empty |
PICOOC_CONFIG_KEY_FILE | Read the key from a file | empty |
PORT | Serve HTTP instead of stdio | empty |
Snapshots are cached for five minutes; body-girth results for five minutes and
server body reports for 24 hours. refresh_sync clears the snapshot and girth
caches.
🔐 Security
- The config contains the account password unless a config key is set. Protect it like a password and keep the key outside the Docker volume.
- Responses are recursively redacted for
password,sign,push_token,token,access_token,refresh_token, cookies and authorization headers. - URLs and request bodies are never logged. HTTP requests use TLS.
- Use a dedicated Picooc account where possible.
- The server needs no inbound access beyond the optional
/mcpendpoint.
🧪 Development
go test ./...
go vet ./...
go build ./...
The Picooc 4.4.2 endpoint audit and the intentionally unimplemented read-only candidates are in docs/api-audit.md.
Live testing needs a Picooc account and region. The test suite must not require live credentials.
⚠️ Limitations
- Unofficial and read-only; diet, food, writes, BLE and device management are out of scope.
- Picooc's API has no refresh token; each sync logs in with the saved password.
- Server reports are generated by Picooc and may be absent for old records.
- Live Picooc behavior can change without notice. Tests use local fake servers; a live account is needed to validate a new protocol version.
📄 License
MIT — see LICENSE.
ghcr.io/kondratjev/picooc-mcp-go:0.2.0docker pull ghcr.io/kondratjev/picooc-mcp-go:0.2.0:undefinedRelated Servers
io.github.kondratjev/fatsecret-mcp-go
Full-coverage FatSecret MCP server: 56 tools for food, diary, weight and exercise.
io.github.kondratjev/fitdays-mcp-go
Read-only FitDays MCP server: 19 tools for weight, body composition, nutrition, water and trends.
io.github.kondratjev/zepp-mcp-go
Read-only Zepp MCP server: activity, sleep, HRV, readiness, stress, GPS and body composition.