Cover image
Try Now
2025-04-02

3 years

Works with Finder

1

Github Watches

1

Github Forks

1

Github Stars

AI Customer Support Bot - MCP Server

A Model Context Protocol (MCP) server that provides AI-powered customer support using Cursor AI and Glama.ai integration.

Features

  • Real-time context fetching from Glama.ai
  • AI-powered response generation with Cursor AI
  • Batch processing support
  • Priority queuing
  • Rate limiting
  • User interaction tracking
  • Health monitoring
  • MCP protocol compliance

Prerequisites

  • Python 3.8+
  • PostgreSQL database
  • Glama.ai API key
  • Cursor AI API key

Installation

  1. Clone the repository:
git clone <repository-url>
cd <repository-name>
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file based on .env.example:
cp .env.example .env
  1. Configure your .env file with your credentials:
# API Keys
GLAMA_API_KEY=your_glama_api_key_here
CURSOR_API_KEY=your_cursor_api_key_here

# Database
DATABASE_URL=postgresql://user:password@localhost/customer_support_bot

# API URLs
GLAMA_API_URL=https://api.glama.ai/v1

# Security
SECRET_KEY=your_secret_key_here

# MCP Server Configuration
SERVER_NAME="AI Customer Support Bot"
SERVER_VERSION="1.0.0"
API_PREFIX="/mcp"
MAX_CONTEXT_RESULTS=5

# Rate Limiting
RATE_LIMIT_REQUESTS=100
RATE_LIMIT_PERIOD=60

# Logging
LOG_LEVEL=INFO
  1. Set up the database:
# Create the database
createdb customer_support_bot

# Run migrations (if using Alembic)
alembic upgrade head

Running the Server

Start the server:

python app.py

The server will be available at http://localhost:8000

API Endpoints

1. Root Endpoint

GET /

Returns basic server information.

2. MCP Version

GET /mcp/version

Returns supported MCP protocol versions.

3. Capabilities

GET /mcp/capabilities

Returns server capabilities and supported features.

4. Process Request

POST /mcp/process

Process a single query with context.

Example request:

curl -X POST http://localhost:8000/mcp/process \
  -H "Content-Type: application/json" \
  -H "X-MCP-Auth: your-auth-token" \
  -H "X-MCP-Version: 1.0" \
  -d '{
    "query": "How do I reset my password?",
    "priority": "high",
    "mcp_version": "1.0"
  }'

5. Batch Processing

POST /mcp/batch

Process multiple queries in a single request.

Example request:

curl -X POST http://localhost:8000/mcp/batch \
  -H "Content-Type: application/json" \
  -H "X-MCP-Auth: your-auth-token" \
  -H "X-MCP-Version: 1.0" \
  -d '{
    "queries": [
      "How do I reset my password?",
      "What are your business hours?",
      "How do I contact support?"
    ],
    "mcp_version": "1.0"
  }'

6. Health Check

GET /mcp/health

Check server health and service status.

Rate Limiting

The server implements rate limiting with the following defaults:

  • 100 requests per 60 seconds
  • Rate limit information is included in the health check endpoint
  • Rate limit exceeded responses include reset time

Error Handling

The server returns structured error responses in the following format:

{
  "code": "ERROR_CODE",
  "message": "Error description",
  "details": {
    "timestamp": "2024-02-14T12:00:00Z",
    "additional_info": "value"
  }
}

Common error codes:

  • RATE_LIMIT_EXCEEDED: Rate limit exceeded
  • UNSUPPORTED_MCP_VERSION: Unsupported MCP version
  • PROCESSING_ERROR: Error processing request
  • CONTEXT_FETCH_ERROR: Error fetching context from Glama.ai
  • BATCH_PROCESSING_ERROR: Error processing batch request

Development

Project Structure

.
├── app.py              # Main application file
├── database.py         # Database configuration
├── middleware.py       # Middleware (rate limiting, validation)
├── models.py          # Database models
├── mcp_config.py      # MCP-specific configuration
├── requirements.txt   # Python dependencies
└── .env              # Environment variables

Adding New Features

  1. Update mcp_config.py with new configuration options
  2. Add new models in models.py if needed
  3. Create new endpoints in app.py
  4. Update capabilities endpoint to reflect new features

Security

  • All MCP endpoints require authentication via X-MCP-Auth header
  • Rate limiting is implemented to prevent abuse
  • Database credentials should be kept secure
  • API keys should never be committed to version control

Monitoring

The server provides health check endpoints for monitoring:

  • Service status
  • Rate limit usage
  • Connected services
  • Processing times

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

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

Support

For support, please create an issue in the repository or contact the development team.

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • J. DE HARO OLLE
  • Especialista en juegos de palabras en varios idiomas.

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • albert tan
  • Japanese education, creating tailored learning experiences.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • jae-jae
  • Servidor MCP para obtener contenido de la página web con el navegador sin cabeza de dramaturgo.

  • HiveNexus
  • Un bot de chat de IA para equipos pequeños y medianos, que apoyan modelos como Deepseek, Open AI, Claude y Gemini. 专为中小团队设计的 ai 聊天应用 , 支持 Deepseek 、 Open ai 、 Claude 、 Géminis 等模型。

  • ravitemer
  • Un poderoso complemento Neovim para administrar servidores MCP (protocolo de contexto del modelo)

  • patruff
  • Puente entre los servidores Ollama y MCP, lo que permite a LLM locales utilizar herramientas de protocolo de contexto del modelo

  • pontusab
  • La comunidad de cursor y windsurf, encontrar reglas y MCP

  • JackKuo666
  • 🔍 Habilitar asistentes de IA para buscar y acceder a la información del paquete PYPI a través de una interfaz MCP simple.

    Reviews

    5 (1)
    Avatar
    user_gRUvwmSz
    2025-04-16

    The AI-Customer-Support-Bot--MCP-Server by ChiragPatankar has been a game-changer for our customer support team. It efficiently handles queries and provides accurate responses, reducing our workload significantly. The setup was straightforward, and the performance has been superb. Highly recommend for businesses looking to improve their customer support operations. You can check it out here: https://github.com/ChiragPatankar/AI-Customer-Support-Bot---MCP-Server