-
-
The problem: 1 in 4 older Americans with dementia or mild cognitive impairment lives alone.
-
Amazon's Alexa developer console: Margaret sets her own check-in in plain words (classic skill, not an Alexa+ add-on).
-
How it runs: one SAM template. Lambda, DynamoDB, EventBridge Scheduler, SES, Bedrock.
-
No "good night" by 10 pm: the loop stays open and Dana gets a calm email, sent with Amazon SES.
-
Dana asks from her own assistant: "How is Mom doing today?" The day is read back exactly as recorded.
-
"I think so, maybe after lunch" is recorded as said later, with a follow-up at 13:00. Never "done".
Inspiration
My grandmother had severe dementia. Toward the end she would forget our names and where she was. She fell once and was badly hurt, and we had to move her into an elder care facility because she needed more watching over than we could give her. Having something like this would have helped us when she was still with us.
Closed Loop wouldn't have stopped that fall, and it can't replace care. It's for the stretch before that, when someone still lives at home and mostly manages on their own, and the family needs to know each day whether things are okay, and to hear about it when they're not.
An estimated 7.4 million Americans 65 and older are living with Alzheimer's, and 1 in 4 older Americans with dementia or mild cognitive impairment lives alone. Nearly 13 million family members and friends give them unpaid care, often from another town. Amazon's own remote-caregiving service, Alexa Together, is no longer available. (Sources in docs/impact.md: Alzheimer's Association 2026 Facts and Figures; UCSF, JAMA Network Open 2023; Amazon, May 2025.)
Families improvise: an Alexa reminder, then a phone call to check. A reminder can ask the question, but it never learns whether the loop closed. And for someone with memory changes, a voice "yes" is not ground truth: "I think so, maybe after lunch" is not done.
What it does
Closed Loop is a self-hosted MCP server for an Alexa+ add-on, plus a caregiver console and a simulated Alexa+ client. It is live on AWS.
Care tools are usually set up by the family, about the person. Closed Loop starts with the person: the older adult can set part of their own safety net by voice, and the family's check-ins work the same honest way.
- Lets the person set their own safety net, by voice. Margaret says "If I haven't said good night by ten, let Dana know." The assistant reads it back and nothing is set until Margaret says yes (two MCP calls with a signed, five-minute token, so a model cannot create one in a single unconfirmed call). It is never asked: the loop closes when Margaret says "good night" before 10 pm, so it needs no proactive prompt. Otherwise Dana gets an email in Margaret's name: "Margaret asked Closed Loop to let you know if Margaret hadn't said "good night" by 10 pm. Margaret hasn't yet. This is not an emergency alert." Family see it in the console as Set by Margaret and can pause everything, but cannot create, edit, or cancel it.
- Records honestly. "I think so, maybe after lunch" is stored as said later, with a follow-up at 13:00. A hedged yes becomes said they would, not sure. The ledger only ever says reported by the person, said later, no response, or needs human contact, never "confirmed".
- Follows up at the time the person chose, or after the caregiver's interval, a capped number of times, never twice in one turn.
- Tells a human, without crying wolf. When a window closes with no answer, Amazon SES sends a plain email ("We did not hear back about your morning routine today. This is not an emergency alert.") with a signed acknowledge link. Nobody acknowledges for a second day, the second contact is told. A daily cap and quiet hours keep it calm.
- Lets family ask from their own Alexa. "How is Mom doing today?" reads back the day exactly as recorded ("needs human contact; a call may help"). A family member's linked account can read the day but can never answer, defer, or pause a check-in for the person: the server refuses it.
- Handles distress carefully: confusion gets the family's own calming line and no more questions, plus a neutral note to family; emergency wording gets one fixed line, "If this is an emergency, please call 911 now" (and 988 for self-harm wording).
- Puts the family in charge, with consent: check-ins in their own words (linted so no drug names or doses are read aloud), who gets emailed, quiet hours, plan expiry, recorded consent that stops everything when revoked, and delete-all-data.
- Shows results as MCP App cards (
ui://resource, SEP-1865) using Alexa+'s documented_meta.uiplacement. - Links accounts with OAuth 2.1 the way Alexa+ add-ons do, with separate link codes for the person's own Alexa and a family member's.
- Ships an Agent Skill (
skills/closed-loop-checkins/SKILL.md): the check-in protocol and honesty rules for any agent connected to the server. - Runs on Alexa today, too. A thin classic Alexa custom skill (development stage,
packages/alexa-skill) calls the same MCP server, with an Echo Show card and a reminder through the Alexa Reminders API. The video shows it in Amazon's Alexa developer console simulator (0:29). It is not an Alexa+ add-on; add-on tooling is partner-only.
It is deliberately not an emergency system, and it says so on every surface. MCP add-ons have no documented way to speak first, so turns start with the person, a household routine, or (in the demo) the simulator.
What the rules call creative, and where it is
| The Alexa+ judging guidance lists | Closed Loop | Video |
|---|---|---|
| A design that works inside the platform's limits | Add-ons cannot speak first, so the person's own check-ins close when the person speaks first: "If I haven't said good night by ten, let Dana know", then "Good night". It reuses the same state machine, ladder, consent and email cap, and emails at the person's own deadline even during quiet hours, because that is what they asked for. A one-click guided tour plays it live: /simulator/?tour=good-night. |
0:29, 2:11 |
| An agentic workflow that orchestrates across services autonomously | Every minute EventBridge Scheduler runs a tick that closes windows in DynamoDB, emails family through SES, escalates to a second contact on day two, and stops when someone acknowledges. No human in the loop until a human is needed. | 1:14 |
| A context-aware add-on that keeps state across sessions | The ledger, follow-ups at the time the person chose, the distress quiet period, and the family's view of the day all persist across sessions. | 0:50, 1:54, 2:11 |
| Media support (cards) and MCP Apps | One MCP App card renders all eight tool results, including the family summary and the person's own check-in, in a sandboxed iframe with the spec's handshake. | 1:09 |
| Agent Skills | skills/closed-loop-checkins/SKILL.md |
2:30 |
| Not a single-turn Q&A bot | Answers, deferrals and follow-ups span hours and days; family hear the result later from their own device. | throughout |
How we built it
- MCP server: TypeScript on
@modelcontextprotocol/sdk1.32.1, stateless Streamable HTTP via the Web-standard transport. Accepts both2025-03-26and2025-11-25handshakes, validates Origin, returns 401 withoutWWW-Authenticate(per Alexa+'s auth docs), serves RFC 9728 metadata, and runs its own OAuth 2.1 authorization server built to Alexa+'s account-linking requirements, with a person/family role carried in the authorization code, refresh token and access token. Eight tools with enums and bounded strings,structuredContentplus text, a tools/list snapshot test, and a two-call confirm (signed token plus the person's own yes) for the one tool that creates something. - State machine and ladder in a pure, tested core: conditional writes on a version attribute so overlapping ticks never double-send, an atomic daily alert cap, and honest "open reasons" (not reached vs asked with no answer).
- AWS: Lambda (arm64) behind a Function URL, DynamoDB single table with TTL and Streams, EventBridge Scheduler (minute tick plus keep-warm), SES, Bedrock (Converse with tool use) for the planner and an asynchronous second opinion, all in one SAM template.
- Simulated Alexa+ client: a browser page that is a real MCP client and shows every JSON-RPC message, a planner hop, the MCP App card, a "who is speaking" switch for the person or a family member, and a simulated clock that moves the whole system.
- Caregiver console: Amazon-style app layout with Apple's system type, keyboard-first, status by shape and words, zero axe-core violations on every page in light and dark.
- Tests: 444 in all. A 265-reply fail-closed eval assumes the planner claims
donefor everything and counts both directions: 0 unsafe misses and 0 false alarms (docs/evals.md; its first run found 44 failures, which the rules now fix). Also unit, protocol, OAuth, planner and console API tests, a requirement-to-test map for Alexa+ (docs/alexa-plus-readiness.md), an end-to-end replay of the demo that passes locally and on AWS, and three independent MCP clients (browser, MCP Inspector, the official SDK client).
Challenges we ran into
- Alexa+ docs disagree on the protocol version and differ from the MCP spec on 401 headers; client headers are undocumented, and the SDK 406s JSON-only clients. We accept both versions and normalize
Accept. - No proactive primitive for add-ons, so the design separates "asking" (person-initiated) from "closing the loop" (scheduled), and the person's own check-ins close when the person speaks first. Whether a bare "good night" reaches an add-on at all is undocumented, so we say so (FRICTION_LOG #14).
- A brand-new AWS account: Bedrock daily token quota of 0 (not adjustable), Lambda concurrency of 10 (no provisioned concurrency), SES sandbox. Bedrock paths are deployed and pass request validation but fall back to rules today, and the UI says so.
- Cold starts above Alexa+'s 500 ms budget; mitigated with lazy SDK loading and a keep-warm schedule.
Accomplishments that we're proud of
- The person, not only the family, can create a check-in, by voice, with a two-step yes that no model can skip.
- The ledger never claims more than the person said, and every unsafe path fails closed.
- Exactly-once email under concurrency, proven against real DynamoDB.
- A real MCP App card that works with both the MCP Apps spec and Alexa+'s documented placement.
- An accessible console that passes axe-core with zero violations.
What we learned
Most of the work in a "reminder" product is what happens after the question: honest recording, follow-up timing, and knowing when to involve a human without crying wolf. And the most respectful check-in is one the person sets up for themselves.
What's next
A consent-gated proactive primitive in Alexa+ would let the add-on start the morning check-in itself. Then: a weekly Bedrock digest for families, multi-household support, and a calibrated decision model (such as TypeSafe's Jev) as a second-opinion classifier.
Code: https://github.com/Juiccef/closed-loop (MIT). Open-source companion: https://github.com/Juiccef/mcp-handshake-check
Built With
- agent-skills
- alexa
- amazon-bedrock
- amazon-dynamodb
- amazon-eventbridge
- amazon-ses
- aws-lambda
- aws-sam
- axe-core
- esbuild
- mcp-apps
- model-context-protocol
- node.js
- typescript
- vitest
Log in or sign up for Devpost to join the conversation.