CareLoop MCP Server
Integrates with Alexa+ to enable voice-based routine logging, health checks, and caregiver notifications, including TTS/STT and a smart display simulator for ambient elderly care monitoring.
Provides a persistent storage backend using Amazon DynamoDB, storing routine events, escalation state, and caregiver alerts with single-table design, encryption at rest, and point-in-time recovery.
Provides a local persistent storage backend using SQLite, mirroring the production DynamoDB schema for development, testing, and offline operation.
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., "@CareLoop MCP Servercheck Dad's routine health and alert me if he skipped lunch"
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.
CareLoop
Self-hosted Model Context Protocol (MCP) Server for Alexa+ Elderly Care Monitoring
Built for the Amazon Developer Hackathon: Alexa+ Track, AWS Builder Track, and Open Source Mini-Challenges
What Was Built During the Hackathon
Every day, millions of aging parents live independently while their adult children worry from afar. Traditional telecare systems suffer from three critical flaws:
Intrusive surveillance (cameras, microphones, and persistent audio recording that violate dignity).
Alarm fatigue (rigid static thresholds that spam family whenever Mom sleeps in 20 minutes late).
The AI Safety Paradox (deploying non-deterministic LLMs to make life-critical emergency alert decisions).
CareLoop solves this through a self-hosted Model Context Protocol (MCP) server over Streamable HTTP (spec 2025-11-25+) that enables Alexa+ to look after an elderly parent living alone. It passively learns each individual's personal circadian routine from ambient event metadata (pillbox openings, meals, room movement, door contacts), detects schedule deviations with circular statistics, conducts natural spoken check-ins by voice, and escalates to family caregivers via Amazon SNS only when truly necessary.
Hackathon Challenge Tracks Addressed
Alexa+ Track:
Implements the official FastMCP / MCPServer Streamable HTTP transport (
/mcpand/v1/mcp) with bi-directional JSON-RPC 2.0 streaming.Registers 9 Alexa+ voice tools with prompt-engineered voice triggers and return schemas formatted for Alexa Text-To-Speech (TTS) synthesis.
Built an ambient Voice Simulator UI (simulator/index.html) featuring native browser Web Speech API microphone dictation, SpeechSynthesis audio, a live MCP inspector showing JSON-RPC packets in real time, and a 6-step automated "Dad skips lunch" demonstration.
AWS Builder Track:
Amazon DynamoDB: Single-table design (
PK,SK) with AWS-managed server-side encryption at rest (SSESpecification: { SSEEnabled: true }) and Point-in-Time Recovery (PITR).Amazon SNS: Caregiver alert topic encrypted with AWS KMS (
alias/aws/sns).Amazon Bedrock (Claude 3 Haiku Converse API): Sandboxed strictly to empathetic daily routine summaries and factual memory Q&A—the LLM is strictly prohibited from making alert decisions.
Amazon EventBridge: Scheduled 1-minute autonomous health tick rule triggering a dedicated Lambda runner.
Full IaC Packaging: Production-grade AWS CDK (Python) in deploy/cdk/ and AWS SAM in template.yaml.
Open Source Mini-Challenge:
100% open-source under the MIT License.
Fully typed with Pydantic v2 domain models and validated by 79 pytest tests (100% pass rate).
Zero proprietary vendor lock-in: runs identically on local SQLite or AWS DynamoDB.
Related MCP server: earshot
Architecture
CareLoop strictly separates deterministic safety logic from generative language synthesis:
flowchart TD
subgraph AmbientInterface ["1. Ambient Voice & Smart Home Interface"]
Voice[("Elder Voice Input<br/>'I took my morning pills'")] --> Alexa[Alexa+ Ambient Assistant]
Sensors[("Home Sensors<br/>Pillbox / Motion / Door")] --> Alexa
end
subgraph MCPGateway ["2. Streamable HTTP MCP Gateway (FastMCP)"]
Alexa -->|"Streamable HTTP (2025-11-25)<br/>POST /mcp"| MCP["CareLoop MCP Server<br/>(Starlette ASGI on ECS Fargate)"]
Auth["AlexaAuthMiddleware<br/>Bearer / API Key"] -.-> MCP
end
subgraph DeterministicEngine ["3. Deterministic Clinical Safety Engine (Zero LLM)"]
MCP -->|"log_routine_event"| EWMA["Circular EWMA Baseline<br/>• Time-of-Day [0, 1440m)<br/>• Variance EWMA<br/>• Grace Window: μ + max(2σ, 30m)"]
MCP -->|"check_routine_health<br/>tick_escalation"| Risk["Multi-Factor Risk Engine<br/>• Medication missed (0.4)<br/>• Inactivity / Falls (0.3)<br/>• Night wandering (0.2)<br/>• Meal missed (0.2)"]
Risk --> StateMachine["Persisted Escalation State Machine<br/>Normal ➔ Gentle Check-In ➔ Repeat Check-In ➔ Notify Family"]
end
subgraph GenerativeLayer ["4. Sandboxed Generative Layer (Amazon Bedrock)"]
MCP -->|"daily_summary<br/>ask_memory"| Bedrock["Amazon Bedrock (Converse API)<br/>Claude 3 Haiku<br/>• Warm family summaries<br/>• Factual event history Q&A<br/>(Short-circuits if no events found)"]
end
subgraph StorageLayer ["5. Pluggable Encrypted Storage"]
EWMA & Risk & StateMachine & Bedrock --> Storage["Storage Interface<br/>(careloop/storage/base.py)"]
Storage -->|"Local Dev"| SQLite[("Local SQLite DB<br/>careloop_local.db")]
Storage -->|"AWS Production"| DynamoDB[("Amazon DynamoDB<br/>CareLoopData<br/>• Single-Table PK/SK<br/>• Encrypted at rest (KMS)")]
end
subgraph FamilyAlerts ["6. Caregiver Notification System"]
StateMachine -->|"Notify Family"| Notifier["Alert Dispatcher"]
Notifier -->|"Local Mode"| Console["Console / Terminal Log"]
Notifier -->|"AWS Mode"| SNS["Amazon SNS Topic<br/>CareLoopAlertsTopic<br/>• SMS / Push to Daughter Linda<br/>• Deterministic Reasons Included"]
endQuickstart
1. Installation
# Clone the repository
git clone https://github.com/KarnailSingh87/careloop.git
cd careloop
# Create and activate Python 3.11+ virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies in editable mode with development tools
pip install -e ".[dev]"2. Generate 60-Day Routine Benchmark Dataset
Seed the local SQLite database with 60 simulated days across 3 distinct elder personas (eleanor, dad, martha), yielding 1,422 routine events, 18 ground-truth safety incidents, and 42 benign noise controls:
python scripts/seed_data.py3. Launch Local MCP Server
Start the FastMCP Streamable HTTP server with the simulated clock enabled:
# Using module launcher
python -m careloop.server --host 127.0.0.1 --port 8000 --clock simulated
# Or using the root entrypoint
python server/main.py --host 127.0.0.1 --port 8000 --clock simulatedMCP Streamable HTTP Endpoint:
http://127.0.0.1:8000/mcpWeb Simulator UI & MCP Inspector:
http://127.0.0.1:8000/simulatorHealth Check Endpoint:
http://127.0.0.1:8000/health
4. Test Streamable HTTP MCP Tools
Run the included integration client to verify session negotiation, tool discovery, and execution over Streamable HTTP:
python scripts/client_test.py --url http://127.0.0.1:8000/mcp5. Run Full Test Suite
pytest -v
# 79 passed in 6.17sWeb Simulator & Live Demo
CareLoop includes an interactive single-page application at http://127.0.0.1:8000/simulator styled after an ambient Alexa+ smart display:
Ambient Alexa Orb: Animated glowing orb reflecting idle, listening, thinking, and speaking states.
Voice Microphone (STT): Uses the browser Web Speech API to dictate natural routine statements directly to Alexa+.
Speech Synthesis (TTS): Reads Alexa voice responses aloud with audio chimes.
Live MCP Tool Inspector: Displays exact JSON-RPC 2.0 tool requests, input arguments, execution latency, and return schemas (
2025-11-25).Injectable Clock Machine: Jump forward in time (
+15m,+1h,+1d,Jump to 2:00 PM) to test missed routines without waiting hours.Virtual Family Phone: Displays push/SMS notifications received by family caregivers with deterministic reasons and resolution status.
"Dad Skips Lunch" Hero Demo: One-click 6-step live demonstration that plays the full lifecycle:
Morning: Medication and breakfast logged normally.
12:45 PM: Normal lunch window arrives. Dad takes a long nap.
01:45 PM: Grace window expires; risk elevated to Medium; Alexa initiates a gentle voice check-in.
01:47 PM: No response; repeated check-in with attention chime.
01:49 PM: State machine escalates to
notify_family; alert dispatched via Amazon SNS with audit reasons.02:00 PM: Dad wakes up and says "I'm fine"; state machine resets to normal and family phone resolves.
Alexa+ MCP Tool Reference
CareLoop exposes 9 specialized MCP tools designed for Alexa+ natural voice interaction:
Tool Name | Alexa+ Voice Triggers | Description & Purpose | Key Arguments | Return Schema / Voice Response |
| "I took my pills", "I finished lunch", "Front door opened" | Records routine activity metadata (medication, meal, movement, door). Updates baseline EWMA and resets escalation to normal. |
|
|
| "How is Dad doing today?", "Is Mom's routine normal?" | Evaluates routine health, calculates deterministic risk score, lists plain-English reasons, and returns escalation stage. |
|
|
| Spoken response to Alexa check-in (e.g. "I was just reading") | Captures elder's verbal reply to an Alexa check-in prompt and updates state. |
|
|
| "I'm fine", "I'm okay", "Everything is good, Alexa" | Confirms the elder is safe, immediately resetting any active escalation back to |
|
|
| "Give me Dad's daily summary", "How was Mom's day?" | Generates a warm, synthesized 3-sentence daily overview for family caregivers using Amazon Bedrock. |
|
|
| "Did Dad take his pills today?", "What time did Mom eat lunch?" | Answers specific factual caregiver questions about routine history using Amazon Bedrock sandboxed to verified event logs. |
|
|
| "Remind Dad to drink water at 3 PM" | Schedules an Alexa voice announcement reminder for the elder parent. |
|
|
| "Alert my daughter", "Call my family" | Dispatches an urgent alert to designated family caregivers via Amazon SNS with audit reasons. |
|
|
| Autonomous scheduled check (EventBridge / cron) | Advances the escalation state machine without user intervention, checking grace windows and timeouts. |
|
|
Clinical Benchmark & Evaluation Results
CareLoop was benchmarked across a synthetic dataset of 60 simulated days per persona (180 elder-days total) across 3 clinical personas with realistic Gaussian jitter and 18 injected safety incidents:
Benchmark Metric | Eleanor Davis (Age 78)Morning Routine | Arthur Davis / Dad (Age 81)Retired Veteran | Martha Jenkins (Age 84)Arthritis Schedule | Combined Overall System |
Simulated Days Evaluated | 60 Days | 60 Days | 60 Days | 180 Days |
Total Sensor Events Processed | 474 | 474 | 474 | 1,422 Events |
Injected Ground-Truth Incidents | 6 | 6 | 6 | 18 Incidents |
- Missed Prescription Medication | 2 | 2 | 2 | 6 |
- Daytime Inactivity / Falls (3h+) | 2 | 2 | 2 | 6 |
- Missed Lunch Nutrition | 2 | 2 | 2 | 6 |
Benign Noise Controls (Within Grace) | 14 | 14 | 14 | 42 Variations |
True Positives (Detected) | 6 / 6 | 6 / 6 | 6 / 6 | 18 / 18 |
False Negatives (Missed Alerts) | 0 | 0 | 0 | 0 |
False Positives (False Alarms) | 0 | 0 | 0 | 0 |
Detection Rate (Sensitivity / Recall) | 100.0% | 100.0% | 100.0% | 100.0% |
False-Alarm Rate (FAR) | 0.00% | 0.00% | 0.00% | 0.00% |
False Alarms per Month (30 Days) | 0.0 | 0.0 | 0.0 | 0.0 |
Avg Detection Delay (from schedule) | 100.0 mins | 105.0 mins | 115.0 mins | 106.7 mins |
Avg Detection Delay (past grace window) | 20.0 mins | 25.0 mins | 35.0 mins | 26.7 mins |
To reproduce the benchmark evaluation:
python scripts/evaluate_benchmark.pyStrict Privacy Architecture
CareLoop is built from the ground up for strict healthcare and elder privacy:
Zero Raw Audio Storage: Neither CareLoop nor the MCP server ever captures, records, or stores ambient audio. Only discrete metadata tuples are stored:
(person_id, event_type, timestamp, metadata).Deterministic Safety Isolation: Amazon Bedrock is used strictly for phrasing daily summaries and answering factual routine questions. The LLM cannot invoke emergency alerts or change escalation stages.
Auditability & Explainability: Every alert dispatched to family contains deterministic, explainable reasons (e.g. "Blood pressure medication window closed at 09:15 UTC. Routine check-in unanswered after 120 seconds.").
Encryption at Rest: On AWS, all DynamoDB items and Amazon SNS messages are encrypted with AWS KMS customer-managed keys.
AWS Cloud Deployment
Deploy CareLoop to AWS with either AWS CDK or AWS SAM:
Option A: AWS CDK (Python)
cd deploy/cdk
pip install -r requirements.txt
cdk bootstrap aws://<ACCOUNT_ID>/us-east-1
cdk deployOption B: AWS SAM CLI
sam build
sam deploy --guidedOutputs Provisioned
Public MCP Streamable HTTP Endpoint:
http://<ALB_DNS>/mcpWeb Simulator UI:
http://<ALB_DNS>/simulatorHealth Check:
http://<ALB_DNS>/healthEncrypted DynamoDB Table:
CareLoopDataAmazon SNS Topic:
CareLoopAlertsTopicAmazon EventBridge: 1-minute automated tick rule calling
CareLoopTickRunnerLambda.
Open Source & MIT License
CareLoop is free and open-source software licensed under the MIT License.
Copyright (c) 2026 CareLoop Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...This server cannot be deployed
Maintenance
Related MCP Connectors
AI life manager: tasks, home, health, wealth, childcare, pets & more — on your own data.
Private cross-media memory for AI assistants: recommendations, progress and controlled actions.
Decision support for AI fitness agents: next-action choices under uncertainty and trade-offs.
N-of-1 health experiments in your AI assistant: Oura/RescueTime data, protocols, workouts.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables agentic voice assistants to run daily check-ins for someone living alone, capturing wellbeing, medication, and appointments, while keeping family informed via summaries and escalating when needed.MIT
- AlicenseNot gradedqualityBmaintenanceEnables an Alexa+ assistant to answer home-care questions while keeping protected values off the spoken channel, delivering sensitive details privately to the asker's own device via an out-of-band inbox.MIT
- AlicenseNot gradedqualityBmaintenanceEnables voice-driven morning check-ins for older adults living alone through Alexa+, capturing sleep, mood and pain, logging medication doses and appointments, and answering medication questions from official FDA labels. Keeps family members informed with household status updates and automatic alerts when a check-in or dose is missed.5 npmMIT
- AlicenseNot gradedqualityBmaintenanceA self-hosted MCP server that lets Alexa+ help care for an older family member — medicines, health readings, family messages, errands and scam calls — with every tool call screened by a deterministic safety gate and a Cedar policy. It applies zones, tripwire lockdowns, scam watches and approval-fatigue limits so money actions require explicit family approval.MIT