Practical implementations of AG-UI, A2UI, json-render, MCP Apps, and Open Generative UI protocols using Amazon Bedrock for inference.
ag-ui-sample/)a2ui-sample/)json-render-sample/)mcp-apps-sample/)open-generative-ui-sample/)Create .env file in the root directory:
# AWS Credentials
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_REGION=us-east-1
# Bedrock Model
BEDROCK_MODEL=global.anthropic.claude-sonnet-4-6
# Optional: Specific endpoint
# AWS_ENDPOINT_URL=https://bedrock-runtime.us-east-1.amazonaws.com
# Build and start all containers
docker-compose up --build
# Run in background
docker-compose up -d --build
# AG-UI only
docker-compose up ag-ui-sample
# A2UI only
docker-compose up a2ui-sample
# MCP Apps only
docker-compose up mcp-apps-sample
Controlled Generative UI - Pre-built components with type-safe data binding and client-side state control.
Features:
useCopilotReadableuseCopilotActionHow it works:
toggle_sidebar({ open: false })change_theme({ theme: "dark" })Try it:
"Show me the weather in San Francisco"
"Close the sidebar"
"Change theme to dark and increment counter"
"Add notification: Meeting at 3pm"
"Switch to settings panel"
"What's the current counter value?"
"If sidebar is closed, open it"
Declarative Generative UI - Agent generates JSON structure, frontend renders.
Features:
How it works:
surfaceUpdate, dataModelUpdate, beginRenderingTry it:
"Create a contact form with name, email, and message"
"Build a user profile card for Sarah"
"Generate a survey with 5 questions"
Open-ended Generative UI - Full HTML/JS applications.
Features:
How it works:
create_chart)Connect from VS Code:
{
"mcpServers": {
"agent-ui-samples": {
"url": "http://localhost:3003/mcp"
}
}
}
Try it:
"Create a bar chart of quarterly sales"
"Show me a data table with user information"
"Visualize this data: [1,2,3,4,5]"
Open-ended Generative UI - Agent generates raw HTML/SVG/Canvas visualizations rendered in sandboxed iframes.
Features:
How it works:
widgetRenderer tool with generated HTMLuseComponent hook renders HTML in a sandboxed iframeTry it:
"Show me the weather in Tokyo"
"Show my bank account summary"
"Visualize binary search algorithm"
"Create a pie chart of monthly spending"
"Show a 3D rotating cube"
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Sample 1: AG-UI (CopilotKit + Strands) โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ Next.js UI โ โโโโโโโบ โ Strands Agent โ โ
โ โ CopilotKit โ โ + Bedrock โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ Port 3001 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Sample 2: A2UI (Svelte + Strands) โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ Svelte UI โ โโโโโโโบ โ Strands Agent โ โ
โ โ A2UI Rendererโ โ + Bedrock โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ Port 3002 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Sample 3: json-render (React + Strands) โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ React UI โ โโโโโโโบ โ Strands Agent โ โ
โ โ json-render โ โ + Bedrock โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ Port 3005 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Sample 4: MCP Apps (Server Only) โ
โ โโโโโโโโโโโโโโโโ โ
โ โ MCP Server โ โโโโโโ Your Client โ
โ โ + Bedrock โ (VS Code/Claude) โ
โ โโโโโโโโโโโโโโโโ โ
โ Port 3003 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Sample 5: Open Generative UI (CopilotKit v2) โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ Next.js UI โ โโโโโโโบ โ Strands Agent โ โ
โ โ CopilotKit v2โ โ + Bedrock โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ Port 3004 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
cd ag-ui-sample
npm install
npm run dev
cd a2ui-sample/frontend
npm install
npm run dev
cd mcp-apps-sample
pip install -r requirements.txt
python server.py
Error: AccessDeniedException when calling Bedrock
Solution:
bedrock:InvokeModelError: Build context issues
Solution:
# Clean and rebuild
docker-compose down -v
docker-compose build --no-cache
docker-compose up
Error: Port 3001/3002/3003 already bound
Solution:
# Change ports in docker-compose.yml
# Or kill existing process
lsof -ti:3001 | xargs kill -9
Error: Cannot connect to MCP server
Solution:
curl http://localhost:3003/mcpContributions welcome! Each sample is self-contained:
MIT License - see LICENSE file for details
Live Presentation: https://eponalab.github.io/agent-ui-protocols/deck-v3.html
Repository: https://github.com/EponaLab/agent-ui-protocols