-
-
Once Upon Tonight: an Alexa+ add-on that turns a child's day into tonight's bedtime story
-
The storybook reads itself aloud and lights up each word. Pip, the Pillow Fort and Moonberry Hill carry over from earlier stories
-
Maya chooses what happens next by voice: "Build a pretend pool!" calls choose_path and the story branches
-
Next morning the parent asks how bedtime went and gets a real recap of what was heard, chosen and learned
-
The MCP tool answers in milliseconds while the story is written, checked, painted and narrated on AWS
-
Architecture: MCP server, Alexa+ account linking, Bedrock, Guardrails, SD3.5, Rekognition and Polly
-
Countertop, the open-source Alexa+ style simulator I built: 17 of 17 readiness checks pass
-
Every book on the shelf was written for someone else. Tonight's story is written for her
Try it yourself
Open https://d3eqnu2zudrdt1.cloudfront.net in Chrome or Edge on a computer. It's a hosted copy of Countertop, my open-source Alexa+ style simulator, already pointed at the live add-on.
- Press Link add-on at the top. This is the same account linking Alexa+ does: a consent page for the add-on opens (as a popup, or in the same tab).
- The demo family's login is already filled in ([email protected] / bedtime, a made-up test account). Press Allow. Back in Countertop, the status turns green: "Linked · Once Upon Tonight · 11 tools".
- Type in the box under the Echo Show, or hold Space and talk (allow the microphone). Try "Make tonight's story about her first swimming lesson", then "Read my bedtime story". When the story asks Maya to choose, say an option or tap it. Then ask "How did bedtime go last night?"
The hosted copy runs in demo mode. Maya's stories are pre-made, so they replay instantly. Ask for a story about a new child ("Make tonight's story for Zara, she's six. She made a new friend at the park today") and it's made live with the real models in about two minutes, with character voices. Live stories share a small daily quota to keep costs down; after that, Alexa offers Maya's story.
Inspiration
Kids bring their whole day to bed. A wobbly tooth, a first swimming lesson, being nervous about the dentist tomorrow. Bedtime is when that stuff comes out, and a picture book is one of the best ways a parent has to talk about it. The problem is that no book on the shelf is about their day, and by 7:30 most parents are too tired to make one up. I wanted Alexa to do that part.
What it does
Once Upon Tonight is an Alexa+ add-on, built as an MCP server. At dinner, a parent says something like:
"Alexa, make a short story for tonight. Maya had her first swimming lesson today. She was scared to put her face in the water, but she did it! Lesson two is tomorrow."
A few minutes later (about three in the demo) there is a new picture book waiting on the Echo Show:
- It stars Maya and her sidekick Pip, a small blue dragon, and it's written at her reading level.
- Every page has an illustration, and every illustration is checked by Amazon Rekognition before it's shown.
- The book reads itself aloud and highlights each word as it's spoken. Characters speak in their own voices: Maya sounds like a little girl, Pip like a small boy, and the narrator reads the rest.
- Halfway through, the story asks Maya to choose what happens next. She can say it ("build a pretend pool!") or tap it.
- There's a word of the night ("luminous") she can tap or ask about.
- The last page slows down, says goodnight, and the screen dims.
- The story world carries over. Tonight's story happens in the Pillow Fort and on Moonberry Hill, places from earlier episodes, and Maya uses the same slow brave breath she practised the night before the dentist.
The next morning the parent asks how bedtime went and gets a real answer: "Maya listened all the way through 'The Brave Bubble Dive' and chose to build a pretend pool with Pip. She even asked what 'luminous' meant." They can add people to the story world ("add Grandma Rose to Maya's stories"), add a brother or sister just by asking for their first story, set topics to never mention, or delete everything by voice, with a confirmation.
On a speaker with no screen, the same tools read the story out loud and ask "Shall I keep going?" between pages.
How I built it
The MCP server (TypeScript, MCP SDK v2) follows spec 2025-11-25 over Streamable HTTP and is stateless. It has 11 tools: create_tonights_story, check_story_progress, open_storybook, turn_page, choose_path, explain_word, story_library, bedtime_recap, update_story_world, forget_story_world, plus log_reading_progress, which only the storybook UI calls. Tool calls take 2 to 14 ms on the AWS host, well inside the 500 ms Alexa+ allows. Each result has spoken text in content, facts in structuredContent for Alexa to reason over, and the screen payload in _meta.
The storybook is an MCP App: one self-contained ui:// bundle with a content-hashed URI and declared CSP domains. It handles the story studio, the book, the choice, the library and the recap. It doesn't assume the host can proxy tool calls or autoplay audio, so it still works if those are missing.
Account linking is built to the Alexa+ requirements: OAuth 2.1 authorization code with PKCE S256 and the RFC 8707 resource parameter, Protected Resource Metadata at the root /.well-known path, Authorization Server Metadata, refresh token rotation, and the bare 401 (no WWW-Authenticate) that Alexa+ expects. There's also an addon.json manifest template.
The story pipeline runs in the background so the tool can answer right away:
- Bedrock Guardrails and a short bedtime review by Claude Haiku on Bedrock check the parent's request.
- Claude Sonnet 4.6 on Bedrock writes a branching story as structured JSON (a forced tool call), using the child's story world.
- Every page goes through the same two checks again. If a page fails, it gets rewritten more gently, with the reason passed along.
- Stability SD3.5 Large on Bedrock paints each page. Characters are described by how they look, never by name, which is what keeps Pip looking like Pip. Rekognition checks each picture; a flagged one is repainted.
- Amazon Polly narrates each page and returns word timings for the read-along, in parallel with the painting. Quotes are found in each page and Claude Haiku says who speaks them, so each character gets their own voice; the lines are joined and the word timings shifted to match.
- The episode is saved back into the story world for next time.
Each story records what it cost at list prices. The demo story came to about $0.59, mostly the pictures. Live generation is capped per family per day.
Countertop. The Alexa+ add-on console, CLI and simulator are partner-only, so I couldn't test there. I built Countertop, an open-source stand-in: push-to-talk in, Polly voices out, Claude on Bedrock playing the Alexa+ brain and picking tools from tools/list, a real MCP Apps host with a separate-origin sandbox and CSP headers, Alexa-style account linking, a JSON-RPC inspector with timings, and a readiness report against the published requirements. Once Upon Tonight passes all 17 checks. That's my own self-check, not Amazon certification.
Safety, measured. Early on, a Guardrails denied-topic filter blocked one of my own demo stories, a gentle one about being brave. So I built a labeled test set: 120 cases across bedtime themes plus red-team prompts, and a separate 64-case held-out set. Denied topics wrongly blocked 15% of the gentle stories, because comforting a fear looks a lot like a frightening topic. The version I shipped uses Guardrails content filters and prompt-attack detection plus the Haiku review, and it gets 184 out of 184. The eval is in the repo under eval/safety.
Hosting. The server also runs on AWS (EC2 t4g.nano behind CloudFront, managed with Systems Manager), with a hosted copy of Countertop next to it so anyone can try it. That copy runs in demo mode: anyone can link the demo family, Maya's stories replay a bundled story, and a child a visitor adds gets a real story within a small shared quota.
Challenges I ran into
- I couldn't use the official Alexa+ add-on tools, so I had to build a simulator first and test against the written requirements.
- The image model kept treating "Pip" as a second child. Describing characters only by appearance fixed it.
- Guardrails denied topics couldn't tell comforting a fear from causing one. I had to measure that before I believed it, then redesign the safety layer.
- Alexa+ wants an answer in under 500 ms and a story takes minutes, so creation is asynchronous and the storybook shows a progress studio while it works.
- Polly's word timings are UTF-8 byte offsets, so curly quotes threw off the highlighting until I mapped them to characters.
Accomplishments that I'm proud of
- A working Alexa+ style add-on with full account linking, deployed on AWS, answering in milliseconds.
- Read-along narration that makes a generated story feel like a real picture book.
- A safety layer with numbers behind it, including a held-out set.
- Countertop, which other Alexa+ builders can use today.
What I learned
- MCP plus MCP Apps is a practical way to build for voice and screen at once.
- When you don't know what the host supports, send the UI everything it needs and let it degrade.
- Test safety with labeled examples. My guess about which guardrail setup was safer turned out to be wrong.
What's next
- Deploy to Alexa+ as soon as add-on access opens up.
- Households with more than one child, and bilingual stories.
- A family subscription, and a printed keepsake book of a child's story world at the end of the month.
About the demo video
Every app screen in the video is the real software running live: Countertop talking to the Once Upon Tonight server on my laptop, with live calls to Bedrock, Rekognition and Polly. It was recorded with a scripted session (the parent and child lines are typed and spoken by Polly voices), then edited in Remotion with the original audio synced back in. The roughly three minutes of story generation are sped up and labeled. Two of Alexa's short replies ("Here's tonight's story!" and "Great choice!") came late in the take because of model latency, so the edit places them where Alexa says them. The title, architecture and closing cards are motion graphics.
Built With
- alexa-plus
- amazon-bedrock
- amazon-bedrock-guardrails
- amazon-cloudfront
- amazon-ec2
- amazon-polly
- amazon-rekognition
- aws-systems-manager
- claude
- express.js
- mcp-apps
- model-context-protocol
- node.js
- oauth
- puppeteer
- remotion
- stability-ai
- typescript
- vite
Log in or sign up for Devpost to join the conversation.