hatch-sleep-mcp-cloudflare-workers
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., "@hatch-sleep-mcp-cloudflare-workerslist my Hatch devices"
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.
hatch-sleep-mcp-cloudflare-workers
A remote Model Context Protocol server for one Hatch account, hosted on Cloudflare Workers. It reads and controls supported Hatch Rest sound machines over their unofficial REST and AWS IoT interfaces.
One Worker serves a bearer-protected, stateless /mcp endpoint. A Durable Object owns the Hatch session, cached device data, and short-lived AWS credentials.
Setup
npm install
npx wrangler login
cp wrangler.jsonc wrangler.local.jsoncIn wrangler.local.jsonc, replace hatch.example.com with a hostname on a Cloudflare zone you manage. Deploy using that local config:
WRANGLER_CONFIG=wrangler.local.jsonc npm run deploy
npx wrangler secret put HATCH_EMAIL --config wrangler.local.jsonc
npx wrangler secret put HATCH_PASSWORD --config wrangler.local.jsonc
openssl rand -hex 32 | tee /dev/stderr | npx wrangler secret put MCP_BEARER --config wrangler.local.jsoncThe custom-domain route creates its DNS record on first deploy.
Related MCP server: Home Assistant MCP Server
Tools
Tool | Description |
| List all devices with live state and supported-model summaries |
| Get raw reported shadow state for one device |
| List favorites for a riot-family device |
| Play a favorite by name or ID |
| Edit an existing favorite's schedule and content |
| Play a catalog sound, optionally at a set volume |
| Set sound volume |
| Set a named or custom RGB light color and brightness |
| Turn off the light |
| Turn off sound and light |
| Control clock visibility and brightness on riot-family devices |
| Control toddler lock on riot-family devices |
Write tools change a real device immediately. Confirm with the user before playing sounds or changing lights at night. Writes return the desired shadow payload without reading it back; call list_devices to confirm.
update_favorite edits an existing favorite in the Hatch cloud; create new favorites in the Hatch app.
Supported models
The riot, riotPlus, and restBaby product families and first-generation restPlus are supported. Other devices in the account appear in list_devices with supported: false, and write tools refuse to change them.
Raw HTTP
The endpoint uses stateless Streamable HTTP and returns SSE-framed MCP responses.
curl -s https://hatch.example.com/mcp -X POST \
-H 'Authorization: Bearer <MCP_BEARER>' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'GET / identifies the MCP endpoint. GET /health is public and reports cached login and AWS credential status without making a network request.
Local development
cp .dev.vars.example .dev.vars
npm run check
npx wrangler devHow it works
The Worker logs in through Hatch REST, exchanges Hatch's Cognito identity token for temporary AWS credentials, and caches them in a Durable Object. Reads use a short-lived MQTT 3.1.1 WebSocket session to request AWS IoT shadows. Writes use SigV4-signed HTTPS shadow publishes. No MQTT or AWS SDK is required.
This integration uses unofficial Hatch APIs and may break if Hatch changes them. Credentials remain Worker secrets and are sent only to Hatch and AWS Cognito. /mcp requires MCP_BEARER; / and /health are public.
License
MIT. See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Yoto: manage cards, tracks, icons and family devices from any MCP client.
1Create, inspect, and manage Wubble music, speech, voice, and sound-effect requests through MCP.
Manage your KeepMySubs subscriptions, spend, renewals, and bills from any MCP client.
Tailscale device, route, DNS, key, user, and ACL management over MCP and CLI.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables control and monitoring of Home Assistant smart home devices through MCP protocol. Automatically manages authentication tokens and provides simplified tools for device discovery, switch control, and light brightness adjustment.MIT
- FlicenseBqualityNot gradedmaintenanceEnables control and monitoring of Home Assistant smart home devices through MCP, allowing users to list entities, check device states, and call services to control lights, switches, sensors, and other connected devices.4-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to control Apple Home devices, scenes, and automations through MCP.2 npm64MIT
- AlicenseNot gradedqualityBmaintenanceEnables control of Mijia (Xiaomi) smart home devices through MCP, including querying homes, devices, scenes, and specs, setting properties, running actions and scenes, and issuing speaker commands.GPL 3.0