Chirag Patankar/AI-Customer-Support-Bot--MCP-Server
Built by Metorial, the integration platform for agentic AI.
Chirag Patankar/AI-Customer-Support-Bot--MCP-Server
Server Summary
Real-time context fetching
AI response generation
Batch processing support
Priority queuing
Rate limiting
User interaction tracking
Health monitoring
MCP protocol compliance
A Model Context Protocol (MCP) server that provides AI-powered customer support using Cursor AI and Glama.ai integration.
git clone
cd
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
.env
file based on .env.example
:cp .env.example .env
.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
# Create the database
createdb customer_support_bot
# Run migrations (if using Alembic)
alembic upgrade head
Start the server:
python app.py
The server will be available at http://localhost:8000
GET /
Returns basic server information.
GET /mcp/version
Returns supported MCP protocol versions.
GET /mcp/capabilities
Returns server capabilities and supported features.
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"
}'
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"
}'
GET /mcp/health
Check server health and service status.
The server implements rate limiting with the following defaults:
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 exceededUNSUPPORTED_MCP_VERSION
: Unsupported MCP versionPROCESSING_ERROR
: Error processing requestCONTEXT_FETCH_ERROR
: Error fetching context from Glama.aiBATCH_PROCESSING_ERROR
: Error processing batch request.
├── 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
mcp_config.py
with new configuration optionsmodels.py
if neededapp.py
X-MCP-Auth
headerThe server provides health check endpoints for monitoring:
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please create an issue in the repository or contact the development team.