From a89cefc53e67fe12d3416f9b8d8be74715567879 Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Sat, 25 Apr 2026 19:25:03 +0200 Subject: [PATCH] fix(mcpb): add Windows support via platform_overrides and run.cmd The previous manifest hardcoded /bin/sh which fails on Windows. Fix by: - Adding mcpb/run.cmd: Windows batch wrapper that searches common uvx install locations (%USERPROFILE%\.local\bin, %LOCALAPPDATA%\uv\bin, %USERPROFILE%\.cargo\bin) before falling back to PATH, with a clear error message pointing to winget/PowerShell install instructions - Adding platform_overrides.win32 in mcp_config to use cmd /c run.cmd on Windows while macOS/Linux continue using /bin/sh run.sh - Expanding compatibility.platforms to include win32 Co-Authored-By: Claude Sonnet 4.6 --- mcpb/manifest.json | 8 +++++++- mcpb/run.cmd | 27 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 mcpb/run.cmd diff --git a/mcpb/manifest.json b/mcpb/manifest.json index 8cd1166c..2b19bf44 100644 --- a/mcpb/manifest.json +++ b/mcpb/manifest.json @@ -25,11 +25,17 @@ "NEXTCLOUD_HOST": "${user_config.nextcloud_host}", "NEXTCLOUD_USERNAME": "${user_config.nextcloud_username}", "NEXTCLOUD_PASSWORD": "${user_config.nextcloud_password}" + }, + "platform_overrides": { + "win32": { + "command": "cmd", + "args": ["/c", "${__dirname}/run.cmd"] + } } } }, "compatibility": { - "platforms": ["darwin", "linux"] + "platforms": ["darwin", "linux", "win32"] }, "tools_generated": true, "user_config": { diff --git a/mcpb/run.cmd b/mcpb/run.cmd new file mode 100644 index 00000000..22c50633 --- /dev/null +++ b/mcpb/run.cmd @@ -0,0 +1,27 @@ +@echo off +REM Locate uvx — tries common Windows install locations first, then PATH + +for %%P in ( + "%USERPROFILE%\.local\bin\uvx.exe" + "%USERPROFILE%\.cargo\bin\uvx.exe" + "%LOCALAPPDATA%\uv\bin\uvx.exe" +) do ( + if exist %%P ( + %%P nextcloud-mcp-server run --transport stdio + exit /b %errorlevel% + ) +) + +REM Fall back to uvx on PATH if found +where uvx >nul 2>&1 +if %errorlevel% equ 0 ( + uvx nextcloud-mcp-server run --transport stdio + exit /b %errorlevel% +) + +REM uvx not found — print actionable error +echo Error: 'uvx' was not found in any expected location. >&2 +echo Install uv (which provides uvx) from: https://docs.astral.sh/uv/getting-started/installation/ >&2 +echo Windows: winget install astral-sh.uv >&2 +echo or: powershell -c "irm https://astral.sh/uv/install.ps1 | iex" >&2 +exit /b 1