v2.3.0: Server-side Gemini Integration & Web Chat Frontend
🎉 What's New
🤖 Server-side Gemini Integration
- Added server-side Gemini API integration using
GOOGLE_GEMINI_API_KEYfrom environment variables - No more client-side API keys needed - enhanced security!
- Comprehensive rate limiting to control costs:
- 5 requests per minute per IP
- 30 requests per hour per IP
- 50,000 tokens per day per IP (~25 requests)
- $5 daily global cost limit
- New API endpoints:
POST /api/gemini/chat- Chat with rate limitingGET /api/gemini/stats- Usage statisticsGET /api/gemini/limits- Rate limit information
💬 Standalone Web Chat Frontend
- Beautiful, responsive chat interface at
frontend/index.html - Zero setup required - just open and chat!
- Three intelligent tools:
- 🔍 Search - Search Dr. Strunz's knowledge base
- 💬 Ask Dr. Strunz - Get personalized health answers
- 📊 Analyze Topic - Comprehensive health topic analysis
- Enhanced markdown to HTML conversion for better display
- Automatic server connection with status indicators
- Built with pure HTML, CSS, and JavaScript - no framework dependencies
🐛 Fixes
- Fixed Python 3.13 compatibility issues with MCP stdio server
- Properly handle
InitializationOptionsin server initialization - Fixed SSE routing issues for Claude.ai integration
- Enhanced error handling and recovery
🛠️ Technical Improvements
- SSE server v8 with integrated Gemini endpoints
- CORS support for frontend-backend communication
- Improved logging and error messages
- Better resource management and cleanup
📦 Installation & Usage
Start the MCP Server (SSE mode):
TRANSPORT=sse python main.pyStart the Frontend:
cd frontend
python serve.py
# Open http://localhost:8080Configure Gemini (Optional):
Add to your .env file:
GOOGLE_GEMINI_API_KEY=your-api-key-here
🔧 For Developers
- Python 3.11+ required (Python 3.13 compatible)
- Uses official MCP Python SDK
- FastAPI/Starlette for web endpoints
- Rate limiting with in-memory storage
📝 Notes
- Gemini features require
GOOGLE_GEMINI_API_KEYin environment - Rate limits reset daily at midnight
- Frontend works with both local and Railway deployments