Inspiration

Deep work breaks easily. One buzz or a bright light pulls attention away, and getting back takes longer than the interruption. We wanted one command, "Alexa, start deep work," that sets up the room: lights go calm blue, the phone goes silent, and focus music starts. Our rule: never change anything without asking first.

What it does

PomoSync AI is an MCP server for Alexa+ with two tools:

  1. request_focus_session stages a session and asks the user for confirmation. It changes nothing.
  2. confirm_and_execute_focus runs only after "yes." It turns on the lights, Do Not Disturb, and music, then restores everything when the timer ends.

A "no" closes the session, and an unanswered request expires after five minutes.

How we built it

  • Layers: tools/ (MCP wiring), core/ (session logic), and devices/ (lights, DND, music). The core code has no MCP imports, so it can be tested on its own.
  • Confirmation is enforced in code. A session moves from awaiting to activating only once, using an atomic check, so a retried confirmation can't trigger devices twice.
  • Devices share one interface. Lights use Home Assistant, DND uses MacroDroid, and music plays licensed local tracks through mpv.
  • Async throughout. Device calls run concurrently, and the focus timer doesn't block the server.

Session states: \( \text{awaiting} \rightarrow \text{activating} \rightarrow \text{active} \rightarrow \text{completed} \)

Challenges

  • IFTTT dropped free webhooks, so we moved lights to Home Assistant.
  • Streaming music needs API keys, so we play local licensed tracks instead.
  • mcp 2.x renamed FastMCP, so we pinned mcp<2.
  • Restarts lose session state, so lights could stay in focus mode. We documented this as a known limitation.
  • No live hardware during the build, so we tested with fake devices. Real-device tests are still pending.

Accomplishments

  • Adding a device takes one module and one line of wiring.
  • Confirmation is guaranteed by code, not by prompting.
  • Device failures return clear results instead of crashing.
  • Music needs no account or subscription.

What we learned

  • Structured tool outputs guide the model better than plain sentences.
  • Safety belongs in state transitions, not in prompts.
  • Free tiers change, so each external service needs a clear boundary.
  • Pin dependencies to avoid overnight breakage.

What's next

  • Save session state and clean up on shutdown.
  • Add a voice "stop" tool to end sessions early.
  • Add a Home Assistant speaker backend for music.
  • Test against a real Home Assistant setup and an Android phone.

Built with

python mcp httpx asyncio home-assistant macrodroid mpv alexa

Built With

  • ai-automation
  • alexa+
  • asyncio
  • concurrency
  • device-integration
  • do-not-disturb
  • fastmcp
  • focus
  • home-assistant
  • httpx
  • macrodroid
  • mcp
  • model-context-protocol
  • mpv
  • pomodoro
  • productivity
  • python
  • smart-home
  • user-consent
  • voice-assistant
Share this project:

Updates