A powerful full-stack chat application with MCP (Model Context Protocol) integration for Google Calendar, Tasks, and Notes. Built with React + TypeScript frontend and Python backend.
π Live Demo: https://rdarshan927.github.io/tough
- π€ Multi-Provider AI Support: Works with Groq, OpenAI, Anthropic, Together AI, and Ollama
- π¨ Beautiful Modern UI: Dark mode interface with syntax highlighting
- π Rich Markdown Support: Code blocks, tables, lists, and more
- π Secure Backend: API keys stored server-side, not in browser
- π Google Calendar: View, create, update, and delete calendar events
- β Google Tasks: Manage your todo lists with natural language
- π Notes System: Create and manage notes with AI assistance
- π OAuth2 Authentication: Secure Google account integration
- πΎ Persistent Storage: API keys and OAuth tokens securely stored
- π³ Docker Ready: Easy deployment with Docker Compose
- π Fast & Responsive: Built with Vite for lightning-fast development
- π‘οΈ Type-Safe: Full TypeScript coverage on frontend and backend
Frontend (React + TypeScript)
β HTTP/REST API
Backend (Python + Flask)
β MCP Protocol
Google APIs (Calendar, Tasks) + Notes (File-based)
git clone https://github.com/rdarshan927/tough.git
cd "TOUGH CHAT"
./setup.shThen follow the on-screen instructions to configure your API keys.
See SETUP.md for detailed instructions.
TOUGH CHAT/
βββ tough/
β βββ front-end/ # Frontend (React + TypeScript)
β β βββ src/
β β β βββ Chat.tsx # Main chat interface
β β β βββ Chat-v2.tsx # Backend-connected version
β β β βββ Store.ts # Redux state management
β β β βββ api/
β β β βββ client.ts # API client for backend
β β βββ Dockerfile
β β βββ docker-compose.yml
β β βββ package.json
β β
β βββ tough-backend/ # Backend (Python + Flask)
β βββ src/
β β βββ __init__.py # Package initialization
β β βββ app.py # Flask application (placeholder)
β β βββ routes/ # API routes (to be implemented)
β β βββ services/ # Business logic (to be implemented)
β βββ tests/ # Test files
β βββ data/ # Notes storage (auto-created)
β βββ tokens/ # OAuth tokens (auto-created)
β βββ requirements.txt # Python dependencies
β βββ venv/ # Virtual environment (auto-created)
β
βββ SETUP.md # Detailed setup guide
βββ ARCHITECTURE.md # System architecture
βββ IMPLEMENTATION.md # Implementation details
βββ README.md # This file
βββ setup.sh # Automated setup script
You: "Hello! What can you do?"
AI: "I'm Tough Agent! I can help you with various tasks including..."
You: "What's on my calendar today?"
AI: "Let me check your calendar... [lists today's events]"
You: "Create a meeting tomorrow at 2 PM for project review"
AI: "I've created the event 'Project Review' for tomorrow at 2:00 PM"
You: "Show me my todo list"
AI: "Here are your current tasks: [lists tasks]"
You: "Add a task to buy groceries"
AI: "I've added 'Buy groceries' to your task list"
You: "Create a note about today's standup meeting"
AI: "I've created a note with the title 'Standup Meeting'..."
# Required: At least one AI provider
GROQ_API_KEY=your_key_here
OPENAI_API_KEY=your_key_here
# Required: For Google integration
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REDIRECT_URI=http://localhost:3001/api/auth/google/callback
# Server config
PORT=3001
FRONTEND_URL=http://localhost:5173VITE_API_URL=http://localhost:3001/apidocker-compose up -ddocker-compose -f docker-compose.prod.yml up -dAccess the app at http://localhost:3000
POST /api/chat
Content-Type: application/json
{
"messages": [
{ "role": "user", "content": "Hello!" }
],
"provider": "groq",
"model": "llama-3.3-70b-versatile"
}POST /api/mcp/execute
Content-Type: application/json
{
"toolName": "calendar_list_events",
"parameters": {
"startDate": "2025-10-25",
"maxResults": 10
}
}See SETUP.md for complete API documentation.
cd tough/front-end
npm run devcd tough/tough-backend
source venv/bin/activate # Activate virtual environment
python -m src.app # Run the Flask app# Frontend
cd tough/front-end
npm run build
# Backend - Using Gunicorn
cd tough/tough-backend
source venv/bin/activate
gunicorn -w 4 -b 0.0.0.0:3001 "src.app:create_app()"- β API keys stored server-side only
- β OAuth tokens encrypted and stored securely
- β CORS configured for frontend access only
- β Helmet.js for security headers
- β Environment variables for sensitive data
- β No sensitive data in browser localStorage
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with React and Flask
- Google APIs integration via google-api-python-client
- UI components inspired by modern chat interfaces
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: SETUP.md
- Add more MCP tools (Gmail, Drive, etc.)
- Implement conversation history persistence
- Add user authentication and multi-user support
- Mobile app development
- Voice input/output support
- Plugin system for custom MCP tools
Made with β€οΈ by the Tough Team