a207-nutrition-calc-mcp
This server provides specialized nutrition and food calculation tools for managing pediatric Chronic Kidney Disease (CKD). Capabilities include:
Food Nutrient Lookup: Query energy, protein, potassium, phosphorus, sodium per 100g and portion, with cooking adjustments and alerts for high levels.
Food Substitution: Recommend alternative foods from same category with constraints (e.g., low potassium, low phosphorus).
Household Measure Conversion: Convert between grams and household measures (bowl, palm, spoon) with nutrient content.
Dietary Intake Summary: Aggregate multi-day intake, compare against targets, and provide achievement rates and recommendations.
Phosphorus-to-Protein Ratio: Calculate mg phosphorus per gram protein to select low-phosphorus protein sources.
Peritoneal Dialysis Glucose Absorption: Estimate glucose absorbed from PD and its caloric contribution.
Drug-Nutrient Interaction Check: Alert on interactions between CKD medications (binders, vitamin D, diuretics, steroids, iron) and nutrients.
Nutrition Target Calculation (where available): Compute daily energy and protein targets for children with CKD according to PRNT 2020, adjusting for dialysis and edema.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@a207-nutrition-calc-mcp Calculate daily energy and protein targets for a 4-year-old CKD patient, 16 kg."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
a207-nutrition-calc-mcp
儿童慢性肾脏病(CKD)营养与食物计算 MCP 包,供 CKDNutri 项目的医生、营养师、家长三类智能体共用(M5 营养/食物计算器)。
依据:PRNT 2020(儿童 CKD 能量与蛋白 SDI)、Schofield 方程、腹膜透析葡萄糖吸收折算。
注意:本包不提供目标计算(原
calc_nutrition_target已去重,目标计算统一由 M3calc_prnt_targets作为唯一权威引擎)。本包定位为纯食物层(查养分/份量换算/替换/磷蛋白比/腹透葡萄糖/药食交互)。
单位口径
能量:kcal;蛋白/钾/磷/钠:g 或 mg(食物成分表以 mg/100g 计);血电解质:mmol/L
体重:kg;身高:cm;年龄:岁(内部按月龄插值)
Related MCP server: usda-fdc-mcp
七个工具
工具 | 说明 |
| 食物营养素查询,支持份量(碗/个/掌心/克)与烹饪降钾降磷处理,返回高钾/高磷/高钠警示 |
| 食物替换:低钾 / 低磷 / 低钠 / 低蛋白 / 等能量,优先同类食物候选 |
| 克 ↔ 家庭量具双向换算,附家长可感知锚点(鸡蛋/掌心瘦肉/牛奶/瓷勺油/碗饭) |
| 多日饮食汇总,对比目标给出能量/蛋白达成率与钾磷钠来源排序及建议 |
| 磷蛋白比(mg P/g 蛋白)计算,辅助低磷食物优选 |
| 腹膜透析葡萄糖吸收量(按留腹时长 × 转运特性),折算 kcal |
| 药物-营养素交互提示(磷结合剂、活性维 D、利尿剂、激素、铁剂等) |
目录结构
a207-nutrition-calc-mcp/
├── pyproject.toml
├── README.md
├── src/a207_nutrition_calc_mcp/
│ ├── __init__.py
│ ├── core.py # 7 工具门面(纯逻辑,无 MCP/pydantic 依赖)
│ ├── server.py # FastMCP >=2 服务定义(8 个 @mcp.tool)
│ ├── models.py # pydantic v2 入参模型(extra=forbid)
│ ├── constants.py # 参考表与阈值
│ ├── targets.py # 腹透葡萄糖吸收折算(目标计算已收归 M3)
│ ├── fooddb.py # 食物数据访问与分级
│ ├── measures.py # 家庭量具解析
│ ├── foods.py # 查询/替换/换算/磷蛋白比
│ ├── diary.py # 饮食汇总
│ ├── pharma.py # 药物-营养素交互
│ └── data/food_data.csv
└── tests/test_tools.py设计约束
不依赖、不 import 任何其它
a207-*包(纯计算,无写权限)结果可解释:返回 guideline 引用与规则依据
仅正向/边界/超时分支齐全,错误以
{"ok": false, "error": ...}形式返回
运行与测试
# 编译(server.py/models.py 依赖 fastmcp/pydantic,仅做语法校验)
python -m py_compile src/a207_nutrition_calc_mcp/*.py
# 纯标准库自测(core 逻辑不依赖 fastmcp/pydantic,可独立运行)
python tests/test_tools.py返回非零退出码表示存在失败用例。
启动 MCP 服务
pip install -e .
python -m a207_nutrition_calc_mcp.server
# 或
fastmcp dev src/a207_nutrition_calc_mcp/server.py
# 或(已注册 console script 后)
uvx --from . a207-nutrition-calc-mcpAvailable Tools
8 toolscalc_nutrition_targetA
按 PRNT 2020 计算儿童 CKD 每日能量与蛋白质目标(含透析加成与水肿体重校正)。
Inputs: age (required), ckd_stage (required), height_cm (required), weight_kg (required), +5 more. Returns: object
calc_pd_glucose_absorptionB
估算腹透葡萄糖倒灌吸收量与额外能量,该能量需从膳食能量目标中扣减。
Inputs: dwell_hours (required), dialysate_glucose_g (required), weight_kg, transport_type, +1 more. Returns: object
calc_pnprB
计算磷蛋白比(mg 磷 / g 蛋白),用于限磷时挑选蛋白来源。
Inputs: food, grams, protein_g, phosphorus_mg. Returns: object
check_drug_nutrient_interactionB
查询药物与营养素的交互提示(磷结合剂、钾结合剂、活性维D、激素等)。
Inputs: drug (required), nutrient. Returns: object
convert_to_household_measureB
克重换算为家庭量具(半碗/掌心/一勺),并附该份量的营养素。
Inputs: food (required), grams (required). Returns: object
lookup_food_nutrientsA
查询食物每 100 g 与指定份量的能量/蛋白/钾/磷/钠,并给出高钾高磷警示。
Inputs: food (required), cooking, portion. Returns: object
substitute_foodA
按低钾/低磷/低钠/低蛋白/等能量约束,在同类食物中推荐替换方案。
Inputs: food (required), top_n, constraint. Returns: object
sum_diet_intakeA
汇总多日饮食日记的能量/蛋白/钾/磷/钠,并对照目标给出达成率与行动建议。
Inputs: diary (required), target. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool serves a distinct purpose: target calculation, food lookup, substitution, measure conversion, intake summation, phosphorus ratio, dialysis glucose absorption, and drug interaction checking. There is no overlap or ambiguity between tool functions.
All tool names follow a consistent snake_case verb_noun pattern (e.g., calc_nutrition_target, lookup_food_nutrients, substitute_food). The verbs are descriptive and uniform, making the toolset predictable and easy to navigate.
With 8 tools, the server is well-scoped for its domain of pediatric CKD nutrition. Each tool adds meaningful functionality without redundancy, covering the essential calculators and data lookups needed for clinical and dietary management.
The toolset covers the full workflow: setting nutrition targets, looking up and substituting foods, converting measurements, summing intake against targets, and addressing special considerations like PD glucose absorption and drug interactions. No obvious gaps exist for the stated purpose.
Maintenance
Related MCP Connectors
MCP tools for Malawian food search, clinical nutrition calculators, and RAG-backed guidance.
MCP server for US nursing facility search and ownership lookup (NursingHomeDatabase).
MCP server exposing supplements database used by iNutriPlan.com
Unlock the power of food transparency with our Open Food Facts MCP server. Easily look up any food
Related MCP Servers
- AlicenseAqualityBmaintenanceThis MCP server generates individualized meal plans for children with chronic kidney disease (CKD) based on KDIGO 2024/PRNT 2020/KRCP 2025 guidelines, incorporating patient age, CKD stage, allergies, dietary culture, and diet diary analysis. It provides deterministic nutrient computations and tools for meal plan generation, food database lookup, and risk analysis.13MIT
- AlicenseAqualityDmaintenanceMCP server that provides food composition data from USDA FoodData Central, enabling search, nutrient lookups, and recipe nutrition calculations.4PolyForm Noncommercial 1.0.0
- FlicenseAqualityBmaintenanceMCP server for pediatric CKD lab data, providing lab panel queries, critical value alerts, trend analysis, and write operations with role-based permissions.5-
- FlicenseAqualityBmaintenanceRead-only MCP server providing pediatric CKD patient master data with tools for patient profiles, diagnosis, nutrition ceilings, guardian verification, and patient lists, designed for the CKDNutri project.5-