$ErrorActionPreference = "Stop"
$root = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
$client = Join-Path $root "repokey-client.cmd"

if (-not (Test-Path -LiteralPath $client)) {
    throw "repokey-client.cmd not found: $client"
}

Write-Host "Vivado Debug MCP is built into the RepoKey client; no Python install is needed."
Write-Host "Verify the bundled debug layer, then register the MCP server."

& $client debug --help
if ($LASTEXITCODE -ne 0) {
    throw "repokey debug layer check failed (exit $LASTEXITCODE)"
}

Write-Host "[OK] Vivado Debug MCP is available."
Write-Host "Next: run install\register_debug_mcp.ps1 (or RepoKey-Debug-MCP-Setup.cmd) to register it with AI clients."
