Skip to content

v2.3.0: Server-side Gemini Integration & Web Chat Frontend

Choose a tag to compare

@ma3u ma3u released this 28 Jul 21:42
· 19 commits to main since this release

🎉 What's New

🤖 Server-side Gemini Integration

  • Added server-side Gemini API integration using GOOGLE_GEMINI_API_KEY from 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 limiting
    • GET /api/gemini/stats - Usage statistics
    • GET /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 InitializationOptions in 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.py

Start the Frontend:

cd frontend
python serve.py
# Open http://localhost:8080

Configure 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_KEY in environment
  • Rate limits reset daily at midnight
  • Frontend works with both local and Railway deployments