Skip to main content
Glama

๐ŸŒธ MA: The Voice Companion for New Mothers

License: MIT Python: 3.11+ MCP: Streamable HTTP AWS: Bedrock Tests: Passing

"The ambient voice companion that cares for the mother, not just the baby."
Built for the Amazon Developer Hackathon (Alexa+ Track & AWS Builder Challenge).


๐Ÿคฑ Overview

Traditional baby trackers treat new mothers like unpaid data-entry clerks at 3:00 AM, inducing anxiety and guilt with rigid statistics ("Feeding duration below average"). MA flips the paradigm: it is an ambient, compassionate voice companion built from first principles to care for the mother's mental and emotional health.

  • Hands-Free Rhythms: Log breast feeds, bottles, and sleep naturally through Alexa+ voice commands without looking at a screen.

  • Zero Guilt & Zero Judgment: No charts that make mom feel inadequate. Every feeding choice (nursing, formula, bottle, pumping) is celebrated equally.

  • ๐ŸŒ™ Circadian Night Mode: Between 10:00 PM and 6:00 AM, responses are strictly one short, soothing sentence, and the UI eliminates all blue light ($\lambda < 500,\text{nm}$) with a warm velvet plum and rose palette.

  • ๐Ÿ›ก๏ธ Intelligent Maternal Safety Layer: Detects postpartum despair, depletion trends, and negated self-harm ("I'm not going to hurt myself, but everything feels impossible"), routing immediate support to verified Indian crisis helplines (Tele-MANAS 14416, Vandrevala Foundation +91 9999 666 555).

  • ๐Ÿค Family Teamwork: Maintains a shared Partner Task Board ("Sterilize bottles", "Take the 4am shift so mom can sleep"), empowering mothers to delegate care easily.

  • ๐ŸŽด SEP-1865 MCP Apps Cards: Pairs voice tools with interactive HTML micro-cards (ui://ma/*) for screen-enabled devices like Echo Show.


Related MCP server: Porchlight MCP Server

๐Ÿ—๏ธ Architecture

MA is built on a decoupled, open-standards architecture conforming to the Model Context Protocol (MCP) specification (2025-11-25) over Streamable HTTP.

flowchart TD
    subgraph Client ["Client & Multimodal UI"]
        UI["Web Simulator & Echo Show<br/>(:8001/ - Web Speech API)"]
        Voice["Voice Mic / Alexa+ Audio"]
    end

    subgraph AgentLayer ["Agent Reasoning Layer (:8001)"]
        API["FastAPI /chat Endpoint"]
        Bedrock["Amazon Bedrock (Converse API)<br/>Claude 3.5 Sonnet / Nova Lite"]
        Strands["Strands Agent Orchestration<br/>+ Night Mode Brevity Post-Processor"]
    end

    subgraph MCPLayer ["MCP Server (:8005/mcp)"]
        StreamHTTP["Streamable HTTP Transport (2025-11-25)<br/>POST /mcp & GET /mcp (SSE)"]
        Tools["Typed MCP Tools<br/>โ€ข log_feed โ€ข log_sleep<br/>โ€ข baby_summary โ€ข mood_checkin<br/>โ€ข trend_check โ€ข partner_tasks"]
        Safety["Safety & Helpline Layer<br/>โ€ข India 24/7 Hotlines<br/>โ€ข Negation-Aware Despair Detector"]
        Cards["SEP-1865 UI Resources (ui://)<br/>โ€ข Baby Summary Card<br/>โ€ข Mood Trend Card<br/>โ€ข Partner Tasks Card"]
    end

    subgraph Storage ["Local Storage"]
        DB[("SQLite Database<br/>server/data/ma.db")]
    end

    Voice --> UI
    UI -->|POST /chat| API
    API --> Bedrock
    Bedrock --> Strands
    Strands -->|JSON-RPC 2.0 via HTTP| StreamHTTP
    StreamHTTP --> Tools
    Tools --> Safety
    Tools --> DB
    Tools --> Cards
    Cards -.->|Embedded HTML| UI
    Safety -->|Care Response| Strands
    Strands -->|1-2 Sentence Speech| UI

๐Ÿš€ Quickstart

1. Prerequisites

  • Python 3.11+

  • Virtual environment (venv or uv)

2. Installation

git clone https://github.com/chiraghs/Ma.git
cd Ma

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt  # Or install: mcp, fastapi, uvicorn, anyio, httpx, boto3, pytest

3. Seed Database

Seed 5 days of realistic sample rhythms for baby Maya and mother Sarah:

python server/seed.py

4. Run the MCP Server

Starts the FastMCP server over Streamable HTTP on port 8005:

python server/main.py

Verified at http://127.0.0.1:8005/mcp

5. Run the Agent API & Web Simulator

In a second terminal window (with .venv activated):

uvicorn agent.api:app --host 127.0.0.1 --port 8001

6. Open the Simulator

Open your browser to:

http://localhost:8001/
  • Click the Alexa Mic or push Start Listening to talk.

  • Try voice commands like:

    • "Maya nursed for 15 minutes on the left side."

    • "How has Maya's sleep been today?"

    • "I'm feeling really exhausted and lonely today."

    • "Add a task for partner to sterilize the night bottles."

  • Toggle the ๐ŸŒ™ Night Mode switch to experience the darkened circadian zero-blue interface and 1-sentence whisper responses.


๐Ÿงช Running Tests

The test suite covers all MCP tools, Streamable HTTP protocol handshakes, maternal distress classification, negation catchers, and agent contracts:

pytest -v

Expected output:

tests/test_phase1.py ...........                                  [ 40% ]
tests/test_safety.py ...........                                  [ 81% ]
tests/test_agent.py ........                                      [ 96% ]
tests/test_streamable_http.py .                                   [100%]

======================== 27 passed in 1.42s ========================

๐Ÿ›ก๏ธ Safety & Crisis Architecture

Postpartum mental health emergencies require an exceptionally delicate balance: never diagnosing or lecturing, yet never dismissing critical warning signs.

MA implements a deterministic safety layer (server/safety.py):

  1. Negation-Aware Filtering: Accurately recognizes statements like "I'm not going to hurt myself, but I want to disappear", erring on the side of caution without being alarmist.

  2. Normal Exhaustion vs. Despair: Differentiates ordinary parental fatigue ("tired from the 3am feed") from severe hopelessness ("I'm failing my baby", "can't do this anymore").

  3. Verified Crisis Helplines: Pre-configured with active Indian emergency numbers:

    • Tele-MANAS: 14416 (24/7 National Mental Health Helpline, Government of India)

    • KIRAN: 1800-599-0019 (24/7 Mental Health Support)

    • Vandrevala Foundation: +91 9999 666 555 (24/7 Crisis Counseling)

    • AASRA: +91 98204 66726


๐ŸŽจ Zero-Blue Design Philosophy

Inspired by the maternal health aesthetic of Swasth, the interface strictly bans all blue and cyan light spectrums ($\lambda < 500,\text{nm}$) to protect infant and maternal circadian rhythms during midnight nursery interactions:

Token

Hex Code

Purpose

Maternal Rose

#FF3B69

Primary action buttons, active states, pulse glow

Soft Peach

#FFB088

Secondary warm accents, gentle tags

Warm Orchid

#C084FC

Highlights, evening calm indicators

Mint

#10B981

Positive rhythms, non-critical confirmation

Berry Obsidian

#0B050E

High-contrast night mode backdrop


๐Ÿ“„ License

This project is licensed under the MIT License.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables an older adult to talk with Alexa+ about medicines and daily routine while a caregiver sees a calm, consent-gated dashboard and push alerts only when a genuine pattern (e.g. an unusually late first activity) appears. Includes elicitation-based consent, emergency bypass, resumable SSE streams, and an inline MCP App view.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables voice-driven caregiving check-ins through Alexa+, letting family members ask how a parent living alone is doing, trigger a check-in, or acknowledge they are handling an alert, while the parent can confirm "I'm OK" by voice. Status tools also render an MCP Apps card for at-a-glance display.
    363 npm
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables consented, daily Alexa check-ins that score speech and memory answers against a personal baseline, flag sustained drift to family, produce clinician summaries, and export de-identified data for research. It also provides MCP tools, resources, prompts, and MCP Apps views for compatible agent hosts.
    3 npm
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables a simulated Alexa+ care companion to capture daily check-ins, recall longitudinal care-journal history, assess risk, create local family-inbox cards, schedule follow-ups, and produce weekly digests through MCP tools.
    MIT