param([switch]$QA,[string]$EngineRoot='C:/Program Files/Epic Games/UE_5.8') $ErrorActionPreference='Stop' $root=(Resolve-Path (Join-Path $PSScriptRoot '../..')).Path $project=Join-Path $root 'ueRouge.uproject' $occupied=Get-NetTCPConnection -LocalPort 8000 -State Listen -ErrorAction SilentlyContinue if($occupied){throw 'Port 8000 is already occupied. Verify its project before launching another MCP editor.'} $arguments=@(('"'+$project+'"'),'-ModelContextProtocolStartServer','-ModelContextProtocolPort=8000','-NoLiveCoding','-log') if($QA){$arguments+=('-IronsporeDataRoot="'+$root.Replace('\','/')+'/Saved/QA/Interactive"');$arguments+='-IronsporeQA'} $process=Start-Process -FilePath (Join-Path $EngineRoot 'Engine/Binaries/Win64/UnrealEditor.exe') -ArgumentList $arguments -WindowStyle Hidden -PassThru Write-Output ('Started target editor PID '+$process.Id)