mcp_server

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

  1. Cloner le repository :
git clone https://github.com/IlhemAmiri/mcp_server.git
cd mcp_server
  1. Créer un environnement virtuel :
python -m venv env
  1. Activer l'environnement virtuel :
  • Windows :
.\env\Scripts\activate
  • Linux/Mac :
source env/bin/activate
  1. Installer les dépendances :
pip install -r requirements.txt
  1. 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

  1. Démarrer le serveur MCP MySQL :
python mcp_mysql_server.py
  1. Dans un nouveau terminal, lancer le chatbot :
python main.py

Structure du Projet

  • main.py : Point d'entrée de l'application
  • mcp_mysql_server.py : Serveur MCP pour MySQL
  • mcp_client.py : Client MCP pour les requêtes MySQL
  • conversational_agent.py : Agent conversationnel avec Groq LLM
  • config.py : Configuration centralisée
  • requirements.txt : Dépendances Python

Exemples d'Utilisation

  1. 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.
  1. 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 à :

  1. Fork le projet
  2. Créer une branche (git checkout -b feature/amelioration)
  3. Commit vos changements (git commit -am 'Ajout de fonctionnalité')
  4. Push à la branche (git push origin feature/amelioration)
  5. Créer une Pull Request

License

Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.