FlowGuard MCP Server
Integrates with AWS Bedrock Runtime for AI-powered interruption arbitration using Claude 3.5 / Haiku / Nova models, and with Amazon Alexa for spoken responses through the Alexa+ channel.
Integrates with simulated Ring Doorbell and Ring Chime hardware to execute deflections, transmit outdoor speaker audio, and mute the indoor chime during focus sessions.
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., "@FlowGuard MCP ServerStart a 45-minute deep work session on the Q3 report"
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.
FlowGuard: Alexa+ Deep-Work Interruption Arbitration Agent
Amazon Developer Hackathon Submission
An intelligent deep-work interruption arbitration agent powered by AWS Bedrock, self-hosted Model Context Protocol (MCP) specification 2025-11-25 over Streamable HTTP (SSE), deterministic application-level policy boundaries, and a desktop-first command center interface.
Architecture Overview
flowchart TD
UserUI["FlowGuard Web Console\n(Desktop-First Studio)"] -->|REST Adapter /api/*| Adapter["MCP Client Adapter\n(InMemoryTransport)"]
ExternalMCP["External MCP Clients\n(Claude Desktop / Cursor)"] -->|SSE /sse & POST /messages| Server["FlowGuard MCP Server\n(Spec 2025-11-25)"]
Adapter --> Server
subgraph FlowGuard Core
Server --> State["Focus State Manager\n(Active Objective, Policies, Reminders)"]
Server --> Dedup["Deduplication & Idempotency\n(Sliding TTL Cache)"]
Server --> Bedrock["AWS Bedrock Runtime\n(Claude 3.5 / Haiku / Nova)\n+ Deterministic Fallback"]
Server --> Privacy["Privacy Guardrail Engine\n(Context Leakage Prevention)"]
Server --> Policy["Deterministic Policy Engine\n(Authorization & Boundaries)"]
end
Policy -->|execute_deflection| Hardware["Hardware Execution Layer"]
Hardware --> RingSpeaker["Simulated Ring Doorbell\n(Outdoor Speaker Audio)"]
Hardware --> RingChime["Simulated Ring Chime\n(Indoor Chime Muted)"]
Hardware --> SilentDigest["Silent Notification Queue\n(Post-Focus Debrief Digest)"]Related MCP server: deepworktimer-mcp
Key Product Workspaces & Interface Panes
Focus Workspace:
Live session countdown timer with scheduled completion time.
Objective setter, duration selector (25m, 45m, 60m, 90m).
Interruption tolerance levels (
emergency_only,urgent_only,allow_family,lenient).Permitted deflection channels (
ring_quick_reply,silent_queue,alexa_spoken_response,emergency_breakthrough).Safe preauthorizations: Auto-Deflect Deliveries & Privacy Guardrail mode toggles.
Start, Update, and End Focus controls.
Live Interruption Center:
Real-world household triggers:
📦 Amazon Delivery: Courier dropping two parcels on the front porch.
🚨 Kitchen Smoke Alarm: Critical emergency with continuous siren.
🗣️ Solar Sales Solicitor: Unsolicited door-to-door pitch.
👨👩👧 Family Member Knock: Spouse asking a question at the door.
🕵️ Inquisitive Stranger: Probing questions attempting to extract the resident's work details.
Custom event builder (device source, category, visitor name, transcription, urgency signals).
Real-time device listening and processing states.
AI Arbitration Panel:
Side-by-side contrast between Bedrock AI Recommendation vs Deterministic Application Policy Decision.
Urgency score gauge (
1to10) with color-coded severity.Spoken outdoor response preview (what will be transmitted over the Ring doorbell speaker).
Privacy audit result badge (
ZERO LEAKAGEvsSANITIZED BY GUARD).Interactive Approval Controls: "Grant Approval & Execute" vs "Deny / Hold in Silent Queue".
Execution Timeline & Hardware State:
Hardware status indicators: Ring outdoor speaker transmission status & Ring indoor chime mute state (
MUTED (Flow Protected)vsACTIVE).Reverse-chronological audit stream recording every arbitration, execution, privacy redaction, and duplicate suppression.
Post-Focus Queue & Debrief:
Silent notification digest of events deferred during deep work.
Individual item review & acknowledgment actions.
Zero-interruption guarantee: Resident is never pulled out of flow for non-emergencies.
MCP Tools Reference
FlowGuard exposes 4 core tools on the MCP server:
Tool Name | Purpose | Key Inputs |
| Establish active focus session, duration, and filtering rules |
|
| Evaluates structured interruption event against active policy via Bedrock |
|
| Deterministically validates action, checks approval, executes simulated hardware |
|
| Retrieves active session state, pending silent reminders, and audit history | None |
UI Controls to Backend Functions Mapping
UI Interactive Control | Endpoint / Transport | Underlying MCP Tool / Backend Function |
"Activate Deep Work" / "Update Policy" |
|
|
"End Focus" |
|
|
"Amazon Delivery" / Presets |
|
|
"Dispatch Custom Event" |
|
|
"Execute Deflection via MCP Tool" |
|
|
"Grant Approval & Execute" |
|
|
"Deny / Hold in Silent Queue" |
|
|
"Ack" (Acknowledge Reminder) |
|
|
"Demo 1: Delivery Deflection" |
| Runs end-to-end delivery deflection & duplicate prevention sequence |
"Demo 2: Policy Denial" |
| Runs approval denied & policy enforcement sequence |
"Demo 3: Privacy Shield" |
| Runs privacy leakage probe & redaction sequence |
"Reset" |
|
|
Quickstart & Local Execution
1. Installation
npm install2. Configuration
Copy .env.example to .env:
cp .env.example .env(Optional: Provide AWS credentials in .env for live Bedrock invocation. If omitted, FlowGuard automatically uses its built-in deterministic local arbitrator).
3. Build & Run
# Build both TypeScript backend and React UI
npm run build
# Start the unified server on port 3000
npm startVisit the interactive web console at http://127.0.0.1:3000.
4. Run Automated Test Suite
npm testResults: 29 passed across 6 test suites (100% passing):
test/policyEngine.test.ts(5 tests)test/privacyGuard.test.ts(5 tests)test/deduplication.test.ts(2 tests)test/bedrockArbitrator.test.ts(3 tests)test/mcpProtocol.test.ts(6 protocol-level tests over live SSE)test/apiAdapter.test.ts(8 REST adapter & scenario tests)
5. Run CLI Protocol Demo
npm run demoTimed Three-Minute Demonstration Script
[0:00 - 0:30] — Introduction & Focus Setup
Open
http://127.0.0.1:3000. Point out the header pills:System Spec: MCP Server 2025-11-25.
Reasoning Mode: AWS Bedrock (Deterministic Fallback Mode) or Live Bedrock.
Hardware: Simulated Ring & Alexa (clearly disclosed).
In the Focus Workspace, set the objective to "Executive Board Financial Modeling & Strategy", duration to 45 minutes, tolerance to Urgent Only, and ensure Auto-Deflect Deliveries and Privacy Guardrail are enabled.
Click "Activate Deep Work". The timer starts countdown (
45:00) and the indoor chime is muted.
[0:30 - 1:15] — Simulated Delivery Deflection (Happy Path)
In the Live Interruption Center, click "Amazon Delivery" (or click the top bar "Demo 1: Delivery Deflection" button).
Highlight the AI Arbitration Panel:
Urgency score: 2/10 (Low).
Bedrock recommendation:
DEFLECT_RING_PRESET.Spoken audio preview: "Please leave the package by the door. Thank you!".
Policy boundary: Pre-authorized by auto-deflection policy.
Click "Execute Deflection via MCP Tool".
Check the Execution Timeline:
Status:
EXECUTED.Simulated Ring outdoor speaker audio transmitted.
Ring indoor chime remains muted (resident was never interrupted).
Notification held in Post-Focus Queue.
[1:15 - 1:50] — Deduplication & Idempotency Demonstration
Re-click the exact same "Amazon Delivery" button (simulating a courier pressing the doorbell a second time 10 seconds later).
Click "Execute Deflection".
Highlight the outcome in the Execution Timeline:
Status:
DUPLICATE_IGNORED.Explanation: "Duplicate event already executed. Redundant execution prevented."
Shows that repeat rings never play audio twice or create redundant notifications.
[1:50 - 2:30] — Policy Denial & Approval Boundary (Demo 2)
Click "Demo 2: Policy Denial" in the top bar (or select Strict Emergency Only and trigger a visitor asking for a ladder).
Point out the AI Arbitration Panel:
The LLM proposed an action, but the policy engine flagged:
EXPLICIT APPROVAL REQUIRED.Notice that the outdoor speaker is not transmitted automatically.
Demonstrate the interactive control: User can click "Grant Approval" or "Deny / Hold in Silent Queue".
Explain: "Application code deterministically prevents the LLM from inventing authorizations."
[2:30 - 3:00] — Privacy Shield & Post-Focus Debrief (Demo 3)
Click "Demo 3: Privacy Shield". An inquisitive stranger rings asking what project the resident is working on.
An unsafe proposal attempting to disclose "Executive Board Financial Modeling" is evaluated.
Highlight the Privacy Audit badge:
SANITIZED BY GUARD.The sensitive objective was redacted.
Replaced with: "The resident is currently unavailable. Please leave a message or reach out by phone."
Click "End Focus" in the Focus Workspace.
Review the Post-Focus Queue: All deferred deliveries and visitor summaries are listed cleanly. Click "Ack" to acknowledge each item.
Conclude: FlowGuard protected 45 minutes of deep work without missing a single package or compromising privacy.
AWS Bedrock Verification Status
Integration Code: Fully implemented using
@aws-sdk/client-bedrock-runtime(ConverseCommand).Environment Status: When valid AWS credentials (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY) are present in.env, FlowGuard calls the configured Bedrock model (anthropic.claude-3-haiku-20240307-v1:0oranthropic.claude-3-5-sonnet-20241022-v2:0).Honest Verification Disclosure: The local environment does not currently have active AWS credentials configured. FlowGuard honestly discloses this in both the UI status pill and structured logs:
AWS Bedrock (Deterministic Fallback Mode). It does not falsely claim live Bedrock execution was tested when credentials were not provided. Supplying credentials immediately activates live Bedrock without code modifications.
Blockers and Outstanding Items
None: All 6 phases, automated tests, full builds, MCP protocol endpoints, and interactive UI features are verified and operational.
License
This project is licensed under the MIT License.
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP memory and agent control plane for durable conversations, jobs, and operations.
Build and manage AI-native customer support agents from Claude or any MCP client.
Read and write shared BitsWeave context, projects, tasks, and work sessions through MCP.
Tenant-scoped evidence intake and controlled AI context over MCP.
Related MCP Servers
- AlicenseCqualityBmaintenanceProvides a human-agent interface control plane for managing agent state, focus, and next steps across any MCP-compatible client, without calling an LLM itself.23MIT
- AlicenseBqualityCmaintenanceEnables AI agents to start and log pomodoro and deep work sessions, manage tasks, and query a permanent per-skill ledger of focus hours via MCP.14MIT
- FlicenseNot gradedqualityBmaintenanceEnables multi-timezone calendar event overlap resolution and deep-work buffer negotiation. It provides deterministic conflict arbitration and structured telemetry for MCP-compatible clients.8-
- AlicenseAqualityBmaintenanceEnables lifecycle management of Devin ACP sessions as subagents over MCP, supporting parallel dispatch, blocking coordination, mid-flight steering, permission adjudication, and crash-resilient session persistence.124 npmMIT