# Script pour dĂ©marrer le serveur MCP Keep Notes en mode SSE # Mode: Server-Sent Events (HTTP) Write-Host "" Write-Host "==========================================" -ForegroundColor Cyan Write-Host " 🚀 Keep Notes MCP Server (SSE)" -ForegroundColor Cyan Write-Host "==========================================" -ForegroundColor Cyan Write-Host "" Write-Host "📌 Mode: SSE (HTTP sur port 3001)" -ForegroundColor Yellow Write-Host "📌 Chemin: $PSScriptRoot" -ForegroundColor Yellow Write-Host "" # VĂ©rifier si Prisma est gĂ©nĂ©rĂ© if (-not (Test-Path "node_modules\.prisma\client")) { Write-Host "⚠ Client Prisma non trouvĂ©, gĂ©nĂ©ration en cours..." -ForegroundColor Yellow npx prisma generate if ($LASTEXITCODE -eq 0) { Write-Host "✅ Client Prisma gĂ©nĂ©rĂ©" -ForegroundColor Green } else { Write-Host "❌ Erreur lors de la gĂ©nĂ©ration du client Prisma" -ForegroundColor Red exit 1 } } # VĂ©rifier que Keep Notes est en cours d'exĂ©cution Write-Host "🔍 VĂ©rification de Keep Notes..." -ForegroundColor Cyan try { $response = Invoke-WebRequest -Uri "http://localhost:3000" -UseBasicParsing -TimeoutSec 5 Write-Host "✅ Keep Notes est en cours d'exĂ©cution (port 3000)" -ForegroundColor Green } catch { Write-Host "⚠ Attention: Keep Notes n'est pas accessible sur localhost:3000" -ForegroundColor Yellow Write-Host " Le serveur MCP SSE risque de ne pas fonctionner correctement" -ForegroundColor Yellow Write-Host "" $continue = Read-Host "Voulez-vous continuer quand mĂȘme? (O/N)" if ($continue -ne "O" -and $continue -ne "o") { Write-Host "❌ Annulation" -ForegroundColor Red exit 1 } } Write-Host "" Write-Host "⏳ DĂ©marrage du serveur MCP SSE..." -ForegroundColor Green Write-Host "🛑 Appuyez sur Ctrl+C pour arrĂȘter" -ForegroundColor Red Write-Host "" Write-Host "🌐 Serveur accessible sur:" -ForegroundColor Cyan Write-Host " - Local: http://localhost:3001" -ForegroundColor White Write-Host " - Network: Trouvez votre IP avec 'ipconfig'" -ForegroundColor White Write-Host "" Write-Host "📋 Endpoints:" -ForegroundColor Cyan Write-Host " - Health: GET http://localhost:3001/" -ForegroundColor White Write-Host " - SSE: GET http://localhost:3001/sse" -ForegroundColor White Write-Host " - Message: POST http://localhost:3001/message" -ForegroundColor White Write-Host "" # DĂ©marrer le serveur try { node index-sse.js } catch { Write-Host "❌ Erreur lors du dĂ©marrage du serveur:" -ForegroundColor Red Write-Host " $($_.Exception.Message)" -ForegroundColor Red Write-Host "" Write-Host "DĂ©pannage:" -ForegroundColor Yellow Write-Host "1. VĂ©rifiez que le port 3001 n'est pas dĂ©jĂ  utilisĂ©" -ForegroundColor White Write-Host "2. VĂ©rifiez que Node.js est installĂ© (node --version)" -ForegroundColor White Write-Host "3. VĂ©rifiez les dĂ©pendances (npm list)" -ForegroundColor White exit 1 }