fix(build): cleanly terminate all mcp binaries on deploy and supply bearer token to shutdown

This commit is contained in:
Riz Ashraf committed 2026-09-22 06:58:38 +01:00
1 parent d8285a41c7
commit 9b9b403ef2
1 file changed
+2 -2
+2 -2
View File
@@ -7,9 +7,9 @@ deploy-all: deploy-win deploy-wsl
# Gracefully shut down the running server
shutdown-server:
Write-Host "Shutting down MCP server gracefully..." -ForegroundColor Cyan
-Invoke-RestMethod -Uri "http://127.0.0.1:3000/shutdown" -Method Post -ErrorAction SilentlyContinue
-$token = Get-Content "$env:USERPROFILE\.gemini\mcp_memory\admin.token" -ErrorAction SilentlyContinue; if ($token) { Invoke-RestMethod -Uri "http://127.0.0.1:3000/shutdown" -Method Post -Headers @{ Authorization = "Bearer $token" } -ErrorAction SilentlyContinue } else { Invoke-RestMethod -Uri "http://127.0.0.1:3000/shutdown" -Method Post -ErrorAction SilentlyContinue }
Start-Sleep -Seconds 1
if (Get-Process mcp-memory-server -ErrorAction SilentlyContinue) { Stop-Process -Name mcp-memory-server -Force -ErrorAction SilentlyContinue }
-if (Get-Process mcp-memory-server, mcp-memory-stub, mcp-memory-win-nvim -ErrorAction SilentlyContinue) { Stop-Process -Name mcp-memory-server, mcp-memory-stub, mcp-memory-win-nvim -Force -ErrorAction SilentlyContinue }
# Build and deploy Windows-native binaries
deploy-win: shutdown-server