# Script to start MCP SSE Server for Memento Write-Host "`n╔═══════════════════════════════════════════════════════════╗" -ForegroundColor Cyan Write-Host "║ Starting Memento MCP SSE Server ║" -ForegroundColor Cyan Write-Host "╚═══════════════════════════════════════════════════════════╝`n" -ForegroundColor Cyan # Check if running from correct directory $currentDir = Get-Location $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path if ($scriptDir) { Push-Location $scriptDir } # Ensure we have node_modules if (-not (Test-Path "node_modules")) { Write-Host "📦 Installing dependencies..." -ForegroundColor Yellow npm install } # Check if Prisma Client exists in parent keep-notes $prismaClientPath = "..\keep-notes\node_modules\.prisma\client" if (Test-Path $prismaClientPath) { Write-Host "✅ Prisma Client found in keep-notes" -ForegroundColor Green } else { Write-Host "⚠️ Prisma Client not found. Run: cd ..\keep-notes && npx prisma generate" -ForegroundColor Yellow Write-Host " Then restart this script." -ForegroundColor Yellow exit 1 } # Get local IP address Write-Host "`n🔍 Detecting network configuration..." -ForegroundColor Cyan $ipAddresses = Get-NetIPAddress -AddressFamily IPv4 | Where-Object { $_.InterfaceAlias -notlike "*Loopback*" -and $_.IPAddress -notlike "169.*" } $mainIP = $ipAddresses | Select-Object -First 1 -ExpandProperty IPAddress Write-Host "`n📡 Your IP addresses:" -ForegroundColor Cyan foreach ($ip in $ipAddresses) { Write-Host " - $($ip.IPAddress)" -ForegroundColor White } Write-Host "`n🌐 For N8N configuration, use:" -ForegroundColor Green Write-Host " http://$mainIP:3001/sse" -ForegroundColor Yellow -BackgroundColor DarkGray Write-Host "`n🚀 Starting MCP SSE Server on port 3001..." -ForegroundColor Cyan Write-Host " Press Ctrl+C to stop`n" -ForegroundColor Gray # Start the server node index-sse.js