
cabird/loseit-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Unofficial MCP server and CLI for logging food to Lose It!
Обзор
An MCP server and CLI for logging food to Lose It!. ⚠️ Lose It! publishes no public API. This talks to the private GWT-RPC endpoint used by the Lose It! web app, so it can break whenever they ship a new web build. log_custom_food exists because updateFoodLogEntry carries the food's name, brand, and nutrient map inline — so an entry can describe a food the database has never heard of. Use it for restaurant meals, homemade dishes, or any portion where forcing a database match would distort the numbers. .env is gitignored. The session token is cached at ~/.config/loseit-mcp/session.json with owner-only permissions and refreshes automatically when it expires. Register the stdio server with an MCP client: To host one server for multiple accounts, see DEPLOYMENT.md. The same operations are available directly, which is the easiest way to test: Add --dry-run to either log command to preview the math without writing, and --json for machine-readable output.
README
Показан фрагмент оригинального README. Открыть оригинал.
loseit-mcp
An MCP server and CLI for logging food to Lose It!.
⚠️ Unofficial. Lose It! publishes no public API. This talks to the private GWT-RPC endpoint used by the Lose It! web app, so it can break whenever they ship a new web build.
Tools
| Tool | Description |
|---|---|
search_food |
Search the food database; returns food_ids |
describe_food |
Full nutrition and serving detail for one food |
get_diary |
A day’s entries with calories and macros, plus totals |
log_food |
Log a database food to a meal |
log_custom_food |
Log arbitrary calories/macros with no database match |
log_weight |
Record a weigh-in |
get_weight_history |
Read weigh-ins over a range, with min/max/change |
delete_entry |
Delete a diary entry |
whoami |
Show the authenticated account |
log_custom_food exists because updateFoodLogEntry carries the food’s name,
brand, and nutrient map inline — so an entry can describe a food the database
has never heard of. Use it for restaurant meals, homemade dishes, or any
portion where forcing a database match would distort the numbers.
Setup
uv sync
cp .env.example .env # then fill in your credentials
Configuration
Settings resolve in priority order: CLI flags → environment → .env → JSON
config file → defaults.
| Variable | Required | Description |
|---|---|---|
LOSEIT_EMAIL |
yes* | Lose It! account email |
LOSEIT_PASSWORD |
yes* | Lose It! account password |
LOSEIT_TOKEN |
no | A liauth JWT, used instead of email/password |
LOSEIT_HOURS_FROM_GMT |
no | UTC offset in whole hours; auto-detected |
LOSEIT_STRONG_NAME |
no | GWT permutation, if Lose It ships a new build |
LOSEIT_POLICY_HASH |
no | GWT policy hash, if Lose It ships a new build |
* Not required if LOSEIT_TOKEN is set.
.env is gitignored. The session token is cached at
~/.config/loseit-mcp/session.json with owner-only permissions and refreshes
automatically when it expires.
Running the server
loseit-mcp serve # stdio (default)
loseit-mcp serve --transport streamable-http --port 8000
Register the stdio server with an MCP client:
{
"mcpServers": {
"loseit": {
"command": "uv",
"args": ["run", "loseit-mcp", "serve"],
"cwd": "/absolute/path/to/loseit-mcp"
}
}
}
To host one server for multiple accounts, see DEPLOYMENT.md.
CLI
The same operations are available directly, which is the easiest way to test:
loseit-mcp search "greek yogurt" -n 5
loseit-mcp describe
loseit-mcp diary 2026-07-25
loseit-mcp log -m lunch -a 120 -u g
loseit-mcp log-custom "Caesar Salad" 620 -m lunch -b "Gastrohub" -p 46 -c 18 -f 40
loseit-mcp weigh 199.2
loseit-mcp weights -n 14
loseit-mcp delete -d 2026-07-25
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →Конфигурация
{
"mcpServers": {
"loseit": {
"command": "uv",
"args": ["run", "loseit-mcp", "serve"],
"cwd": "/absolute/path/to/loseit-mcp"
}
}
}