baby-fever-simulator
MCP server for infant fever management that tracks symptoms, medication, and lab results, providing guideline-based escalation levels, pharmacokinetic predictions, and structured clinical reports.
README
宝宝发烧模拟器 · Baby Fever Simulator
基于三层架构(状态机 + 资料库 + LLM)的婴幼儿发热管理 MCP 工具。
纯计算、零自然语言,输出结构化 JSON,由 LLM 消费后生成专业临床叙事。
版本:v3.0.2 | 适用月龄:0-36 个月
这是什么?
一个给新手父母的 AI 发烧助手。宝宝发烧时,你只需要告诉它体温和精神状态,它会:
- 🩺 告诉你现在该居家还是去医院 — 基于 NICE/AAP/WHO 指南,不是拍脑袋
- 💊 帮你算退烧药剂量 — 按体重精确到毫克,记录用药间隔,防止过量
- 🔬 帮你读化验报告 — 血常规、CRP、胸片都能结构化分析
- 📈 预测体温走势 — 告诉你接下来几个小时体温会怎么变
- 🚨 自动报警 — 新生儿发热、抽搐、重度脱水等急症一秒不漏
它不是什么:不是医生。急症请直接去急诊。它是一个帮你理清思路、记住细节、避免手忙脚乱的工具——等你见到医生时,能说清楚「几点几分烧多少度、吃了什么药、喝多少水」。
功能概览
| 模块 | 能力 |
|---|---|
| 🌡 三通道代谢 | 药物 PK(布洛芬/泰诺林半衰期)、水分蒸发、空腹衰减 —— 真实时间流逝模拟 |
| 🔮 预测引擎 | 1h/4h/8h 体温预测 + 置信度 + 预测账本跨会话偏差检测 |
| 📊 五级升级阶梯 | L1 居家观察 → L5 立即急诊,14 条主观体征 + 30 条化验触发 |
| 🔬 14 类诊断 | 血常规 24 项、生化 21 项、心肌酶 4 项、病原体 14 项、EBV、炎症、胸片等 |
| 📋 SOAP 临床记录 | S(家长主诉)/ O(实测)/ A(评估)/ P(计划)分层事件日志 |
| 🛡 安全红线 | 6 条硬编码急症触发(新生儿发热、抽搐、嗜睡+高热、重度脱水等) |
| 📚 知识库 | 88KB 结构化医学知识 + 52KB 原文参考文献(NICE/AAP/WHO/MSD) |
| 💾 数据保底 | 原始报告 MD 全量落盘 —— 任何无法结构化的报告数据永不丢失 |
三层架构
Layer 1 — MCP 状态机(engine.py 664行)
纯计算:代谢 / 预测 / 偏差 / 升级 / 化验分析
→ 零自然语言,纯 JSON 输出
Layer 2 — 资料库(knowledge_base.json 88KB + references/ 11文件 52KB)
结构化医学知识 + 原文追溯
→ 每条知识:knowledge + why + source + evidence_level
Layer 3 — LLM(SKILL.md + 消费状态 JSON)
异常值解读 + 综合护理建议 + 叙事表达
→ 用药建议始终克制在退烧范围内
MCP 工具(6 个)
| 工具 | 做什么 |
|---|---|
update_state |
录入体温/精神/用药/喝水/化验/原始报告 |
get_status |
查看完整状态快照(含 14 类诊断 schema) |
get_prediction |
体温预测 + 偏差检测 |
get_escalation |
升级判定(主观体征 + 化验异常加权叠加) |
generate_full_report |
出 SOAP 结构化报告 + 写预测账本 |
reset_state |
清空数据(保留月龄/体重/性别) |
快速开始
安装
在 ~/.workbuddy/mcp.json 中添加:
{
"mcpServers": {
"baby-fever-simulator": {
"command": "/path/to/python3",
"args": ["server.py"],
"cwd": "/path/to/宝宝发烧模拟器_v3.0.2"
}
}
}
WorkBuddy 右上角 Connector → 找到 baby-fever-simulator → Trust 即用。
使用
直接在对话中说"宝宝发烧 38.5 度",LLM 自动调用状态机。多轮对话逐步补充信息:
👩 「宝宝发烧了,38.5 度」
🤖 → update_state → L1,追问月龄/体重/精神
👩 「12 个月,9 公斤,精神还行」
🤖 → 补充基础信息,追问用药/喝水
👩 「没吃药,喝水量正常」
🤖 → 信息完整,generate_full_report → 完整评估 + 预测 + 建议
化验数据录入
支持真实医院报告的结构化录入:
👩 「血常规出来了:WBC 9.97,中性粒 27.3%,CRP 9.96」
🤖 → update_state(lab_test='血常规', ...) → 自动 flag + 升级叠加
无法结构化的报告走 MD 保底方案——数据全量落盘,零丢失。
完整对话示例
以下是真实家庭场景的端到端流程——凌晨发现宝宝发烧到拿到化验报告的全过程:
场景:17 月龄女宝,8.5kg,凌晨 1:00 开始发烧
第 1 轮 · 凌晨 1:00 — 初次发烧
👩 「宝宝发烧了,刚量 38.3°C,1 点开始烧的」
🤖 →
update_state(temp=38.3, fever_onset_time="01:00")
→ 信息不完整,追问月龄/体重/精神👩 「17 个月,8.5 公斤,精神还可以」
🤖 → 补充基础信息 → 追问用药/喝水情况
👩 「没吃药,喂了 60mL 水」
🤖 →
generate_full_report
→ L1 居家观察:38.3°C + 精神好 → 每小时测温,物理降温,继续补水
第 2 轮 · 上午 8:00 — 体温上升
👩 「38.8°C 了,精神不太好,有点蔫」
🤖 →
update_state(temp=38.8, neuro="drowsy", behavior="clingy")
→ 升级 L2 居家用药👩 「那吃药吧,喂了美林 85mg」
🤖 →
update_state(drug="ibuprofen", dose_mg=85)
→ 剂量校验:10mg/kg ✅ | 24h 累计 85mg,上限 340mg
→ 预测:1h 后约 38.5°C,4h 后 38.0°C
第 3 轮 · 下午 4:00 — 化验报告到了
👩 「去医院查了血,报告出来了。CRP 45.4 高了,PCT 1.81 也高,中性粒偏低」
🤖 →
update_state(lab_test="inflammatory", lab_results={"CRP": 45.4, "PCT": 1.81})
→ 异常标记:CRP > 50 倍上限、PCT > 1ng/mL
→ 模式识别:bacterial_infection_likely
→ 升级 L3 密切监控:化验加权 +2.5 → 四舍五入 +3 级👩 「胸片也说支气管肺炎」
🤖 →
update_state(lab_test="胸片", lab_results={"finding": "支气管肺炎"})
→ 叠加确认 L3
第 4 轮 · 次日下午 — 恢复期
👩 「体温降到 37.2°C 了,精神回来了,能喝奶了」
🤖 →
update_state(temp=37.2, neuro="normal", milk_ml=120)
→ 降级 L1 居家观察
→ 24h 不再用药,继续补水
完整流程只需 4 轮对话,覆盖从发烧到退烧的完整病程,每次计算都是精确到分钟的。
设计原则
- 状态机只计算,不说人话 — 所有自然语言由 LLM 层生成
- Plan ≠ Action — 药物建议始终标记为
recommendation_pending,只有家长确认后才写入执行记录 - 化验只升级不降级 — 主观体征基准 + 化验异常叠加 =
max(severity_added) + 0.5 × second - 每条建议必须引用来源 — 知识库有 → KB 路径,知识库缺 →
待补录标注 - LLM 用药建议限于退烧药 — 不针对化验异常建议抗生素/激素等
项目结构
宝宝发烧模拟器_v3.0.2/
├── server.py MCP 6 工具入口
├── engine.py 核心计算引擎
├── state_store.py JSON 持久化 + 14 类诊断 schema
├── SKILL.md LLM 层操作规范
├── VERSION
├── requirements.txt mcp>=1.0.0
├── knowledge/
│ └── knowledge_base.json 88KB 结构化知识库
└── references/ 11 文件 52KB 原文追溯
免责声明
本工具为 AI 辅助生成的便民健康工具,不构成医疗诊断或治疗建议。所有临床决策应由执业医师做出。如有紧急情况,请立即拨打 120 或前往最近的急诊科。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.