Gemini-MCP-Server

Gemini-MCP-Server

3.2

If you are the rightful owner of Gemini-MCP-Server 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.

Gemini MCP Server is a robust AI Customer Support Bot utilizing Google Gemini AI and adhering to the Model Context Protocol (MCP) standard.

🤖 Gemini MCP Server

A powerful AI Customer Support Bot powered by Google Gemini and following the Model Context Protocol (MCP) standard.

✨ Features

  • 🤖 Google Gemini AI - Fast, free, and powerful AI responses
  • 🔄 MCP Protocol - Full Model Context Protocol implementation
  • High Performance - Async/await, concurrent batch processing
  • 🛡️ Rate Limiting - Built-in protection against abuse
  • 📊 Database Integration - Store conversations and analytics
  • 🌍 Multi-language - Support for 9+ languages
  • 🚀 Production Ready - Docker, health checks, monitoring
  • 💰 100% FREE - No API costs, generous limits

🚀 Quick Start

1. Get FREE Gemini API Key

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Click "Create API Key"
  4. Copy your API key

2. Clone & Setup

git clone https://github.com/your-username/gemini-mcp-server.git
cd gemini-mcp-server

# Install dependencies
pip install -r requirements.txt

# Copy environment file
cp env.example .env

# Add your Gemini API key to .env
GEMINI_API_KEY=your_key_here

3. Run the Server

python app.py

The server will start at http://localhost:8000

📡 API Endpoints

Health Check

GET /mcp/health

Process Single Query

POST /mcp/process
{
  "query": "Hello, I need help with my account",
  "user_id": "123",
  "priority": "normal"
}

Batch Processing

POST /mcp/batch
{
  "queries": ["Question 1", "Question 2"],
  "user_id": "123"
}

Get Capabilities

GET /mcp/capabilities

🔧 Configuration

All configuration is done through environment variables in .env:

# Required
GEMINI_API_KEY=your_key_here

# Optional
DATABASE_URL=sqlite:///./mcp_server.db
RATE_LIMIT_REQUESTS=100
RATE_LIMIT_PERIOD=60
DEBUG=false

🚀 Deployment

Railway (FREE)

  1. Push to GitHub
  2. Connect to Railway
  3. Add GEMINI_API_KEY environment variable
  4. Deploy automatically

Render (FREE)

  1. Connect GitHub repo to Render
  2. Create new Web Service
  3. Add GEMINI_API_KEY environment variable
  4. Deploy

Docker

docker build -t gemini-mcp-server .
docker run -p 8000:8000 -e GEMINI_API_KEY="your_key" gemini-mcp-server

📊 Performance

  • Response Time: ~0.5-2 seconds
  • Throughput: 100+ requests/minute
  • Concurrency: Unlimited concurrent batch processing
  • Rate Limits: Configurable per client IP

🔒 Security

  • Rate limiting per IP address
  • Request validation middleware
  • Environment variable configuration
  • SQL injection protection
  • CORS configuration

🌍 Multi-Language Support

Supports customer queries in:

  • English (en)
  • Spanish (es)
  • French (fr)
  • German (de)
  • Italian (it)
  • Portuguese (pt)
  • Japanese (ja)
  • Korean (ko)
  • Chinese (zh)

📈 Database Schema

The server includes models for:

  • ChatMessage - Store conversations
  • User - User management
  • Tenant - Multi-tenant support

🔗 Frontend Integration

// React/TypeScript example
const response = await fetch('https://your-server.com/mcp/process', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-mcp-auth': 'your-auth-token'
  },
  body: JSON.stringify({
    query: userMessage,
    user_id: currentUser.id,
    priority: 'normal'
  })
});

const data = await response.json();
console.log(data.response); // AI response

💰 Cost Analysis

FeatureCost
Google GeminiFREE
DatabaseFREE (SQLite)
HostingFREE (Railway/Render)
Rate Limits15 requests/min, 1M tokens/day
Total$0/month

🛠️ Development

Setup Development Environment

# Clone repository
git clone https://github.com/your-username/gemini-mcp-server.git
cd gemini-mcp-server

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Copy environment file
cp env.example .env

# Run in development mode
python app.py

Run Tests

# Install test dependencies
pip install pytest pytest-asyncio httpx

# Run tests
pytest

📋 TODO

  • Add authentication system
  • Implement WebSocket support
  • Add conversation history
  • Create admin dashboard
  • Add metrics and logging
  • Implement caching layer

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the file for details.

🙏 Acknowledgments

  • Google for providing free Gemini AI
  • FastAPI for the excellent web framework
  • The MCP community for protocol standards

🌟 Star this repository if you found it helpful!

🔗 Live Demo | Documentation