IlhemAmiri/mcp_server
3.1
If you are the rightful owner of 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.
An intelligent e-commerce chatbot utilizing Model Context Protocol (MCP) to interact with MySQL and Groq LLM for natural language processing.
Chatbot E-commerce avec MCP MySQL
Un chatbot e-commerce intelligent utilisant Model Context Protocol (MCP) pour interagir avec MySQL et Groq LLM pour le traitement du langage naturel.
Fonctionnalités
- Interface conversationnelle en français et derja tunisienne
- Intégration avec MySQL via MCP
- Génération de requêtes SQL intelligentes
- Cache des requêtes fréquentes
- Gestion des réclamations clients
- Support multilingue (français/derja)
Prérequis
- Python 3.8+
- MySQL Server
- Un compte Groq pour l'API LLM
Installation
- Cloner le repository :
git clone https://github.com/IlhemAmiri/mcp_server.git
cd mcp_server
- Créer un environnement virtuel :
python -m venv env
- Activer l'environnement virtuel :
- Windows :
.\env\Scripts\activate
- Linux/Mac :
source env/bin/activate
- Installer les dépendances :
pip install -r requirements.txt
- Copier le fichier .env.example et configurer vos variables d'environnement :
cp .env.example .env
Configuration
Éditer le fichier .env avec vos informations :
# MySQL Configuration
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=your_user
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=bot_ecommerce_db
# Groq Configuration
GROQ_API_KEY=your_api_key
GROQ_MODEL=llama-3.3-70b-versatile
TEMPERATURE=0.3
# Logging
ENABLE_LOGGING=true
LOG_FILE=chatbot.log
Utilisation
- Démarrer le serveur MCP MySQL :
python mcp_mysql_server.py
- Dans un nouveau terminal, lancer le chatbot :
python main.py
Structure du Projet
main.py: Point d'entrée de l'applicationmcp_mysql_server.py: Serveur MCP pour MySQLmcp_client.py: Client MCP pour les requêtes MySQLconversational_agent.py: Agent conversationnel avec Groq LLMconfig.py: Configuration centraliséerequirements.txt: Dépendances Python
Exemples d'Utilisation
- Questions générales :
Client: Bonjour!
Assistant: Bonjour! Comment puis-je vous aider aujourd'hui?
Client: Combien de clients au total dans la base?
Assistant: Je vais vérifier cela pour vous... Nous avons actuellement 1250 clients enregistrés.
- Réclamations :
Client: J'ai un problème avec ma commande
Assistant: Je suis désolé d'entendre ça. Pouvez-vous me donner votre numéro de commande pour que je puisse vérifier?
Contribution
Les contributions sont les bienvenues ! N'hésitez pas à :
- Fork le projet
- Créer une branche (
git checkout -b feature/amelioration) - Commit vos changements (
git commit -am 'Ajout de fonctionnalité') - Push à la branche (
git push origin feature/amelioration) - Créer une Pull Request
License
Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.