[CmdletBinding()] param( [string]$EvidenceDirectory = "artifacts/evidence/mcp-2026-07-28/conformance-acquisition" ) $ErrorActionPreference = "Stop" $repository = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path $runnerDirectory = Join-Path $repository "build/conformance-runner" $evidence = [IO.Path]::GetFullPath($EvidenceDirectory, $repository) New-Item -ItemType Directory -Force -Path $runnerDirectory, $evidence | Out-Null $package = "@modelcontextprotocol/conformance@0.2.0-alpha.11" & npm install --prefix $runnerDirectory --package-lock=true --ignore-scripts --no-audit --no-fund $package 2>&1 | Tee-Object -FilePath (Join-Path $evidence "npm-install.txt") if ($LASTEXITCODE -ne 0) { throw "npm install failed with exit code $LASTEXITCODE" } $packageJson = Join-Path $runnerDirectory "node_modules/@modelcontextprotocol/conformance/package.json" $metadata = Get-Content -Raw -LiteralPath $packageJson | ConvertFrom-Json if ($metadata.version -ne "0.2.0-alpha.11") { throw "Unexpected conformance version: $($metadata.version)" } $lockPath = Join-Path $runnerDirectory "package-lock.json" $lock = Get-Content -Raw -LiteralPath $lockPath | ConvertFrom-Json -AsHashtable $entry = $lock.packages["node_modules/@modelcontextprotocol/conformance"] [ordered]@{ package = $metadata.name version = $metadata.version integrity = $entry.integrity resolved = $entry.resolved acquired_at = [DateTimeOffset]::UtcNow.ToString("O") node = (& node --version) npm = (& npm --version) } | ConvertTo-Json | Set-Content -Encoding utf8 -LiteralPath (Join-Path $evidence "package.json") $bin = $metadata.bin.conformance & node (Join-Path (Split-Path $packageJson) $bin) list --server --requirements 2026-07-28 2>&1 | Tee-Object -FilePath (Join-Path $evidence "server-scenarios.txt") if ($LASTEXITCODE -ne 0) { throw "Conformance scenario listing failed with exit code $LASTEXITCODE" }