Skip to main content
Glama
ayeyouok

a207-meal-plan-mcp

by ayeyouok
README.md
# a207-meal-plan-mcp(M7 · 食谱生成)

儿童 CKD **食谱生成 MCP**(营养师可调)。按 M3 的 PRNT 目标(能量/蛋白/钾/磷/钠)生成多日食谱(3 餐 + 加餐),并给出每项目标的达成率。纯计算、无跨包依赖。

## 工具清单

| 工具 | 读写 | 调用方 | 说明 |
|------|------|--------|------|
| `generate_meal_plan` | 读 | 营养师 | 按 PRNT 目标生成多日食谱 + 达成率 |
| `get_meal_plan_nutrients` | 读 | 营养师 | 从已生成 plan 重新汇总平均每日营养素(校验) |

## 输入来源

- 目标值(能量/蛋白/钾/磷/钠)来自 **M3 `calc_prnt_targets`**。
- 食物数据:本包内置 `data/foods_ckd.json`(CKD 适宜食物子集,约 40 项)。

> **集成说明(重要)**:为满足「零跨包 import」工程纪律,M7 **不调用 M5**。生产环境应将内置子集替换为调用 **M5 `lookup_food_nutrients`**(1752 食物库)实时取数,使食谱养分与 M5 单一事实源一致。本内置子集数值为常见食物成分近似值,仅供离线演示。

## 回写约定

生成的食谱条目养分须经 **M5** 计算后,通过 **M3 `upsert_food_diary`** 回写 `diet_diary_3d`,才能被 M3 `assess_intake_vs_target` 校验(D 约定见 docs/05)。

## 运行与部署

与其他 4 个 MCP 一致,发 PyPI 后裸 `uvx` 可用:

```bash
python -m build
python -m twine check dist/*
python -m twine upload dist/*     # 用同一个 NFYY 凭据
uvx --refresh a207-meal-plan-mcp
```

## 测试

```bash
python tests/test_tools.py
```

## 已知缺口(非阻断)

- 生成策略为确定性启发式(主食供 50% 能量、蛋白源供 70% 蛋白、蔬果固定 100g、油脂补能),非多目标优化求解;多样化仅通过每日轮换食物实现。
- 未做「食物相克 / 口味偏好 / 烹饪方式」约束,后续可由营养师 Skill 叠加。
- 未内嵌 M5 全量食物库(见上方集成说明)。

TDQS

A3.8/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: one generates a new meal plan, the other aggregates nutrient data from an existing plan. There is no overlap or ambiguity between them.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern: 'generate_meal_plan' and 'get_meal_plan_nutrients'. The naming style is uniform and predictable.

Tool Count3/5

With only 2 tools, the server feels minimal. While the narrow scope is defensible, it sits at the borderline where 1-2 tools are typically considered thin for a functional domain.

Completeness3/5

The tool surface covers generation and nutrient validation, but lacks update/delete/list operations for meal plans. There are notable gaps in lifecycle management, though the core generation workflow is present.

Maintenance

ActivityMaintained
ResponsivenessSyncing