# Quick Start MCP Servers for ShopDB Development # Sets up all prerequisites and tests MCP server configuration # # Usage: # .\\.claude\quick-start-mcp.ps1 # .\\.claude\quick-start-mcp.ps1 -SkipVMSetup # .\\.claude\quick-start-mcp.ps1 -InstallOnly param( [switch]$SkipVMSetup, [switch]$InstallOnly ) $ErrorActionPreference = "Stop" Write-Host "" Write-Host "==========================================" -ForegroundColor Cyan Write-Host "ShopDB MCP Quick Start" -ForegroundColor Cyan Write-Host "==========================================" -ForegroundColor Cyan Write-Host "" $installDir = "C:\Users\270015376\Documents" $repoDir = "C:\Users\270015376\Documents\github\flask-shopdb" # Check we're in the right directory if ((Get-Location).Path -ne $repoDir) { Write-Host "Switching to flask-shopdb directory..." -ForegroundColor Yellow Set-Location $repoDir } # Step 1: Check Node.js/npm Write-Host "[1/6] Checking Node.js/npm..." -ForegroundColor Yellow try { $nodeVersion = node --version $npmVersion = npm --version Write-Host " OK: Node.js $nodeVersion, npm $npmVersion" -ForegroundColor Green } catch { Write-Host " FAIL: Node.js not found" -ForegroundColor Red Write-Host "" Write-Host "Install Node.js from: https://nodejs.org/" -ForegroundColor Yellow Write-Host "After installing, restart this script" -ForegroundColor Yellow exit 1 } # Step 2: Check/Install Gortex Write-Host "[2/6] Checking Gortex..." -ForegroundColor Yellow $gortexPath = Join-Path $installDir "gortex.exe" if (Test-Path $gortexPath) { try { $gortexVersion = & $gortexPath --version 2>&1 Write-Host " OK: Gortex found ($gortexVersion)" -ForegroundColor Green } catch { Write-Host " WARN: Gortex found but may be corrupted" -ForegroundColor Yellow } } else { Write-Host " Installing Gortex..." -ForegroundColor Yellow try { $zipPath = Join-Path $installDir "gortex_windows_amd64.zip" # Download latest release Write-Host " Downloading from GitHub..." -ForegroundColor Gray $latestUrl = "https://github.com/zzet/gortex/releases/latest/download/gortex_windows_amd64.zip" Invoke-WebRequest -Uri $latestUrl -OutFile $zipPath -UseBasicParsing # Extract Write-Host " Extracting..." -ForegroundColor Gray Expand-Archive -Path $zipPath -DestinationPath $installDir -Force # Cleanup Remove-Item $zipPath Write-Host " OK: Gortex installed" -ForegroundColor Green } catch { Write-Host " FAIL: Could not install Gortex: $($_.Exception.Message)" -ForegroundColor Red Write-Host " Manual download: https://github.com/zzet/gortex/releases" -ForegroundColor Yellow } } # Step 3: Check MySQL/Docker Write-Host "[3/6] Checking MySQL database..." -ForegroundColor Yellow $mysqlRunning = Test-NetConnection -ComputerName 127.0.0.1 -Port 3306 -WarningAction SilentlyContinue -InformationLevel Quiet if ($mysqlRunning) { Write-Host " OK: MySQL is running at 127.0.0.1:3306" -ForegroundColor Green } else { Write-Host " WARN: MySQL not running" -ForegroundColor Yellow Write-Host " Start with: docker compose up -d db" -ForegroundColor Gray # Try to start Docker automatically try { $dockerRunning = docker ps 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host " Starting MySQL database..." -ForegroundColor Yellow docker compose up -d db Start-Sleep -Seconds 5 $mysqlRunning = Test-NetConnection -ComputerName 127.0.0.1 -Port 3306 -WarningAction SilentlyContinue -InformationLevel Quiet if ($mysqlRunning) { Write-Host " OK: MySQL started successfully" -ForegroundColor Green } } else { Write-Host " Docker not running. Start Docker Desktop first." -ForegroundColor Yellow } } catch { Write-Host " Docker not available. Install Docker Desktop." -ForegroundColor Yellow } } # Step 4: Check MCP packages Write-Host "[4/6] Checking MCP packages..." -ForegroundColor Yellow $packages = @( "@benborla29/mcp-server-mysql", "@agent-infra/mcp-server-browser", "ssh-mcp" ) foreach ($pkg in $packages) { try { $pkgInfo = npm view $pkg version 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host " OK: $pkg available (v$pkgInfo)" -ForegroundColor Green } else { Write-Host " WARN: $pkg not found in registry" -ForegroundColor Yellow } } catch { Write-Host " WARN: Cannot check $pkg" -ForegroundColor Yellow } } # Step 5: Check VM (if not skipped) if (-not $SkipVMSetup) { Write-Host "[5/6] Checking Hyper-V VM..." -ForegroundColor Yellow $vmIP = "192.168.100.10" $vmReachable = Test-Connection -ComputerName $vmIP -Count 1 -Quiet -ErrorAction SilentlyContinue if ($vmReachable) { Write-Host " OK: VM reachable at $vmIP" -ForegroundColor Green # Check SSH port $sshOpen = Test-NetConnection -ComputerName $vmIP -Port 22 -WarningAction SilentlyContinue -InformationLevel Quiet if ($sshOpen) { Write-Host " OK: SSH port 22 is open" -ForegroundColor Green } else { Write-Host " WARN: SSH port not open on VM" -ForegroundColor Yellow Write-Host " Run on VM (as Admin): .\\.claude\enable-vm-ssh.ps1" -ForegroundColor Gray } } else { Write-Host " WARN: VM not reachable at $vmIP" -ForegroundColor Yellow Write-Host " Check: VM is running in Hyper-V Manager" -ForegroundColor Gray Write-Host " Check: VM has internal network adapter" -ForegroundColor Gray } } else { Write-Host "[5/6] Skipping VM check (--SkipVMSetup)" -ForegroundColor Gray } # Step 6: Verify MCP config Write-Host "[6/6] Verifying MCP configuration..." -ForegroundColor Yellow $mcpConfigPath = Join-Path $repoDir ".claude\mcp-servers.json" if (Test-Path $mcpConfigPath) { $mcpConfig = Get-Content $mcpConfigPath | ConvertFrom-Json $serverCount = $mcpConfig.mcpServers.PSObject.Properties.Count Write-Host " OK: Config file found with $serverCount servers" -ForegroundColor Green # List configured servers foreach ($server in $mcpConfig.mcpServers.PSObject.Properties) { Write-Host " - $($server.Name)" -ForegroundColor Gray } } else { Write-Host " FAIL: MCP config not found at $mcpConfigPath" -ForegroundColor Red exit 1 } Write-Host "" Write-Host "==========================================" -ForegroundColor Cyan Write-Host "Setup Complete" -ForegroundColor Cyan Write-Host "==========================================" -ForegroundColor Cyan Write-Host "" if ($InstallOnly) { Write-Host "Installation complete! (Skipping tests)" -ForegroundColor Green exit 0 } # Run tests Write-Host "Running MCP test suite..." -ForegroundColor Yellow Write-Host "" $testScript = Join-Path $repoDir ".claude\test-mcp-servers.ps1" if (Test-Path $testScript) { if ($SkipVMSetup) { & $testScript -SkipVM } else { & $testScript } } else { Write-Host "Test script not found at $testScript" -ForegroundColor Red exit 1 } Write-Host "" Write-Host "==========================================" -ForegroundColor Cyan Write-Host "Next Steps" -ForegroundColor Cyan Write-Host "==========================================" -ForegroundColor Cyan Write-Host "" Write-Host "1. Read the integration guide:" -ForegroundColor White Write-Host " cat .claude\MCP-INTEGRATION-GUIDE.md" -ForegroundColor Gray Write-Host "" Write-Host "2. Create VM snapshots (see guide):" -ForegroundColor White Write-Host " cat .claude\VM-SNAPSHOT-GUIDE.md" -ForegroundColor Gray Write-Host "" Write-Host "3. Start Claude Code from this directory:" -ForegroundColor White Write-Host " claude" -ForegroundColor Gray Write-Host "" Write-Host "4. Test MCP servers with Claude:" -ForegroundColor White Write-Host " - 'List all tasks in the current project'" -ForegroundColor Gray Write-Host " - 'Show me the endpoints table schema'" -ForegroundColor Gray Write-Host " - 'Take a screenshot of localhost:5001'" -ForegroundColor Gray Write-Host " - 'What is the hostname of the VM?'" -ForegroundColor Gray Write-Host "" exit 0