loading…
Search for a command to run...
loading…
Enables dynamic UI template generation through natural language using Model Context Protocol, supporting multiple AI model providers like Bedrock, OpenAI, and G
Enables dynamic UI template generation through natural language using Model Context Protocol, supporting multiple AI model providers like Bedrock, OpenAI, and Google.
A comprehensive chatbot application that generates dynamic UI templates using Model Context Protocol (MCP). You can run this project locally with Google Gemini, OpenAI, or Groq models, or deploy it with Amazon Bedrock for enterprise-grade infrastructure.
MODEL_PROVIDER environment variable.MODEL_PROVIDER=google, MODEL_PROVIDER=openai, or MODEL_PROVIDER=groq in your .env.localgit clone <repository-url>
cd Generative-UI-chat
npm install
.env.example to .env.localMODEL_PROVIDER to google, openai, or groqMODEL_PROVIDER=bedrock and configure AWS credentials as beforenpm run dev
| Provider | Required Variables |
|---|---|
GOOGLE_API_KEY, GOOGLE_MODEL_ID |
|
| OpenAI | OPENAI_API_KEY, OPENAI_MODEL_ID |
| Groq | GROQ_API_KEY, GROQ_MODEL_ID |
| Bedrock | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, BEDROCK_MODEL_ID |
A comprehensive chatbot application that generates dynamic UI templates using Model Context Protocol (MCP) and Claude 4 Sonnet via Amazon Bedrock. The system features a sophisticated MCP server that can generate over 20 different types of UI templates with realistic data and configurations.
Internet → CloudFront CDN → Private ALB → ECS Fargate → Amazon Bedrock
↓ ↓ ↓ ↓ ↓
Global HTTPS Load Docker Claude 4 Sonnet
Cache Termination Balancer Container API
Next.js App (localhost:3000) ←→ MCP Server (stdio)
↓
Amazon Bedrock (Claude 4 Sonnet)
Clone and Install
git clone <repository-url>
cd Generative-UI-chat
npm install
Configure AWS Credentials
Option 1: Environment Variables
cp .env.example .env.local
# Edit .env.local with your AWS credentials
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_REGION=us-east-1
Option 2: AWS Credential Provider Chain (Recommended)
# Configure AWS CLI
aws configure
# Or use IAM roles (EC2, ECS, Lambda)
# Or use AWS profiles
export AWS_PROFILE=your-profile
Start Development
# Terminal 1: Start MCP server
cd mcp-ui-server
npm run build
npm start
# Terminal 2: Start Next.js app
npm run dev
Open Application
# Test Docker build (no sudo required)
./test-docker.sh
# Run with Docker Compose
docker-compose up
# Verify deployment readiness
./verify-deployment-ready.sh
Deploy to AWS with enterprise-grade infrastructure:
# Deploy to AWS
cd cdk
./deploy.sh
# Monitor deployment
aws logs tail /ecs/generative-ui-chat-dev --follow
Infrastructure Includes:
Estimated Cost: ~$110/month for production workload
# Set custom domain variables
export DOMAIN_NAME=your-domain.com
export CERTIFICATE_ARN=arn:aws:acm:us-east-1:...:certificate/...
export ENVIRONMENT=prod
# Deploy with custom domain
cd cdk && ./deploy.sh
# Deploy to staging
export ENVIRONMENT=staging
cd cdk && ./deploy.sh
# Deploy to production
export ENVIRONMENT=prod
cd cdk && ./deploy.sh
"Create a dashboard for a fitness app"
"Generate a product catalog for an online bookstore"
"Build a form for user registration"
"Create a dark-themed analytics dashboard for a SaaS company with revenue charts and user metrics"
"Generate a marketplace interface for handmade crafts with filtering and categories"
"Build a kanban board for project management with different priority levels"
"Make the dashboard full-screen with a blue color scheme"
"Create a mobile-friendly pricing page for a subscription service"
"Generate a gallery with a grid layout for a photography portfolio"
| Type | Description | Example Use Case |
|---|---|---|
| dashboard | Analytics dashboard with widgets | Business metrics, KPI monitoring |
| dataTable | Sortable data table with filters | User management, inventory |
| productCatalog | Product grid with search/filter | E-commerce, marketplace |
| form | Dynamic form with validation | Registration, surveys, feedback |
| analytics | Charts and data visualization | Reports, analytics dashboards |
| calendar | Interactive calendar component | Events, scheduling, bookings |
| kanban | Task board with drag-and-drop | Project management, workflows |
| gallery | Image/media gallery with lightbox | Portfolio, media showcase |
| pricing | Pricing tables and plans | SaaS pricing, service packages |
| stats | Key metrics and statistics | Performance metrics, summaries |
| timeline | Chronological event timeline | Project history, news feed |
| feed | Social media style feed | Activity streams, updates |
| map | Interactive map with markers | Location services, directories |
| chart | Various chart types | Data visualization, reports |
| wizard | Multi-step form wizard | Onboarding, complex forms |
| profileCard | User profile display | Team pages, directories |
| blog | Blog layout with articles | Content management, news |
| portfolio | Portfolio showcase | Creative work, case studies |
| marketplace | Marketplace interface | Buying/selling platforms |
| ecommerce | E-commerce product pages | Online stores, catalogs |
# Test Bedrock connection
npm run test-bedrock
# Test Docker build (no sudo required)
./test-docker.sh
# Verify deployment readiness
./verify-deployment-ready.sh
# Deploy to AWS
cd cdk && ./deploy.sh
# Monitor AWS logs
aws logs tail /ecs/generative-ui-chat-dev --follow
# Build image
./docker-wrapper.sh build -t generative-ui-chat .
# Run container
./docker-wrapper.sh run -d -p 3000:3000 generative-ui-chat
# Check containers
./docker-wrapper.sh ps
# View logs
./docker-wrapper.sh logs container-name
Bedrock API Errors
aws sts get-caller-identityDocker Issues
./docker-wrapper.sh instead of sudo docker./docker-wrapper.sh info./test-docker.shCDK Deployment Issues
npx cdk bootstrapcdk/TROUBLESHOOTING.mdMCP Server Not Starting
cd mcp-ui-server && npm run buildTemplate Not Rendering
components/templates/dynamic-template.tsx# Check application health
curl http://localhost:3000/api/health
# Check AWS deployment health
curl https://your-cloudfront-domain/api/health
# Monitor ECS service
aws ecs describe-services --cluster generative-ui-chat-dev --services generative-ui-chat-dev
/ecs/generative-ui-chat-{env}# Monitor application logs
aws logs tail /ecs/generative-ui-chat-dev --follow
# Check ECS service status
aws ecs describe-services --cluster generative-ui-chat-dev --services generative-ui-chat-dev
# View CloudFormation stack
aws cloudformation describe-stacks --stack-name GenerativeUiChat-dev
# Update code and redeploy
git pull origin main
cd cdk && ./deploy.sh # Rebuilds Docker image and updates ECS
# Preview changes
cd cdk && npx cdk diff
# Apply infrastructure changes
cd cdk && npx cdk deploy --all
Edit cdk/lib/generative-ui-chat-stack.ts:
// Adjust auto-scaling parameters
scalableTarget.scaleOnCpuUtilization('CpuScaling', {
targetUtilizationPercent: 60, // Lower for more responsive scaling
});
| Component | Cost | Description |
|---|---|---|
| ECS Fargate | ~$35 | 2 tasks × 1vCPU × 2GB RAM |
| Application Load Balancer | ~$20 | Private ALB with health checks |
| NAT Gateway | ~$45 | Single NAT for cost optimization |
| CloudFront | ~$5 | Pay-per-use (low traffic estimate) |
| CloudWatch Logs | ~$5 | 1-week retention |
| Amazon Bedrock | Variable | Pay-per-token usage |
| Total Infrastructure | ~$110/month | Base infrastructure cost |
The system consists of two main components:
MCP Server (mcp-ui-server/): A TypeScript server implementing Model Context Protocol to generate UI template configurations with realistic data
Next.js Chatbot (/): A React application with Amazon Bedrock integration providing conversational interface for template generation
The chatbot uses Claude 4 Sonnet via Amazon Bedrock to understand user requests and translate them into MCP tool calls, generating rich UI templates rendered as React components.
This project is for educational and development purposes.
Your Generative UI Chatbot is now equipped with:
✅ Enterprise-grade AWS infrastructure
✅ Production-ready containerization
✅ Automated deployment process
✅ Comprehensive documentation
✅ Security best practices
✅ Cost-optimized architecture
✅ Auto-scaling capabilities
✅ Monitoring and observability
Deploy now: cd cdk && ./deploy.sh 🚀
Run in your terminal:
claude mcp add ag-ui-chatbot-mcp-server -- npx Security
Low riskAutomated heuristic from public metadata — not a security guarantee.