Skip to content

Commit 6a29139

Browse files
fix(action): fix shutdown hang, switch back to download binary
1 parent b328e96 commit 6a29139

2 files changed

Lines changed: 21 additions & 24 deletions

File tree

action/action.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -218,28 +218,29 @@ runs:
218218
219219
Write-Host "::endgroup::"
220220
221-
# ── Step 3: Build mcp-windbg-rs from source ─────────────────────────
222-
- name: Build MCP Server
223-
id: build-server
221+
# ── Step 3: Download mcp-windbg-rs binary ─────────────────────────────
222+
- name: Download MCP Server
223+
id: download-server
224224
if: env.SKIP_ANALYSIS != 'true'
225225
shell: pwsh
226226
run: |
227-
Write-Host "::group::Step 3 - Build mcp-windbg-rs from source"
227+
Write-Host "::group::Step 3 - Download mcp-windbg-rs"
228228
229-
$env:RUSTFLAGS = "-C target-feature=+crt-static"
230-
cargo build --release 2>&1 | ForEach-Object { Write-Host $_ }
231-
if ($LASTEXITCODE -ne 0) {
232-
Write-Host "::error::Failed to build mcp-windbg-rs"
233-
exit 1
234-
}
229+
$repo = "FlorentinoJink/mcp-windbg"
230+
$apiUrl = "https://api.github.com/repos/$repo/releases/latest"
235231
236-
$serverPath = Join-Path $env:GITHUB_WORKSPACE "target\release\mcp-windbg-rs.exe"
237-
if (-not (Test-Path $serverPath)) {
238-
Write-Host "::error::Binary not found at $serverPath"
232+
$release = Invoke-RestMethod -Uri $apiUrl -Headers @{ "User-Agent" = "mcp-windbg-action" }
233+
$asset = $release.assets | Where-Object { $_.name -like '*.exe' } | Select-Object -First 1
234+
if (-not $asset) {
235+
Write-Host "::error::No .exe asset in release $($release.tag_name)"
239236
exit 1
240237
}
241238
242-
Write-Host "Built: $serverPath ($((Get-Item $serverPath).Length) bytes)"
239+
$serverPath = Join-Path $env:GITHUB_WORKSPACE "mcp-windbg-rs.exe"
240+
Write-Host "Downloading $($asset.name) ..."
241+
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $serverPath -UseBasicParsing
242+
243+
Write-Host "Downloaded: $serverPath ($((Get-Item $serverPath).Length) bytes)"
243244
echo "MCP_SERVER_PATH=$serverPath" >> $env:GITHUB_ENV
244245
Write-Host "::endgroup::"
245246

action/mcp_client.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,24 +200,20 @@ def shutdown(self):
200200
if self._proc is None:
201201
return
202202
log("Shutting down MCP server...")
203-
# Capture stderr for debugging
204-
try:
205-
stderr_data = self._proc.stderr.read().decode("utf-8", errors="replace")
206-
if stderr_data.strip():
207-
log(f"MCP server stderr:\n{stderr_data[:2000]}")
208-
except Exception:
209-
pass
210203
try:
211204
self._proc.stdin.close()
212205
except Exception:
213206
pass
214207
try:
215-
self._proc.wait(timeout=10)
208+
self._proc.wait(timeout=5)
216209
log(f"MCP server exited (code={self._proc.returncode}).")
217210
except subprocess.TimeoutExpired:
218-
log("MCP server did not exit in time, killing...")
211+
log("MCP server did not exit in 5s, killing...")
219212
self._proc.kill()
220-
self._proc.wait(timeout=5)
213+
try:
214+
self._proc.wait(timeout=3)
215+
except Exception:
216+
pass
221217
log("MCP server killed.")
222218

223219
# -- low-level transport -------------------------------------------------

0 commit comments

Comments
 (0)