diet-guard/diet_guard
Krzysztof kuhy Rudnicki 06999274d7
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
Tests / test (3.10) (push) Waiting to run
Tests / test (3.11) (push) Waiting to run
Tests / test (3.12) (push) Waiting to run
Add MCP server exposing diet status + a gated log_meal
Expose diet_guard's read surface and one gated write action as typed MCP
tools (diet_guard._mcp) so Claude Code and its subagents can query today's
intake and -- with explicit confirmation -- log a meal without shelling out
to the interactive gate CLI.

- _mcp.py: FastMCP stdio server. Read tools get_status, list_today,
  get_slots expose today's CONSUMED kcal/macros and the qualitative
  consumption band only -- never the raw daily budget, remaining number,
  body weight, or protein target (those would back out the deliberately
  hidden budget). Gated write log_meal previews unless confirm=True and
  degrades gracefully on write failure. Nutrition is grouped into a Macros
  model (kcal + optional protein/carbs/fat) to keep the tool under the
  arg-count limits with no lint suppression, mirroring the CLI's grouping.
  Logs to stderr; no secret (HMAC key / sync token) is ever returned.
- .mcp.json + scripts/setup_mcp.sh: registration via a dedicated
  ~/.venvs/diet-guard-mcp interpreter; mcp is an optional-dep, kept out of
  the systemd/CLI system-python path.
- 100% coverage of the new module; verified end-to-end over stdio.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQGQj8Ne6TriBExv91nG8v
2026-07-10 21:36:46 +02:00
..
tests Add MCP server exposing diet status + a gated log_meal 2026-07-10 21:36:46 +02:00
__init__.py feat(diet_guard): add meal-logging screen-lock gate with trigger fix 2026-06-10 22:32:39 +02:00
__main__.py Extract diet_guard from testsAndMisc as a standalone repo 2026-06-22 12:18:39 +02:00
_budget.py Extract diet_guard from testsAndMisc as a standalone repo 2026-06-22 12:18:39 +02:00
_cli_gate.py Add cross-device log sync (Python half of Milestone 3) 2026-06-22 19:36:27 +02:00
_cli_sync.py Add cross-device log sync (Python half of Milestone 3) 2026-06-22 19:36:27 +02:00
_cli.py Add cross-device log sync (Python half of Milestone 3) 2026-06-22 19:36:27 +02:00
_coerce.py Extract diet_guard from testsAndMisc as a standalone repo 2026-06-22 12:18:39 +02:00
_constants.py Point sync at the consolidated utils/syncs monorepos 2026-07-10 14:12:16 +02:00
_estimator.py Extract diet_guard from testsAndMisc as a standalone repo 2026-06-22 12:18:39 +02:00
_foodbank.py Add cross-device log sync (Python half of Milestone 3) 2026-06-22 19:36:27 +02:00
_fuzzy.py feat(diet_guard): add meal-logging screen-lock gate with trigger fix 2026-06-10 22:32:39 +02:00
_gate.py Extract diet_guard from testsAndMisc as a standalone repo 2026-06-22 12:18:39 +02:00
_gatelock_core.py Extract diet_guard from testsAndMisc as a standalone repo 2026-06-22 12:18:39 +02:00
_gatelock_mealflow.py Add sync-ready log schema: stable id, tombstone undo, composite components 2026-06-22 18:22:24 +02:00
_gatelock_nutrition.py Extract diet_guard from testsAndMisc as a standalone repo 2026-06-22 12:18:39 +02:00
_gatelock_support.py feat: split oversized modules for 500-line limit, fix kasa coverage gap 2026-06-14 07:19:37 +02:00
_gatelock_ui.py feat: split oversized modules for 500-line limit, fix kasa coverage gap 2026-06-14 07:19:37 +02:00
_gatelock.py Extract diet_guard from testsAndMisc as a standalone repo 2026-06-22 12:18:39 +02:00
_mcp.py Add MCP server exposing diet status + a gated log_meal 2026-07-10 21:36:46 +02:00
_meal.py Add sync-ready log schema: stable id, tombstone undo, composite components 2026-06-22 18:22:24 +02:00
_portions.py Extract diet_guard from testsAndMisc as a standalone repo 2026-06-22 12:18:39 +02:00
_resolve.py Extract diet_guard from testsAndMisc as a standalone repo 2026-06-22 12:18:39 +02:00
_slots.py Extract diet_guard from testsAndMisc as a standalone repo 2026-06-22 12:18:39 +02:00
_state.py Add cross-device log sync (Python half of Milestone 3) 2026-06-22 19:36:27 +02:00
_sync_github.py Add cross-device log sync (Python half of Milestone 3) 2026-06-22 19:36:27 +02:00
_sync_merge.py Add cross-device log sync (Python half of Milestone 3) 2026-06-22 19:36:27 +02:00
_sync.py Point sync at the consolidated utils/syncs monorepos 2026-07-10 14:12:16 +02:00