fix(mcp-server): resolve Windows native host collision and CLI detection#16
Conversation
- Ensure each browser has a unique manifest directory on Windows - Use shell: true in spawnSync to correctly find .cmd CLIs on Windows
There was a problem hiding this comment.
Pull request overview
This PR addresses Windows-specific setup reliability issues in @onui/mcp-server by preventing native host manifest overwrites between browsers and improving detection/execution of .cmd-wrapped CLIs.
Changes:
- Make Windows native host manifest directories browser-specific to avoid collisions.
- Use
spawnSync(..., { shell: process.platform === 'win32' })forclaude/codexCLI detection and MCP registration operations. - Apply the same Windows shell behavior in doctor checks for
claude/codexMCP registration.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/mcp-server/src/store/path.ts | Adds per-browser subdirectory for native host manifests on Windows (and fallback default). |
| packages/mcp-server/src/setup/configure-codex.ts | Ensures codex is discoverable on Windows by enabling shell execution. |
| packages/mcp-server/src/setup/configure-claude.ts | Ensures claude is discoverable on Windows by enabling shell execution. |
| packages/mcp-server/src/doctor/checks/codex-mcp.ts | Uses shell execution on Windows to reliably check codex availability/registration. |
| packages/mcp-server/src/doctor/checks/claude-mcp.ts | Uses shell execution on Windows to reliably check claude availability/registration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
+1 — 確認這個 PR 在 Windows 11 真實安裝環境修好了 bug。 我今天踩到這 bug,用的是 Chrome Web Store 擴充 + installer v2.2.3。花了大約 3 小時才追到根因,因為 Chrome 的錯誤訊息很誤導 —— 看起來像 JSON 格式問題,但其實是這 PR 修的問題:Windows 上三個 browser 共用同一個 manifest 檔,Firefox 寫最後(只有 allowed_extensions)覆蓋掉 Chrome 的 manifest(裡面有 allowed_origins)。 我把這 PR cherry-pick 到 fork(附連結)、重 build、替換安裝。結果:每個 browser 各自獨立子目錄,allowlist 正確,Local bridge 立刻從 unavailable 變 ok。 額外好處:shell: true 那個修法讓 Windows 上的 Codex MCP 註冊也修好了 —— setup 輸出從「找不到 codex CLI」變成「Codex MCP 設定完成」。 希望能 merge。需要進一步測試我可以幫忙。 |
|
Hi, @PavelA85 small comment, add a win32 test case to packages/mcp-server/src/store/path.test.ts asserting Chrome/Edge/Firefox resolve to distinct manifest paths. The collision fix is the headline change in this PR and it currently has zero test coverage. Without it, the bug can silently regress. added the tests myself. |
Asserts Chrome, Edge, and Firefox resolve to distinct manifest paths on Windows, locking in the collision fix from this PR. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This PR fixes two issues on Windows: