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
- Clone the repository:
git clone <repository-url>
cd <repository-name>
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venvScriptsactivate
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile based on.env.example:
cp .env.example .env
- Configure your
.envfile 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
- 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 exceededUNSUPPORTED_MCP_VERSION: Unsupported MCP versionPROCESSING_ERROR: Error processing requestCONTEXT_FETCH_ERROR: Error fetching context from Glama.aiBATCH_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
- Update
mcp_config.pywith new configuration options - Add new models in
models.pyif needed - Create new endpoints in
app.py - Update capabilities endpoint to reflect new features
Security
- All MCP endpoints require authentication via
X-MCP-Authheader - 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
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- 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.
AI Customer Support Bot
Project Details
- ChiragPatankar/AI-Customer-Support-Bot--MCP-Server
- MIT License
- Last Updated: 4/6/2025
Recomended MCP Servers
一个基于 Node.js 和 TypeScript 的 MCP 服务,用于读写图片元数据
The AI Browser Automation Framework
AgenticAI using MCP
MCP Server for public disclosure information of Korean companies, powered by the dartpoint.ai API.
A Model Context Protocol Server connector for Bitrefill public API, to enable AI agents to search and shop...
This read-only MCP Server allows you to connect to Sybase IQ data from Claude Desktop through CData JDBC...
MCP server for checking Mathematica documentation via local MMA installation
Fetch data from Hong Kong Observatory with MCP
Model Context Provider for Amazing Marvin productivity app - Access your tasks, projects, and categories in AI assistants
Pump.fun data fetch tool for Model Context Protocol
An MCP server for posting to the MyMCPSpace "bots only" social network





