Sam89Jha/AI-Agent-MCP
If you are the rightful owner of AI-Agent-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
NavieTakie Simulation is an AI-driven chat and voice assistant demo that simulates communication between drivers and passengers in a Grab-style system.
NavieTakie Simulation
An AI-driven chat and voice assistant demo simulating a Grab-style driver (DAX) and passenger (PAX) communication system.
ποΈ Architecture
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β DAX App β β PAX App β β Bedrock Agent β
β (Driver UI) β β (Passenger UI) β β (Central AI) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β
βββββββββββββββββββ
β MCP Server β
β (API Gateway) β
βββββββββββββββββββ
β
βββββββββββββββββββ
β Lambda Functionsβ
β (Backend APIs) β
βββββββββββββββββββ
β
βββββββββββββββββββ
β DynamoDB β
β (Storage) β
βββββββββββββββββββ
π Features
- Voice & Text Chat: Real-time communication between drivers and passengers
- AI-Powered Assistant: AWS Bedrock Agent for intelligent conversation handling
- Mobile-First Design: Responsive React applications optimized for mobile devices
- Serverless Backend: AWS Lambda functions for scalable API endpoints
- Real-time Updates: WebSocket-like polling for instant message delivery
- Cost Optimized: Estimated ~$10.47/month for full production deployment
π Project Structure
NavieTakieSimulation/
βββ terraform/ # Infrastructure as Code
β βββ main.tf # Main Terraform configuration
β βββ variables.tf # Variable definitions
β βββ outputs.tf # Output values
β βββ user_data.sh # EC2 initialization script
βββ lambda-functions/ # AWS Lambda Functions
β βββ send_message.py # Send message handler
β βββ make_call.py # Call initiation handler
β βββ get_message.py # Message retrieval handler
β βββ requirements.txt # Python dependencies
βββ mcp-server/ # MCP Server (API Gateway)
β βββ app.py # FastAPI application
β βββ requirements.txt # Python dependencies
β βββ Dockerfile # Container configuration
β βββ docker-compose.yml # Local development
βββ frontend/ # React Applications
β βββ dax-app/ # Driver Assistant Experience
β β βββ src/ # React source code
β β βββ public/ # Static assets
β β βββ package.json # Dependencies
β βββ pax-app/ # Passenger Assistant Experience
β βββ src/ # React source code
β βββ public/ # Static assets
β βββ package.json # Dependencies
βββ bedrock-agent/ # AWS Bedrock Agent Configuration
β βββ agent-config.json # Agent configuration
β βββ agent-deployment.yaml # CloudFormation template
βββ staging/ # Local Development & Testing
β βββ docker-compose.yml # Complete staging environment
β βββ test_runner.py # Comprehensive test suite
β βββ requirements.txt # Testing dependencies
βββ scripts/ # Deployment Scripts
β βββ deploy.sh # Automated deployment script
βββ README.md # This file
π οΈ Prerequisites
Before deploying, ensure you have the following installed:
- AWS CLI (v2.x)
- Terraform (v1.x)
- Docker (v20.x)
- Node.js (v18.x)
- Python (v3.9+)
- jq (for JSON parsing)
π Quick Start
1. Clone and Setup
git clone <repository-url>
cd NavieTakieSimulation
2. Configure AWS
aws configure
# Enter your AWS Access Key ID, Secret Access Key, and region
3. Deploy Everything
chmod +x scripts/deploy.sh
./scripts/deploy.sh
The deployment script will:
- β Check prerequisites
- ποΈ Build frontend applications
- βοΈ Deploy AWS infrastructure
- π§ Deploy Lambda functions
- π₯οΈ Deploy MCP Server to EC2
- π Deploy frontend apps to S3
- π Run health checks
- π Display deployment summary
π§ͺ Local Development
Staging Environment
cd staging
docker-compose up -d
This starts:
- MCP Server on
http://localhost:8000
- DynamoDB Local on
http://localhost:8001
- DAX App on
http://localhost:3000
- PAX App on
http://localhost:3001
Individual Components
MCP Server
cd mcp-server
pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port 8000
Frontend Apps
# DAX App
cd frontend/dax-app
npm install
npm start
# PAX App
cd frontend/pax-app
npm install
npm start
π§ͺ Testing
Run Complete Test Suite
cd staging
python test_runner.py
Individual Tests
# Test MCP Server
curl http://localhost:8000/health
# Test Lambda Functions
aws lambda invoke --function-name send-message --payload '{"booking_code":"TEST","message":"Hello","sender":"driver"}' response.json
# Test Frontend Apps
curl http://localhost:3000
curl http://localhost:3001
π Production URLs
After deployment, your applications will be available at:
- DAX (Driver):
https://dax.sameer-jha.com
- PAX (Passenger):
https://pax.sameer-jha.com
- MCP Server:
https://mcp.sameer-jha.com
π° Cost Breakdown
Service | Monthly Cost | Description |
---|---|---|
EC2 (t3.micro) | ~$8.47 | MCP Server hosting |
Lambda | ~$0.50 | API functions |
DynamoDB | ~$1.00 | Message storage |
S3 + CloudFront | ~$0.50 | Static hosting |
Total | ~$10.47 | Full production |
π§ Configuration
Environment Variables
# AWS Configuration
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
# Application Configuration
REACT_APP_API_URL=http://localhost:8000
DYNAMODB_TABLE=chat-messages
Domain Configuration
Update the domain in scripts/deploy.sh
:
DOMAIN="your-domain.com"
DAX_SUBDOMAIN="dax"
PAX_SUBDOMAIN="pax"
MCP_SUBDOMAIN="mcp"
π Security
- IAM Roles: Least privilege access for all services
- Security Groups: Restricted network access
- HTTPS: SSL/TLS encryption for all endpoints
- CORS: Configured for cross-origin requests
- Input Validation: All API inputs are validated
π Monitoring
CloudWatch Metrics
- Lambda function invocations and duration
- DynamoDB read/write capacity
- EC2 instance metrics
- CloudFront distribution metrics
Application Logs
- Lambda function logs in CloudWatch
- MCP Server logs in Docker containers
- Frontend application logs in browser console
π¨ Troubleshooting
Common Issues
-
EC2 Instance Not Starting
aws ec2 describe-instances --instance-ids <instance-id>
-
Lambda Function Errors
aws logs describe-log-groups --log-group-name-prefix /aws/lambda/
-
Frontend Build Failures
cd frontend/dax-app npm install --force npm run build
-
MCP Server Connection Issues
ssh -i key.pem ubuntu@<ec2-ip> docker logs mcp-server
Health Checks
# Test MCP Server
curl -f http://localhost:8000/health
# Test Lambda Functions
aws lambda invoke --function-name send-message --payload '{"test":"data"}' response.json
# Test Frontend Apps
curl -f http://localhost:3000
π€ Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Support
For support and questions:
- Create an issue in the repository
- Check the troubleshooting section
- Review the logs and metrics
π― Roadmap
- WebSocket support for real-time messaging
- Push notifications
- Multi-language support
- Advanced AI features
- Analytics dashboard
- Mobile apps (React Native)
Built with β€οΈ using AWS, React, and Python