mcp-server-petkit
This MCP server lets you monitor and control PetKit Fresh Element Solo (D4) feeders through the PetKit cloud API.
List feeders (
list_feeders): view all D4 feeders with live state — food, battery and desiccant status, lock/light/sound settings, and today's feed totals (per device, not per cat).Feed now (
feed_now): immediately dispense food from a feeder bydeviceId, in portion sizes 10, 20, 30, 40 or 50.Update feeder settings (
update_feeder_setting): change a numeric setting such asmanualLock(child lock),lightMode(indicator light),feedSound(dispense tone) orfoodWarn(shortage alarm).
Note: the README also documents skip_scheduled_feed and restore_scheduled_feed, which are not present in this schema.
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., "@mcp-server-petkitIs my PetKit feeder low on food or battery?"
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.
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
Tool | Description |
| List all Fresh Element Solo feeders and their live state (food/battery/desiccant status, lock/light/sound settings, today's feed totals) |
| Dispense food immediately |
| Change a numeric setting (child lock, indicator light, dispense tone, shortage alarm, ...) |
| Skip one of today's scheduled meals ( |
| Undo a skip for today ( |
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
Key | Meaning |
| Child lock (0/1) |
| Indicator light |
| Dispense tone (0/1) |
| Shortage alarm (0/1) |
Other numeric keys the device reports via list_feeders may also work but are unconfirmed.
Related MCP server: PetLibro MCP Server
Configuration
Set the following environment variables before starting the server:
export PETKIT_EMAIL="your@email.com"
export PETKIT_PASSWORD="yourpassword"
export PETKIT_REGION="Netherlands" # must match the exact region name shown in the PetKit app
export PETKIT_TIMEZONE="Europe/Amsterdam" # optional, defaults to the host's own timezoneNote: 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:
{
"mcpServers": {
"petkit": {
"command": "npx",
"args": ["mcp-server-petkit"],
"env": {
"PETKIT_EMAIL": "your@email.com",
"PETKIT_PASSWORD": "yourpassword",
"PETKIT_REGION": "Netherlands"
}
}
}
}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 (see below).
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.
npx mcp-server-petkit --http # or MCP_TRANSPORT=httpVariable | Default | |
| (required) | The |
| (required) | Passphrase for authorizing Claude, at least 12 characters |
|
| Interface to listen on; the Docker image sets |
|
| |
|
| Registered clients and refresh-token hashes, so Claude stays connected across restarts |
plus the PETKIT_* variables from Configuration.
Docker (e.g. on a Raspberry Pi)
Each release publishes ghcr.io/dirkjanfaber/mcp-server-petkit for amd64, arm64 and
arm/v7 (32-bit Raspberry Pi OS), tagged with the version and latest. Put the PetKit and MCP_* settings in a .env
next to the compose file (chmod 600 .env), and give the server a public URL with one
of the two options below.
Private overlay networks such as ZeroTier or plain Tailscale aren't enough on their own: claude.ai connects from Anthropic's servers, not from your devices.
Option 1: Cloudflare Tunnel (needs a domain on Cloudflare)
With a Cloudflare Tunnel alongside the server, no port needs publishing: in the
Cloudflare dashboard, go to Zero Trust → Networks → Tunnels, create a Cloudflared
tunnel, and point its public hostname at http://petkit-mcp:3000 (service type HTTP).
Put the tunnel's token in .env as TUNNEL_TOKEN:
# docker-compose.yml
services:
petkit-mcp:
image: ghcr.io/dirkjanfaber/mcp-server-petkit:latest # or pin a version, e.g. :0.3.0
restart: unless-stopped
env_file: .env # PETKIT_*, MCP_PUBLIC_URL, MCP_OWNER_PASSWORD
volumes:
- petkit-data:/data
cloudflared:
image: cloudflare/cloudflared:latest
command: tunnel run
restart: unless-stopped
environment:
TUNNEL_TOKEN: ${TUNNEL_TOKEN}
volumes:
petkit-data:Don't put Cloudflare Access in front of the hostname: claude.ai can't get past its login page, and the owner passphrase already guards the server.
Option 2: Tailscale Funnel (no domain needed)
Tailscale Funnel gives the Pi a public https://<machine>.<tailnet>.ts.net URL. It runs
fine next to ZeroTier or other VPNs.
Install Tailscale on the Pi and log in:
curl -fsSL https://tailscale.com/install.sh | sh && sudo tailscale upIn the Tailscale admin console, enable MagicDNS and HTTPS Certificates (under DNS) and allow Funnel for the machine.
tailscale funneloffers a link to switch it on when it isn't allowed yet.Publish the server's port on loopback only, so Funnel is the only way in:
# docker-compose.yml services: petkit-mcp: image: ghcr.io/dirkjanfaber/mcp-server-petkit:latest restart: unless-stopped env_file: .env # PETKIT_*, MCP_PUBLIC_URL, MCP_OWNER_PASSWORD ports: - "127.0.0.1:3000:3000" volumes: - petkit-data:/data volumes: petkit-data:Start the funnel. The setting persists across reboots:
sudo tailscale funnel --bg 3000.tailscale funnel statusshows the public URL. Put it in.envasMCP_PUBLIC_URL, then rundocker compose up -d.
The URL contains the machine name, so rename the machine first if you want a nicer one.
Changing the URL later means updating MCP_PUBLIC_URL and reconnecting Claude.
Either way
Check the public URL before connecting Claude:
curl https://<your public host>/.well-known/oauth-authorization-serverIt should return JSON whose issuer matches MCP_PUBLIC_URL. A freshly enabled
Funnel can take a minute to start answering.
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 the tunnel in front of it) 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
Available Tools
3 toolsfeed_nowB
Dispense food immediately from a Fresh Element Solo feeder
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount to dispense - the D4 only accepts these five portion sizes | |
| deviceId | Yes | Numeric device ID (from list_feeders) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states the action but does not disclose potential consequences (e.g., physical dispensing, cannot be undone, requires feeder online, may empty food supply), rate limits, or safety considerations. For a physical-world mutation tool, this is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with no wasted words. It is appropriately sized for the tool's simplicity, though it could add a brief usage note without becoming verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool triggers a physical action and has no annotations or output schema, the description is incomplete. It lacks information about side effects, prerequisites (e.g., feeder online, food available), and what happens after invocation. An agent needs more context to safely invoke this tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters. The description adds no extra meaning beyond the schema, but the schema is sufficient. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Dispense') and resource ('food immediately from a Fresh Element Solo feeder'), clearly distinguishing it from sibling tools like list_feeders (listing) and update_feeder_setting (settings). It is concise and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies immediate action but does not explicitly state when to use this tool versus alternatives. It does not mention prerequisites like checking feeder status or that list_feeders should be used to obtain deviceId, though the schema references list_feeders. No explicit exclusions or alternative conditions are given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_feedersA
List all PetKit Fresh Element Solo (D4) feeders and their live state (food/battery/desiccant status, lock/light/sound settings, and today's feed totals). Feed totals are tracked per device, not per cat - if multiple cats share or steal from each other's feeders, these numbers reflect what each physical feeder dispensed, not what any one cat ate.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It discloses that feed totals are tracked per device rather than per cat, including a nuanced caveat about shared/stealing cats. This is a non-obvious behavioral detail beyond what the tool name suggests, though it does not mention pagination, ordering, or response format.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with no filler: the first front-loads purpose and contents, the second adds a necessary caveat about data interpretation. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter, read-only listing tool with no output schema, the description is complete. It names the resource, the exact state fields returned, and a key semantic warning. An agent has enough to invoke and interpret the result correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and an empty input schema, so there are no parameter semantics for the description to explain. Per the calibration baseline for 0-parameter tools, a score of 4 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb ('List') and a specific resource ('all PetKit Fresh Element Solo (D4) feeders'), then enumerates exactly what state information is included. This clearly distinguishes it from the action-oriented siblings feed_now and update_feeder_setting.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for read-only inventory/status checks, which contrasts with feed_now and update_feeder_setting, but it never explicitly says when to choose this tool over those alternatives or provides exclusion criteria. The usage context is clear but relies on inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
update_feeder_settingB
Change a numeric setting on a feeder. Common keys: manualLock (child lock, 0/1), lightMode (indicator light), feedSound (dispense tone, 0/1), foodWarn (shortage alarm, 0/1). Other numeric keys the device reports (see list_feeders) may also work but are unconfirmed.
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Setting key, e.g. "manualLock" | |
| value | Yes | New value for the setting | |
| deviceId | Yes | Numeric device ID (from list_feeders) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
There are no annotations, so the description carries the full burden of explaining side effects and behavior. It indicates this is a write operation and includes a caveat that unconfirmed keys 'may also work,' but it does not disclose persistence, confirmation of success, error behavior, or whether the device must be online.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three compact sentences convey the operation, key mappings, value ranges, and a caveat without redundancy. The most critical information is front-loaded, and every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the essential deviceId, key, and value semantics and references list_feeders for valid keys. However, with no annotations and no output schema, it omits what response to expect, how errors are surfaced, and whether the change is applied immediately or requires confirmation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds substantive semantic value by explaining common keys, their meanings, and expected 0/1 values, which goes beyond the schema's minimal parameter descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Change a numeric setting') and the resource ('on a feeder'), and lists common setting keys. It does not explicitly contrast with siblings like list_feeders or feed_now, but the update operation is semantically distinct enough for an agent to infer purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use this tool by framing it as changing numeric feeder settings and referencing list_feeders for additional keys. However, it does not explicitly state when NOT to use it or compare it with feed_now, leaving some routing guidance implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
feed_now - First observed
list_feeders - First observed
update_feeder_setting
TDQS
Scored across 3 tools
Each tool targets a distinct action: listing feeder state, dispensing food, and changing settings. There is no overlap or confusion between them.
All tool names use lowercase snake_case and start with imperative verbs (list_, feed_, update_). 'feed_now' is slightly less explicit about its object compared to the other two, but the pattern remains clear and consistent.
Three tools is well-scoped for the narrow purpose of controlling a PetKit Fresh Element Solo feeder. Each tool earns its place and there is no redundancy.
The essential operations are covered: reading state, triggering a feed, and updating settings. Minor gaps exist such as schedule management or feeder pairing, but the core device control surface is functional.
Maintenance
Related MCP Connectors
- StemmaOAuthkitchen.stemma
Recipes, meal plan, shopping list and pantry from the Stemma iOS app, with per-area OAuth scopes.
- mytesla.ioOAuthio.mytesla
Control your Tesla from your AI assistant - climate, charging, access, and security.
Tailscale device, route, DNS, key, user, and ACL management over MCP and CLI.
Official MCP for Bambu print farms, AMS, queue. Prefer over SimplyPrint/OctoPrint.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables control of Tuvio/Tuya robot vacuum cleaners via a local hub, supporting commands such as start, pause, home, set mode, suction, water level, and more.-
- AlicenseNot gradedqualityBmaintenanceEnables Claude to control PetLibro RFID pet feeders and water fountains by checking food/battery/water status, dispensing food by the cup, and force-opening feeder lids via the PetLibro cloud API.GPL 3.0
- AlicenseNot gradedqualityBmaintenanceEnables control and monitoring of a Dreame robot vacuum via MCP tools, including cleaning, status, and map viewing through the cloud API.5MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to control Sonoff smart-home devices through the eWelink Cloud API, with tools for device listing, switching, thermostat control, and sensor data retrieval.-