Database · MODEL CONTEXT PROTOCOL
ChiragPatankar AI Customer Support Bot MCP Server
ChiragPatankar AI Customer Support Bot MCP Server is a community-listed Model Context Protocol server. Review the source repository before installation.
连接能力
ChiragPatankar AI Customer Support Bot MCP Server 为 AI Agent 提供什么
- 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
- Python 3.8+
- PostgreSQL database
- Glama.ai API key
- Cursor AI API key
- Clone the repository:
- Create and activate a virtual environment:
- Install dependencies:
- Create a `.env` file based on `.env.example`:
- Configure your `.env` file with your credentials:
- Set up the database:
- 100 requests per 60 seconds
- Rate limit information is included in the health check endpoint
- Rate limit exceeded responses include reset time
- `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
- Update `mcp_config.py` with new configuration options
- Add new models in `models.py` if needed
- Create new endpoints in `app.py`
- Update capabilities endpoint to reflect new features
- 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
- Service status
- Rate limit usage
- Connected services
- Processing times
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
安全
MCP 收录不等于安全审核
MCP 服务器可能获得模型上下文、凭据、本地文件或调用外部系统的权限。连接 Agent 前,请检查代码、环境变量、网络行为、软件包来源与维护状态。
README
仓库文档
A modern, extensible MCP server framework for building AI-powered customer support systems
Features • Quick Start • API Reference • Architecture • Contributing
A Model Context Protocol (MCP) compliant server framework built with modern Python. Designed for developers who want to create intelligent customer support systems without vendor lock-in. Clean architecture, battle-tested patterns, and ready for any AI provider.
graph TB
Client[HTTP Client] --> API[API Server]
API --> MW[Middleware Layer]
MW --> SVC[Service Layer]
SVC --> CTX[Context Manager]
SVC --> AI[AI Integration]
SVC --> DAL[Data Access Layer]
DAL --> DB[(PostgreSQL)]
|
🏗️ Clean Architecture 📡 MCP Compliant |
🔒 Production Ready 🚀 High Performance |
|
🔌 AI Agnostic 📊 Health Monitoring |
🛡️ Secure by Default 📦 Batch Processing |
- Python 3.8+
- PostgreSQL
- Your favorite AI service (OpenAI, Anthropic, etc.)
# Clone and setup
git clone https://github.com/ChiragPatankar/AI-Customer-Support-Bot--MCP-Server.git
cd AI-Customer-Support-Bot--MCP-Server
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Setup environment
cp .env.example .env
# Edit .env with your configuration# .env file
DATABASE_URL=postgresql://user:password@localhost/customer_support_bot
SECRET_KEY=your-super-secret-key
RATE_LIMIT_REQUESTS=100
RATE_LIMIT_PERIOD=60# Setup database
createdb customer_support_bot
# Start server
python app.py
# 🚀 Server running at http://localhost:8000Core Endpoints
GET /mcp/healthPOST /mcp/process
Content-Type: application/json
X-MCP-Auth: your-token
X-MCP-Version: 1.0
{
"query": "How do I reset my password?",
"priority": "high"
}POST /mcp/batch
Content-Type: application/json
X-MCP-Auth: your-token
{
"queries": [
"How do I reset my password?",
"What are your business hours?"
]
}Response Format
{
"status": "success",
"data": {
"response": "Generated AI response",
"confidence": 0.95,
"processing_time": "120ms"
},
"meta": {
"request_id": "req_123456",
"timestamp": "2024-02-14T12:00:00Z"
}
}{
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded",
"details": {
"retry_after": 60,
"timestamp": "2024-02-14T12:00:00Z"
}
}📦 AI-Customer-Support-Bot--MCP-Server
├── 🚀 app.py # FastAPI application
├── 🗄️ database.py # Database configuration
├── 🛡️ middleware.py # Auth & rate limiting
├── 📋 models.py # ORM models
├── ⚙️ mcp_config.py # MCP protocol config
├── 📄 requirements.txt # Dependencies
└── 📝 .env.example # Environment template
| Layer | Purpose | Components |
|---|---|---|
| API | HTTP endpoints, validation | FastAPI routes, Pydantic models |
| Middleware | Auth, rate limiting, logging | Token validation, request throttling |
| Service | Business logic, AI integration | Context management, AI orchestration |
| Data | Persistence, models | PostgreSQL, SQLAlchemy ORM |
- Install your AI SDK:
pip install openai # or anthropic, cohere, etc.- Configure environment:
# Add to .env
AI_SERVICE_API_KEY=sk-your-api-key
AI_SERVICE_MODEL=gpt-4- Implement service integration:
# In service layer
class AIService:
async def generate_response(self, query: str, context: dict) -> str:
# Your AI integration here
return ai_responsepytest tests/# Format code
black .
# Lint
flake8
# Type checking
mypy .# Coming soon - Docker containerization- ✅ Service uptime
- 🔗 Database connectivity
- 📈 Request rates
- ⏱️ Response times
- 💾 Memory usage
# Structured logging included
{
"timestamp": "2024-02-14T12:00:00Z",
"level": "INFO",
"message": "Query processed",
"request_id": "req_123456",
"processing_time": 120
}- 🔐 Token Authentication - Secure API access
- 🛡️ Rate Limiting - DoS protection
- ✅ Input Validation - SQL injection prevention
- 📝 Audit Logging - Request tracking
- 🔒 Environment Secrets - Secure config management
# Production environment variables
DATABASE_URL=postgresql://prod-user:password@prod-host/db
RATE_LIMIT_REQUESTS=1000
LOG_LEVEL=WARNING- Use connection pooling for database
- Implement Redis for rate limiting in multi-instance setups
- Add load balancer for high availability
- Monitor with Prometheus/Grafana
We love contributions! Here's how to get started:
# Fork the repo, then:
git clone https://github.com/your-username/AI-Customer-Support-Bot--MCP-Server.git
cd AI-Customer-Support-Bot--MCP-Server
# Create feature branch
git checkout -b feature/amazing-feature
# Make your changes
# ...
# Test your changes
pytest
# Submit PR- 📝 Write tests for new features
- 📚 Update documentation
- 🎨 Follow existing code style
- ✅ Ensure CI passes
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ by Chirag Patankar
⭐ Star this repo if you find it helpful! ⭐
社区