node-huckleberry-mcp
Huckleberry MCP Server
面向 Claude、Cursor、VS Code 及其他 AI 助手的非官方 Huckleberry 婴儿追踪器 MCP 服务器。可查询并记录婴儿睡眠、喂养、尿布、吸奶、辅食、如厕和成长记录。
直接在 Claude Desktop 中展示 Huckleberry 的数据(睡眠、喂养、成长、尿布、辅食),或将 MCP 服务器集成到其他 AI 应用中。
安装
环境要求
Node.js 24+(与 CI 一致;参见
.nvmrc)npm 9+
快速开始
npm install -g node-huckleberry-mcp或直接通过 npx 使用:
npx node-huckleberry-mcp从源码构建
git clone https://github.com/KenLSM/node-huckleberry-mcp.git
cd node-huckleberry-mcp
npm install
npm run build
node dist/index.jsRelated MCP server: whoop-ai-mcp
配置
环境变量
服务器从环境变量中读取凭据:
HUCKLEBERRY_EMAIL=you@example.com
HUCKLEBERRY_PASSWORD=your-password
HUCKLEBERRY_TIMEZONE=America/New_York在项目根目录创建 .env 文件(模板参见 .env.example):
cp .env.example .env
# Edit .env with your Huckleberry credentials注意: 切勿将 .env 提交到版本控制。.gitignore 已将其排除。
Claude Desktop 集成
要在 Claude Desktop 中使用此服务器,请将其添加到你的 claude_desktop_config.json:
macOS/Linux: ~/.config/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"huckleberry": {
"command": "npx",
"args": ["node-huckleberry-mcp"],
"env": {
"HUCKLEBERRY_EMAIL": "you@example.com",
"HUCKLEBERRY_PASSWORD": "your-password",
"HUCKLEBERRY_TIMEZONE": "America/New_York"
}
}
}
}更新配置后,重启 Claude Desktop。Huckleberry 工具将出现在工具列表中。
工具
服务器在 6 个类别中提供 29 个工具。(活动会话的睡眠/喂养计时器——start_sleep、pause_feeding 等——尚未实现;请使用显式的 log_* 工具记录已完成的事件。)
儿童管理(2)
工具 | 输入 | 输出 |
| — | 用户资料 + 儿童 UID 列表 |
|
| 儿童资料( |
睡眠(4)
工具 | 输入 | 用途 |
|
| 记录一次已完成的睡眠时段 |
|
| 最近的睡眠时段(含 |
|
| 编辑现有睡眠条目 |
|
| 永久删除睡眠条目 |
喂养(10)
工具 | 输入 | 用途 |
|
| 记录一次哺乳时段 |
|
| 记录一次奶瓶喂养 |
|
| 记录一次辅食喂养 |
|
| 记录一次吸奶时段 |
|
| 最近的吸奶时段(含 |
|
| 最近的喂养记录(含 |
|
| 编辑现有喂养条目 |
|
| 编辑现有吸奶条目 |
|
| 永久删除喂养条目 |
|
| 永久删除吸奶条目 |
尿布(5)
color 和 consistency 被限制为一组固定值(yellow/brown/green/black/red/white/orange/other;hard/normal/soft/runny/watery/formed/mucousy),以防止无法识别的值导致 Huckleberry 应用在该条目上崩溃。关于该集合的选取方式,参见 TASKS.md → BUG2——该集合继承自旧版移植,尚未经线上确认。
工具 | 输入 | 用途 |
|
| 记录一次尿布更换 |
|
| 记录如厕训练活动 |
|
| 尿布 + 如厕历史(含 |
|
| 编辑现有尿布/如厕条目 |
|
| 永久删除尿布/如厕条目 |
成长(5)
工具 | 输入 | 用途 |
|
| 记录一次成长测量 |
|
| 最近的成长测量(含 |
|
| 成长历史(含 |
|
| 编辑现有成长测量 |
|
| 永久删除成长测量 |
辅食——自定义食物(3)
工具 | 输入 | 用途 |
| — | 获取精选食物数据库 |
|
| 列出某儿童的自定义食物 |
|
| 创建自定义食物条目 |
所有
start/end输入均为 epoch 秒。时间以从HUCKLEBERRY_TIMEZONE推导出的时区offset存储。每个
log_*工具都接受可选的自由文本notes字段,该字段存储在条目上,并由对应的 history/get_*工具返回(每个读取的条目都包含其 Firestoreid)。edit_*工具(edit_sleep、edit_feed、edit_pump、edit_diaper、edit_growth)更新现有条目上的notes及其他字段,delete_*工具则删除一个条目——两者都从对应的读取操作中获取id/interval_id/entry_id。删除不会重新计算追踪器的prefs.last*摘要,因此“最近”视图可能会短暂显示已删除的条目,直到下一次写入。
提示词
服务器还提供 MCP 提示词(在支持的客户端中以斜杠命令风格的模板呈现):huckleberry_usage(加载使用约定)、daily_summary(date?)和 log_event(event)。
智能体技能
skills/huckleberry/SKILL.md 教助手如何正确使用这些工具(儿童解析、自然语言时间 → epoch 秒、单位、写入前确认)。将其复制到你的 Claude 技能目录中,可让 MCP 使用起来更顺畅。
开发
脚本
npm run build # TypeScript → JavaScript (tsc)
npm run lint # Lint with oxlint
npm run lint:fix # Lint and auto-fix
npm run format # Format with oxfmt
npm run format:check # Check formatting without changes
npm test # Run unit tests (Vitest)
npm run test:watch # Watch mode for tests
npm run test:integration # Live tests (needs HUCKLEBERRY_* creds; skipped otherwise). Read-only by default; set HUCKLEBERRY_ALLOW_WRITES=1 to also run the log_*→delete write round-trip (test account only)
npm run inspect:schema # Dump real Firestore shapes (needs creds) — see docs/integration-testing.md
npm run smoke # Build + run the MCP server smoke test
npm run dev # Run in dev mode (tsx)工具链
TypeScript 5.3+,启用严格模式
oxc(oxlint + oxfmt)——基于 Rust 的快速 lint 与格式化工具
Vitest——单元测试运行器
Zod——运行时数据验证
Firebase JS SDK——Firestore + Auth
架构
src/
├── auth/ # Authentication (T1.1)
├── client/ # Huckleberry API operations (T1.2–T1.9)
├── models/ # Zod schemas for Firestore docs (T1.3)
├── server/ # MCP server framework (T2.1–T2.2)
├── tools/ # MCP tool implementations (T2.3–T2.8)
├── __tests__/ # Unit & smoke tests
└── index.ts # Entry point架构细节和约定参见 AGENTS.md。
测试
单元测试位于 src/__tests__/,使用 Vitest 并模拟 Firebase:
npm test运行单个测试文件:
npm test -- models.test.ts监视模式:
npm run test:watch实时集成测试(受门控)针对真实账户进行验证,没有凭据时会被跳过。默认情况下为只读;可选的 log_*→删除写入往返测试仅在设置 HUCKLEBERRY_ALLOW_WRITES=1 时运行(请使用测试账户)——参见 docs/integration-testing.md:
# read-only schema validation
HUCKLEBERRY_EMAIL=… HUCKLEBERRY_PASSWORD=… npm run test:integration
# also exercise log_*→delete writes (test account only)
HUCKLEBERRY_EMAIL=… HUCKLEBERRY_PASSWORD=… HUCKLEBERRY_ALLOW_WRITES=1 npm run test:integration许可与署名
本项目是两个 MIT 许可项目的 Node.js 移植:
py-huckleberry-api© 2025 Woyken(GitHub,MIT License)py-huckleberry-mcp© 2026 Huckleberry MCP Contributors(GitHub,MIT License)
此移植包含来自两个上游项目的大量设计与实现。
安全与隐私
本地不存储任何数据。 所有操作都是对你 Huckleberry Firestore 数据库的经过身份验证的读/写。
凭据基于环境变量。 切勿提交
.env或硬编码凭据。这是第三方服务的非官方客户端;API 是逆向工程得出的,可能会发生变化。
支持
文档: 贡献者指南参见 AGENTS.md。
问题: 请在 GitHub Issues 上报告错误或请求功能。
上游: 有关 Huckleberry 数据或 API 变更的问题,请参阅原始 Python 项目。
用 ❤️ 构建,作为 py-huckleberry-api 和 py-huckleberry-mcp 的 Node/TypeScript 移植版。
Maintenance
Related MCP Servers
- AlicenseAqualityBmaintenanceAn MCP server that provides access to Cronometer nutrition data, enabling users to pull food logs, macro and micronutrient summaries, and biometric data into Claude or Cursor. It supports daily nutrition tracking and raw CSV exports by interfacing with the Cronometer web protocol.2717MIT
- AlicenseNot gradedqualityAmaintenanceMCP server that connects AI assistants like Claude to WHOOP health data, enabling natural language queries about recovery, sleep, workouts, and more.149143MIT
- AlicenseBqualityBmaintenanceMCP server for accessing Oura Ring data from Claude Code and claude.ai, providing summarized health metrics and raw API data.11MIT
- AlicenseNot gradedqualityCmaintenanceHosted MCP server that syncs health data from Apple Health, Fitbit, Oura, and Google Health Connect, enabling Claude and ChatGPT to query workouts, sleep, nutrition, and recovery in plain English with interactive charts.MIT
Related MCP Connectors
Hosted Amazon Seller Central and Amazon Ads MCP server for Claude, ChatGPT, Cursor, and agents.
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/KenLSM/node-huckleberry-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server