From 488ec56938a85b455064b90b74c27df549a04aa9 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Thu, 25 Dec 2025 19:50:55 -0800 Subject: [PATCH] fix(mcp): Graceful fallback on Windows for daemon mode (GH#387) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Skip daemon mode on Windows (sys.platform == win32) - Falls back to CLI mode which works on all platforms - Avoids asyncio.open_unix_connection which does not exist on Windows 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- CHANGELOG.md | 5 +++++ integrations/beads-mcp/src/beads_mcp/bd_client.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22426071..f8a37d5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -88,6 +88,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Moved write stream creation after redirect handling to avoid orphan streams - Added delay after file close to ensure Windows releases file handle +- **Windows MCP daemon mode crash** (GH#387) - Windows compatibility + - beads-mcp now gracefully falls back to CLI mode on Windows + - Avoids `asyncio.open_unix_connection` which doesn't exist on Windows + - Daemon mode still works on Unix/macOS + - **FatalErrorRespectJSON** (bd-28sq) - Consistent error output - All commands respect `--json` flag for error output - Errors return proper JSON structure when flag is set diff --git a/integrations/beads-mcp/src/beads_mcp/bd_client.py b/integrations/beads-mcp/src/beads_mcp/bd_client.py index 056fa8aa..5620d13a 100644 --- a/integrations/beads-mcp/src/beads_mcp/bd_client.py +++ b/integrations/beads-mcp/src/beads_mcp/bd_client.py @@ -831,6 +831,11 @@ def create_bd_client( If prefer_daemon is True and daemon is not running, falls back to CLI client. To check if daemon is running without falling back, use BdDaemonClient directly. """ + # Windows doesn't support Unix domain sockets (GH#387) + # Skip daemon mode entirely on Windows + if prefer_daemon and sys.platform == 'win32': + prefer_daemon = False + if prefer_daemon: try: from .bd_daemon_client import BdDaemonClient