UNPKG

mat-drupal-mcp

Version:

MatDrupal MCP - AI Assistant for Drupal Projects with bilingual FR/EN support

317 lines (233 loc) 7.24 kB
# 📖 Installation Guide - MatDrupal MCP > **Serveur MCP intelligent pour l'analyse de projets Drupal avec support bilingue** > > Créé par [Mathieu Boisvert](https://github.com/boisvertmath) ## 🚀 Installation Rapide (Recommandée) ```bash curl -sL https://raw.githubusercontent.com/boisvertmath/mat-drupal-mcp/main/scripts/install.sh | bash ``` Cette commande télécharge, installe et configure automatiquement MatDrupal MCP avec GitHub Copilot. ## 📋 Prérequis ### Système d'exploitation - **macOS** (testés: macOS 12+) ### Logiciels requis - **Node.js 18+** - [Télécharger ici](https://nodejs.org/) - **npm** (inclus avec Node.js) - **GitHub Copilot** - Abonnement actif requis - **VS Code** ou **PhpStorm** avec extension GitHub Copilot ### Logiciels optionnels - **Lando** - Pour la gestion d'environnements de développement - **Acquia CLI** - Pour l'intégration cloud Acquia ## 📦 Installation Manuelle ### 1. Téléchargement #### Option A: Clone Git ```bash git clone https://github.com/boisvertmath/mat-drupal-mcp.git cd mat-drupal-mcp ``` #### Option B: Téléchargement direct ```bash curl -sL https://github.com/boisvertmath/mat-drupal-mcp/archive/main.tar.gz | tar -xzf - cd mat-drupal-mcp-main ``` ### 2. Installation des dépendances ```bash npm install ``` ### 3. Compilation ```bash npm run build ``` ### 4. Test de l'installation ```bash npm test ./test-mcp.sh ``` ### 5. Configuration GitHub Copilot #### Option A: Configuration automatique ```bash ./setup.sh ``` #### Option B: Configuration manuelle 1. **Localiser le fichier de configuration GitHub Copilot:** ```bash # macOS/Linux ~/.config/github-copilot/mcp-config.json # Windows %APPDATA%\github-copilot\mcp-config.json ``` 2. **Créer ou modifier le fichier de configuration:** ```json { "mcpServers": { "matdrupal": { "command": "node", "args": ["/chemin/absolu/vers/mat-drupal-mcp/dist/index.js"], "env": { "NODE_ENV": "production", "LANDO_SUPPORT": "true", "ACQUIA_CLI_SUPPORT": "true", "MATDRUPAL_MODE": "true", "BILINGUAL_MODE": "true" }, "description": "MatDrupal Project Intelligence by Mathieu Boisvert", "timeout": 90000 } } } ``` 3. **Redémarrer VS Code ou PhpStorm** ## ⚙️ Configuration Avancée ### Variables d'environnement Créez un fichier `.env` dans le répertoire d'installation : ```bash # Support des outils optionnels LANDO_SUPPORT=true # Active les fonctions Lando ACQUIA_CLI_SUPPORT=true # Active les fonctions Acquia CLI MATDRUPAL_MODE=true # Active le mode MatDrupal spécialisé BILINGUAL_MODE=true # Active le support français/anglais # Configuration avancée NODE_ENV=production # Mode de production DEBUG_MODE=false # Mode debug (logs verbeux) TIMEOUT=90000 # Timeout en millisecondes ``` ### Configuration Lando Si vous utilisez Lando, assurez-vous qu'il est installé et configuré : ```bash # Vérifier l'installation Lando lando version # Si pas installé, installer via Homebrew (macOS) brew install lando # Ou télécharger depuis https://lando.dev/ ``` ### Configuration Acquia CLI Pour utiliser les fonctionnalités Acquia : ```bash # Installer Acquia CLI curl -OL https://github.com/acquia/cli/releases/latest/download/acli.phar chmod +x acli.phar sudo mv acli.phar /usr/local/bin/acli # Authentification acli auth:login ``` ## 🔧 Vérification de l'installation ### Test de base ```bash # Test de compilation npm run build # Test de démarrage npm test # Test complet ./test-mcp.sh ``` ### Test avec GitHub Copilot 1. **Ouvrir VS Code dans un projet Drupal** 2. **Ouvrir GitHub Copilot Chat** 3. **Tester une commande:** ``` @matdrupal Analyze this Drupal project ``` ## 🏗️ Installation pour équipe ### Installation centralisée Pour une équipe, créez un script d'installation personnalisé : ```bash #!/bin/bash # install-team.sh # Configuration d'équipe TEAM_CONFIG_REPO="votre-org/matdrupal-config" TEAM_INSTALL_DIR="/opt/matdrupal" # Installation de base curl -sL https://raw.githubusercontent.com/boisvertmath/mat-drupal-mcp/main/scripts/install.sh | bash # Configuration d'équipe spécifique git clone "https://github.com/$TEAM_CONFIG_REPO.git" /tmp/team-config cp /tmp/team-config/.env ~/.matdrupal/ ``` ### Configuration Docker Pour une installation conteneurisée : ```dockerfile FROM node:18-alpine RUN apk add --no-cache git curl WORKDIR /app COPY . . RUN npm install && npm run build EXPOSE 3000 CMD ["node", "dist/index.js"] ``` ## 🔄 Mise à jour ### Mise à jour automatique ```bash # Si installé via le script automatique ~/.matdrupal/update.sh # Ou directement curl -sL https://raw.githubusercontent.com/boisvertmath/mat-drupal-mcp/main/scripts/update.sh | bash ``` ### Mise à jour manuelle ```bash cd mat-drupal-mcp git pull origin main npm install npm run build ``` ## 🗑️ Désinstallation ### Désinstallation complète ```bash # Désinstallation complète avec sauvegarde curl -sL https://raw.githubusercontent.com/boisvertmath/mat-drupal-mcp/main/scripts/uninstall.sh | bash # Ou si installé localement ~/.matdrupal/scripts/uninstall.sh ``` **Ce qui sera supprimé :** - Répertoire d'installation `~/.matdrupal` - Configuration GitHub Copilot (serveur matdrupal uniquement) - Scripts de mise à jour - Configurations locales dans les projets **Ce qui sera conservé :** - Autres serveurs MCP dans GitHub Copilot - Configurations personnalisées des projets - Extensions VS Code **🔒 Sécurité :** Une sauvegarde complète est créée automatiquement avant la suppression. ### Désinstallation NPM uniquement ```bash npm uninstall -g mat-drupal-mcp ``` **Note :** Cette méthode ne supprime que le binaire, pas la configuration GitHub Copilot. ## 🚨 Dépannage ### Problèmes courants **Node.js non trouvé** ```bash # Vérifier l'installation node --version npm --version # Réinstaller si nécessaire brew install node # macOS ``` **Erreur de permissions** ```bash # Corriger les permissions npm npm config set prefix ~/.npm-global echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.profile source ~/.profile ``` **GitHub Copilot ne reconnaît pas le serveur** ```bash # Vérifier la configuration cat ~/.config/github-copilot/mcp-config.json # Redémarrer VS Code # Vérifier les logs GitHub Copilot ``` ### Logs et diagnostic ```bash # Logs détaillés node dist/index.js --test # Test avec debug DEBUG_MODE=true node dist/index.js --test # Vérifier la configuration cat ~/.config/github-copilot/mcp-config.json | jq . ``` ## 🆘 Support - **Documentation:** [Exemples d'utilisation](docs/usage-examples.md) - **Dépannage:** [Guide de dépannage](docs/troubleshooting.md) - **Issues:** [GitHub Issues](https://github.com/boisvertmath/mat-drupal-mcp/issues) - **Discussions:** [GitHub Discussions](https://github.com/boisvertmath/mat-drupal-mcp/discussions) --- *Installation créée par [Mathieu Boisvert](https://github.com/boisvertmath) pour améliorer l'expérience de développement Drupal.*