Picooc MCP Server
by kondratjev
README.md
# Picooc MCP Server (Go)
[](https://go.dev)
[](https://modelcontextprotocol.io)
[](LICENSE)
[](README.md#tools)
Read-only MCP server for the unofficial Picooc cloud API: weight, body
composition, body girth, blood pressure and server body reports across family
roles.
This is not an official Picooc server. The private API can change at any time.
The server never writes measurements, users or devices.
## Install
```bash
go install github.com/kondratjev/picooc-mcp-go/cmd/picooc-mcp@latest
```
Or build locally:
```bash
go build -o picooc-mcp ./cmd/picooc-mcp
```
## Run
Stdio:
```bash
PICOOC_EMAIL=you@example.com PICOOC_PASSWORD=... PICOOC_REGION=intl ./picooc-mcp
```
HTTP:
```bash
PORT=8000 PICOOC_EMAIL=... PICOOC_PASSWORD=... ./picooc-mcp
# Streamable HTTP: http://localhost:8000/mcp
# Health: http://localhost:8000/healthz
```
`X-MCP-User` selects a named profile; stdio uses `default`.
## Docker
```bash
docker build -t picooc-mcp .
docker run --rm -i \
-v picooc-config:/home/app/.picooc-mcp \
-e PICOOC_EMAIL=you@example.com -e PICOOC_PASSWORD=... -e PICOOC_REGION=intl \
picooc-mcp
```
HTTP mode maps port 8000:
```bash
docker run -d --name picooc-mcp -p 8000:8000 \
-v picooc-config:/home/app/.picooc-mcp \
-e PORT=8000 -e PICOOC_EMAIL=... -e PICOOC_PASSWORD=... -e PICOOC_REGION=intl \
picooc-mcp
```
## Self-hosted server
The shared edge repository
[mcp-edge](https://github.com/kondratjev/mcp-edge) terminates HTTPS and
discovers this server's route from the Compose labels. Set it up once:
```bash
git clone https://github.com/kondratjev/mcp-edge.git
cd mcp-edge
cp .env.example .env # DOMAIN and MCP_SECRET
SYNC_ENV=1 VPS_SSH=user@host VPS_DIR=/opt/mcp-edge ./scripts/deploy.sh
```
Then deploy this server:
```bash
cp .env.example .env # Picooc credentials and region
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 named `picooc-config` volume keeps credentials across
rebuilds.
## Configuration
`~/.picooc-mcp/config.json`, directory `0700`, file `0600`. The password is
stored there in plaintext because Picooc has no token and a relogin needs it.
Environment:
| 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` |
| `PORT` | Serve HTTP instead of stdio | empty |
## Tools
All tools are read-only except `setup_credentials`.
| Tool | Purpose |
| --- | --- |
| `check_auth_status` | Local credentials, active role, cache age |
| `setup_credentials` | Validate login and save credentials |
| `list_users` | Family roles/profiles |
| `get_latest_measurement` | Latest body composition |
| `get_measurement_history` | History by role and time |
| `get_body_girth_history` | Waist, chest, hip, arms, thighs, calves |
| `get_body_analysis` | Server body report: type, score, BMI report, advice |
| `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 |
| `get_blood_pressure_history` | Systolic, diastolic, pulse |
| `get_raw_collection` | Redacted raw roles/body/pressure rows |
| `refresh_sync` | Bypass the snapshot cache |
| `export_data` | CSV or JSON export |
## Security
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.
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.
## Development
```bash
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](docs/api-audit.md).
Live testing needs a Picooc account and region. The test suite must not require
live credentials.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues