Requirements
- Node.js 20 or newer
- A WeightWatchers account that signs in with e-mail and password
- Region
de(weightwatchers.de) is the tested one; see Region
Sign in
npx --package unofficial-weightwatchers-mcp ww login --email you@example.comFrom a checkout: node bin/ww.js login --email you@example.com.
The password is asked without echo and sent only to auth.weightwatchers.<region>. It is not
stored unless you ask for it (below). The command stores the session, a token and not the password, in
~/.weightwatchers/auth.json (mode 600).
Other ways to sign in:
| How | When |
|---|---|
ww login --browser | No terminal prompt wanted: a local page on 127.0.0.1 opens in your browser |
ww login --password-stdin | Scripts: printf '%s' "$PW" | ww login --email ... --password-stdin |
The ww_login tool | From an AI client; opens the same local page, the password never passes through the chat |
WW_PASSWORD in the environment | Used by ww login instead of the prompt, and for unattended renewal |
Staying signed in
The WW session lasts a few hours. When it expires, the client signs in again by itself if it can find your password, in this order:
WW_EMAILandWW_PASSWORDin the environment (for servers; the e-mail may also come from the stored sign-in)- the system credential store, if you signed in with
--save-passwordor ticked the box on the login page
| OS | Store | Needs |
|---|---|---|
| macOS | Keychain | the security tool (built in) |
| Linux | libsecret | secret-tool (package libsecret-tools) and a running keyring |
| Windows | Credential Manager | Windows PowerShell 5.1 (least tested) |
If neither exists, the next call after expiry fails with a clear message and you sign in again.
Region
WW_REGION or --region sets the domain suffix of your WW site: de (default), com, co.uk, ...
Only de is tested. Other regions are experimental: they use the same endpoints, but nobody has
confirmed they behave the same. The region you sign in with is stored and reused.
First commands
ww status # who is signed in, when the token expires
ww day # points used and left today
ww tracked # what you tracked today
ww search "basmati rice" # food searchWriting data
ww_track and ww_untrack add and remove real diary entries, and the recipe, food, meal, water and
activity tools change real account data. Let your client ask before running them. To try them safely, track a quick entry with 0 points on a day you do not care about and remove
it again.
Any MCP client
The MCP server speaks stdio. Every client needs the same things: a command, its arguments, and
optionally environment variables. The server reads the session that ww login stored, so sign in
first (Getting started), or give WW_EMAIL and WW_PASSWORD in env.
| Variant | command | args |
|---|---|---|
| npx (after the npm release) | npx | ["-y", "unofficial-weightwatchers-mcp"] |
| Node and a checkout | node | ["/absolute/path/to/unofficial-weightwatchers-mcp/src/index.js"] |
Use an absolute path for the checkout: clients usually start servers with a different working
directory than your shell. If node is not found (common with version managers such as nvm), use
the absolute path of the node binary (which node, or where node on Windows).
The variables in Configuration can go into the client's env block; none are
required. After changing a client configuration, restart the client. The server logs to stderr only;
stdout carries the protocol.
Generic stdio
Run this command and speak MCP over its standard input and output:
npx -y unofficial-weightwatchers-mcpThe server name in the handshake is unofficial-weightwatchers-mcp. It supports the tools
capability only. To inspect it by hand:
npx @modelcontextprotocol/inspector npx -y unofficial-weightwatchers-mcpSigning in from the chat
The ww_login tool takes no password. It opens a local page where you type it in the browser, so the
password does not pass through the AI client. ww_status shows the state without revealing any secret.
Environment variables
| Variable | Default | Purpose |
|---|---|---|
WW_REGION | de (or the region of the stored sign-in) | Domain suffix of the WW site. Allowed: de, com, co.uk, fr, nl, be, ch, com.au, ca (a fixed list of WW-owned domains, so credentials can never go to a look-alike domain). de is tested, the others are experimental. |
WW_EMAIL | none | Account e-mail for unattended sign-in. Needs WW_PASSWORD. |
WW_PASSWORD | none | Account password for unattended re-login on servers. Never written to disk. Takes precedence over the credential store. |
WW_ALLOW_RAW_WRITES | unset | Set to 1 to let ww_api_call send POST, PUT and DELETE. Without it the tool only does GET. |
WW_API_KEY | generated | API key of ww serve (at least 16 characters); overrides $WW_HOME/api-key. See HTTP API. |
WW_HOME | ~/.weightwatchers | Config directory (auth.json, api-key). |
Order for the region: --region / constructor option, then WW_REGION, then the stored sign-in, then de.
Files
$WW_HOME/auth.json, mode 600, directory mode 700, written atomically:
| Field | Meaning |
|---|---|
region | Region of the sign-in (older files call this tld, still understood) |
email | Account e-mail |
tokenId | WW session; renews the JWT; lasts a few hours |
jwt, jwtExpiresAt | Current access token and its expiry |
memberId | Member ID from the token |
savedAt | When the file was written |
There is no password field. A password field in a file from an older version is ignored, moved
to the credential store when possible, and dropped the next time the file is written.
Delete the file or run ww logout to sign out. ww logout --keychain also removes the stored password.
Password handling
| Source | How it gets there | Used when |
|---|---|---|
| Environment | WW_EMAIL and WW_PASSWORD set by you | first choice for re-login; also signs in when no session is stored |
| Credential store | ww login --save-password, or the checkbox on the ww_login page | second choice for re-login |
ww status and ww_status show which source would be used (env, keychain, or null) without reading the password.
Docker
docker build -t unofficial-weightwatchers-mcp .
docker run -i --rm -v ww-data:/data \
-e WW_EMAIL -e WW_PASSWORD -e WW_REGION unofficial-weightwatchers-mcpThe image runs the stdio server as an unprivileged user and keeps its session in /data. Pass the
password through your orchestrator's secret mechanism, not in an image or a compose file in a repository.