Inspiration
When water keeps moving in a house with every tap off, the usual advice is a process of elimination: shut off part of the house, check the meter, open it again, try the next part. It works, but it takes patience, a meter you can read and a valve you can reach. I wanted Alexa+ to do that job with you, and to be useful every day, not only on the rare day something leaks.
What it does
Leak Hunt is an Alexa+ add-on for a home with one water meter and a small pipe controller (a valve on every pipe).
- "Alexa, fill the bath, 120 litres." The tap opens only on a timer inside the controller, and Alexa keeps that timer equal to the litres still to go, so even if she goes silent the tap closes at about the amount. When the bath is full she says whether water was already moving somewhere else.
- "Alexa, work mode" or "good night". After a yes, she turns off the pipes nobody needs (sleep mode keeps the bathroom on), then checks the meter so "off" really means off. "I'm up" or "I'm home" turns back on exactly what the mode turned off.
- "Alexa, find my leak." With a spoken yes she closes pipes one at a time, each on a lease that ends by itself, and names a pipe only when the flow drops, comes back and drops again by the same amount. A separate question decides whether it stays off. When the evidence isn't there, she says what she could not see instead of guessing.
- Power Hunt. The same engine on a whole-home energy meter and smart plugs: "Confirmed: 46 watts is drawn behind the TV plug." Plugs marked must-stay-on, like the router and the freezer, are never switched.
- Safe when software fails. Every close is a lease the controller ends on its own clock: if the add-on dies mid-hunt, every pipe reopens by itself.
How I built it
- An MCP server (MCP Python SDK 2.2.0, Streamable HTTP) with 14 tools, an MCP App screen (next step, valve map, live flow chart, Stop) and OAuth 2.1 + PKCE account linking.
- A hunt engine that works in whatever unit the meter reports, so water (litres) and power (watt-minutes) share one engine.
- A simulated house and home (meter, pipe controller, taps, plugs) with a time-lapse clock, and a dev host that is a real MCP client: the route the hackathon FAQ sets out, since no entrant can connect a self-hosted add-on to a real Alexa+ device.
- A "Try to fool it" page: hide a leak, throw an outside tap, a sensor dropout or a jammed valve at the hunt, then Reveal what was hidden, what Leak Hunt said, and what the simplest rule ("the first drop wins") would have said on the same readings.
- The controller contract, published separately as the open-source kit pipehub-conformance.
How it is checked
304 unit and HTTP tests; fuzzers over 300 automatic hunts, 1,000 fills and 500 Power Hunt homes with 0 violations; deliberately broken versions of the service that the checks must catch; a search over 600 hunts with one outside change in which Leak Hunt named a wrong valve 0 times and the simplest rule 7 times; and a Playwright audit of the screen (17 scenarios). Every number comes from a command listed in docs/VERIFICATION.md.
Challenges I ran into
- A single drop in flow can be someone else's tap. Requiring drop, back, drop by the same amount is what made the answer trustworthy.
- Safety had to survive the software failing, so the controller enforces leases on its own clock instead of trusting the add-on.
- Entrants cannot reach an Alexa+ host, so I wrote a host emulator from the MCP Apps protocol and logged the open questions in a friction log.
- MCP SDK details cost time: tools registered after the server is built silently disappear, and an empty PKCE challenge was accepted (both in the friction log, with workarounds).
Accomplishments that I'm proud of
- It never names a valve without repeated evidence, and says so plainly when it cannot see.
- Pulling the plug on the add-on mid-hunt still ends with every pipe open.
- The same engine found a power leak without a single change to its code.
What I learned
- Designing for the failure case first (leases) is what makes voice control of physical things trustworthy.
- How an MCP server, an MCP Apps screen and OAuth account linking fit together into an assistant add-on, and how to test all of it without the host.
What's next
- Run it on a real Alexa+ host when the toolkit opens to developers.
- Build a real pipe controller (for example an ESP32 board) that passes pipehub-conformance, and measure a real sensor's limits (the bench plan is in
docs/BENCH.md).
What is real and what is simulated
Real, running code: the engine, the MCP server, the screen, OAuth and every check. Simulated: the house, the pipe controller, the water meter, the energy meter and the plugs. No firmware exists yet and no real valve has been driven.
Code: https://github.com/arulmuruganmcse2024-tech/leak-hunt · Open-source kit: https://github.com/arulmuruganmcse2024-tech/pipehub-conformance · Film: https://youtu.be/2EoreksaOb4
Built With
- alexa-plus
- css3
- html5
- javascript
- mcp
- mcp-apps
- model-context-protocol
- oauth2
- pkce
- playwright
- python
- sqlite
- streamable-http
- svg
- uvicorn
Log in or sign up for Devpost to join the conversation.