
PetKit
io.github.dirkjanfaberv0.3.0更新于 Oct 2, 2026
Unofficial MCP server for PetKit smart feeders: status, feeding history and schedule control.
概览
面向 PetKit Fresh Element Solo 智能喂食器的非官方 MCP 服务器,让助手查看喂食器状态与喂食记录并控制喂食计划。
- 功能
- 连接 PetKit 云端 API,为 Fresh Element Solo 喂食器(设备类型 D4)提供工具。list_feeders 返回实时状态,如粮食、电池与干燥剂状态、锁、灯与声音设置、当日喂食总量以及当天计划餐次。feed_now 立即出粮,份量为固定档位;update_feeder_setting 修改数值型设置,如童锁或缺粮提醒;skip_scheduled_feed 与 restore_scheduled_feed 可跳过或撤销当天某一餐,而不影响循环计划。
- 适用场景
- 当你希望助手在聊天客户端中查看 PetKit 喂食器状态与喂食记录,或出粮、调整当天喂食计划时使用。适合拥有 Fresh Element Solo 且能接受非官方社区集成的用户。
- 运行要求
- 以 npm 包形式在本地运行(npx mcp-server-petkit),通过 stdio 通信;也可用 --http 或 MCP_TRANSPORT=http 以 HTTP 模式运行。需要 PetKit 账户:PETKIT_EMAIL、PETKIT_PASSWORD、PETKIT_REGION,可选 PETKIT_TIMEZONE。HTTP 模式还需 MCP_PUBLIC_URL 和 MCP_OWNER_PASSWORD,可选 MCP_HOST、MCP_PORT、MCP_STATE_FILE。官方发布支持 amd64 与 arm64 的 Docker 镜像。
安装
在 SourceWeft 中
- 打开 控制台中的 PetKit,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mcp-server-petkit
MCP (Model Context Protocol) server for the PetKit cloud API. Exposes feeder status and control for the Fresh Element Solo (device type D4) as MCP tools.
Disclaimer: This project is not affiliated with, endorsed by, or in any way associated with PetKit. It is an independent, community-developed integration created by a happy user of their hardware and software. PetKit and Fresh Element Solo are trademarks of their respective owner. Use of this package is at your own risk. The underlying API is unofficial and reverse-engineered by the community - it may change or break without notice.
Tools
Feed amounts
The D4 only accepts these five portion sizes: 10, 20, 30, 40, 50.
Feed totals are per device, not per cat
list_feeders also returns feedPlanToday: today's scheduled meals from the feeder's weekly plan (d4/device_detail's multiFeedItem), each with its readable time, the feedTime (seconds since midnight) that skip_scheduled_feed takes, the portion amount in feed_now's units, and the meal name.
list_feeders' fedToday/fedTodayScheduled/fedTodayExtra/fedTodayPlanned/dispensesToday/feedTimesToday fields reflect what each physical feeder dispensed - PetKit has no way to attribute a dispense to a specific cat. If your cats share or steal from each other's bowls, these numbers won't tell you what any one cat actually ate.
Common setting keys
Other numeric keys the device reports via list_feeders may also work but are unconfirmed.
Configuration
Set the following environment variables before starting the server:
Note: PetKit account passwords are capped at 6-14 characters. A longer password fails login with a generic "incorrect username or password" error indistinguishable from an actually-wrong one - if login fails unexpectedly, check that first.
Usage with Claude Desktop
Add to your claude_desktop_config.json:
Remote use: claude.ai connector (HTTP + OAuth)
To use the server from claude.ai and the Claude mobile apps, run it in HTTP mode on an
always-on machine and add it as a custom connector. claude.ai connects from the
internet, so the server needs a public https:// URL - a Cloudflare Tunnel or
Tailscale Funnel gives you one without opening ports on your router.
HTTP mode is single-user: when you connect Claude, the server shows a page asking for your owner passphrase. Anyone who knows it can authorize a client, and anyone with a token can dispense food or change the feeding plan - pick a strong one.
plus the PETKIT_* variables from Configuration.
Docker (e.g. on a Raspberry Pi)
Each release publishes ghcr.io/dirkjanfaber/mcp-server-petkit for amd64 and arm64,
tagged with the version and latest. With a Cloudflare Tunnel alongside it, no port
needs publishing: create a tunnel in the Cloudflare dashboard, point its public
hostname at http://petkit-mcp:3000, and put its token in .env next to the PetKit
and MCP_* settings:
Update with docker compose pull && docker compose up -d. To build the image yourself
instead, replace image: with build: https://github.com/dirkjanfaber/mcp-server-petkit.git.
The server trusts one proxy hop (X-Forwarded-For from cloudflared) for rate limiting.
Don't also publish its port directly to the internet.
Connecting Claude
In claude.ai: Settings → Connectors → Add custom connector, with URL
https://<your public host>/mcp. Claude registers itself, opens the passphrase page,
and once you allow it, the tools show up in claude.ai and the mobile apps.
PetKit allows one session per account. The server's login signs the PetKit app out (and vice versa); it re-logs in on its own when that happens, but expect the app to ask you to log in again whenever the server restarts or its session lapses. Running the stdio server, Node-RED's PetKit nodes, or a second HTTP instance on the same account makes them take turns signing each other out.
References
- Actively maintained reference client (Python) - https://github.com/Jezza34000/py-petkit-api - source of the confirmed-working client fingerprint and current endpoint constants
- Sibling Node-RED package with fuller protocol notes -
node-red-contrib-petkit'sCLAUDE.md
来源:README.md,提交 7c806aa
工具
0版本历史
1- v0.3.0最新Oct 2, 2026

