Boji
Integrates with Apple Health by importing Apple Health XML exports and accepting supported health metrics pushed periodically from Health Auto Export, so the ledger can track and display health data.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Boji · 个人饮食与健康账本
把午餐照片发给你常用的 AI,告诉它「米饭只吃了一半」,再打开 Boji 的网页,就能看到这顿饭记了哪些食物、按多少份量计算。第二天吃同一款便当时,助手可以查到你上次核实的规格和营养标签。
Boji 是单人自托管服务。你可以只用网页记餐,也可以把支持远程 MCP 和 OAuth 的 AI 客户端接进来。客户端负责看图、读标签和估算,Boji 负责保存记录、修订历史和按日汇总。当前仓库包版本为 0.2.0。项目详解
首版源码采用 PolyForm Noncommercial 1.0.0。欢迎个人非商业自托管、修改和分享;第三方收费托管或集成到商业产品须另获授权。完整许可范围见 LICENSE。
一句话让 Agent 部署
你需要一台可以长期运行服务的托管服务器、供 Agent 使用的部署权限,以及一个 AI 客户端能访问的 HTTPS 地址。可以用自己的域名,也可以用托管平台提供的固定地址。准备好后,把下面这句话交给有终端能力的部署 Agent,替换两个尖括号中的内容即可。
请按 https://github.com/Ciward/boji-mcp 的 README,把 Boji 部署到我的服务器
<SSH 别名或部署目标>,使用<公开 HTTPS 地址>,验证服务和 OAuth 发现后,给我网页地址、管理密码的安全获取方式、MCP 地址,以及连接 AI 客户端并验证第一条工具调用的步骤。
给部署 Agent 的执行说明
确认目标主机、持久磁盘、可用端口和 HTTPS 入口。复用已授权的服务器连接与反向代理。如果已有 Boji 实例,先核对数据目录和已有配置,并备份后再升级。
首次安装推荐使用仓库根目录的
compose.yaml。在服务器专用目录克隆源码,设置权限为0600的.env,写入BOJI_PUBLIC_URL(完整 HTTPS origin)、BOJI_TIMEZONE(用户时区)和BOJI_ADMIN_PASSWORD(首次安装可用openssl rand -hex 32生成并直接写入文件)。创建持久化data/目录,确保容器 UID 1000 可写,执行docker compose up -d --build。已有实例沿用原密码和数据。将公开地址下的所有路径转发至 Boji;同机反向代理可回源
127.0.0.1:8787,保留原始 Host。确认公网/healthz返回ok: true,/.well-known/oauth-authorization-server的issuer等于公开 origin,/.well-known/oauth-protected-resource/mcp的resource指向公开/mcp,未携带凭据的POST /mcp返回401。交付实际网页地址、完整
https://…/mcp地址、服务器上.env的位置和下面的客户端接入步骤。由账本主人在 Boji 授权页输入管理密码,聊天中只提供获取方式。若宿主登录需要本人操作,注明已通过的服务端检查,以及授权后要运行的boji_get_context验证指令。
Related MCP server: nutrition-mcp
先在本机记一餐
在仓库根目录运行以下命令。需要 Node.js 24 或以上版本及 npm。
npm ci
npm run setup
npm run build
npm start打开
http://127.0.0.1:8787,使用.env中的BOJI_ADMIN_PASSWORD登录。首次 setup 会生成随机密码。默认时区是Asia/Shanghai,其他地区可在启动前修改BOJI_TIMEZONE。在网页新增早餐,填一项有营养标签的食物,把知道的数值填进去。缺少的营养数据留空,日汇总会保留缺测信息。
打开当日日记核对记录,试着修改份量,再看合计如何变化。账本默认保存在
data/boji.sqlite。
服务状态可通过 curl http://127.0.0.1:8787/healthz 查看。使用 Docker 时,先准备 .env 和可供容器用户 UID 1000 写入的 data/,再在根目录运行 docker compose up -d --build。根目录的 Compose 将端口绑定在主机回环地址。
把 AI 助手接进账本
给 Boji 配置 HTTPS 入口,将 BOJI_PUBLIC_URL 设为该入口的 origin,例如 https://boji.example.org,重新启动服务。在客户端添加 https://boji.example.org/mcp,选择 OAuth,在 Boji 授权页确认权限。先让助手执行一次只读操作,再试着写入。
请调用
boji_get_context,告诉我账本的日期和时区,然后查今天已经记录了哪些餐食。
帮我记午餐。这份便当的米饭吃了一半,其余吃完了。先查我的食物库,按实际份量记录,告诉我哪些营养值来自标签、哪些是估算。
收到保存回执后,可以在网页打开同一餐复核。如果再发餐后剩余的照片,请助手修订原餐。不同客户端的授权入口和可用能力取决于宿主。接入、权限与故障排查
账本能保存什么
内容 | 使用方式 |
餐食和营养 | 每项食物保存本次整份的营养、实际食用比例、证据和可信度。服务端按比例计算一次,支持能量、蛋白质、碳水、脂肪、纤维、糖、钠和饱和脂肪。 |
常吃的食品和菜品 | 保存参考份量、品牌或餐厅、来源和核实时间。餐食保留当时的营养快照,日后修改食物库仍可追溯旧记录。 |
Apple 健康数据 | 在网页创建来源,导入 Apple Health XML,或让 Health Auto Export 定期向设备专属接口推送支持的指标。网页显示最近接收时间和覆盖范围。 |
日记与趋势 | 查看当天已记录的摄入和近七日变化,可手工更正、移入回收站或恢复。无记录日期保留为空。 |
当前没有原生 iOS App、后台定时报告或内置模型推理。照片由接收它的 AI 客户端处理,使用外部客户端时应按其数据政策决定发送哪些内容。
数据与维护
备份与恢复 构建完成后运行
npm run backup -- /绝对备份目录生成 SQLite 一致性备份,其中含健康数据和授权记录。恢复到独立的空目录,核对记录后再切换。JSON 导出适合查看或分析账本数据。恢复步骤历史导入 HTTP XML 上限为 20 MiB。更大的 Apple Health 导出可通过
npm run import:health在数据库所在主机分批导入。参数与数据覆盖本地开发 运行
npm run check、npm test和npm run build。需要示例餐时,在独立演示数据目录运行BOJI_DATA_DIR=./data/demo npm run seed:demo -- --confirm-demo,并用相同目录启动演示实例。
进一步阅读
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Log meals and read your nutrition diary from Claude or ChatGPT.
Calorie, workout and body-weight log inside ChatGPT and Claude. Log meals by text, photo or voice.
Log meals and read calories and macros from any AI assistant. Pairs with the whatevr iPhone app.
Calorie tracker app for ChatGPT and Claude: read meals, macros, weight and log meals from chat.
Related MCP Servers
- AlicenseAqualityCmaintenanceA filesystem-based MCP server that turns any MCP-capable AI agent into a conversational calorie and protein tracker with natural-language estimates, confidence-aware logging, daily/weekly progress, food-history search, and export, working offline with local fallback data.8MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for personal nutrition tracking, enabling users to log meals with calories and macros, water intake, body weight, set goals, and import food diaries from other apps through natural language.MIT
- AlicenseNot gradedqualityBmaintenanceEnables a single user to connect ChatGPT or another MCP client to a personal FatSecret diary and Obsidian Markdown notes, supporting food search, meal draft preview and confirmed commit, undo, day status, and daily note sync.MIT
- AlicenseNot gradedqualityBmaintenanceEnables a chat assistant to log what you ate — text, voice notes, recipe portions, or label/plate photos — by resolving foods against the Bundeslebensmittelschlüssel, Open Food Facts, or Tandoor recipe nutrition and storing copy-on-write nutrient entries in a local SQLite log. It serves these tools over stateless streamable HTTP MCP, grouping entries into meals and summarizing days, weeks, and training/body-weight data when an OpenGym endpoint is configured.GPL 3.0