Inspiration
Smart-home demos usually stop at "the assistant understands the request". The part that decides whether a home actually feels orchestrated is what happens in the two seconds after a doorbell rings while someone is watching a film: does the room know, and does it act without being asked?
What it does
A Model Context Protocol server that owns living-room orchestration. Device events go in, a readable rule table decides, and actions come back out with a recorded trace.
- MCP over Streamable HTTP -
POST /mcpspeaks JSON-RPC 2.0, answers as JSON or astext/event-streamwhen the client asks for it, and setsmcp-session-idon every response.initialize,tools/list,tools/call,pingand notifications are implemented. - Five tools - doorbell snapshot, Fire TV heads-up alert, wearable biometrics, scene apply, capability report.
- Rule table -
doorbell -> pause media, show picture-in-picture;biometric stress >= 70 -> dim lights by 40;motion sustained >= 8s -> overlay notice. Each decision records the triggering event, the measured value, every action attempted and whether it succeeded.
How we built it
src/server/mcp_server.ts-node:httprouting, JSON-RPC dispatch, SSE responses,-32700parse error and-32601method-not-found handling,isErrortool failures instead of transport errors.src/devices.ts- aDeviceAdapterseam with two implementations:ContractDeviceAdapter(explicit local stand-in) andHttpDeviceAdapter(bearer auth,/v1/devices/:id,/v1/devices/:id/commands, SSE event stream).src/orchestrator.ts- the rule table and the decision log.scripts/demo-run.mjs- drives a full session and saves the transcript.
Challenges we ran into
The first version of this repository listed tool schemas and answered from string constants, including a fabricated Ring liveFeedUrl. It never opened a socket. Replacing it meant building the transport for real and then being honest about the boundary: Alexa+, Ring and Bee have no public developer APIs, so no code path here can reach them.
That constraint is expressed in the design rather than hidden: /health and the server_capabilities tool both report realDevices: false when the contract adapter is active, and the HTTP adapter is the real implementation of the interface a partner grant would provide.
Accomplishments that we are proud of
- A recorded session: 7 round trips, 5 tools, 3 decisions, p50 15 ms on loopback, with the full transcript committed.
- 8 tests over real sockets: initialize, tools/list, capability reporting, the doorbell decision, the stress threshold, unknown method, malformed JSON, and an SSE frame.
- An action that fails is recorded as failed rather than silently dropped.
What we learned
A protocol is only real when a client can connect to it. Everything in this project that matters - session ids, SSE framing, error codes - only became visible after the server actually listened on a port.
What is next
Long-lived SSE streams with Last-Event-ID resumption, authentication for non-loopback binding, and a real partner integration the day one is available.
Built With
- ai-agents
- alexa-plus
- bee-wearable
- fire-tv
- mcp
- model-context-protocol
- node.js
- ring
- smart-home
- typescript