From 67739fbdc772a0ee8481f565493a2b6f99bf72f9 Mon Sep 17 00:00:00 2001 From: Baishampayan Ghose Date: Fri, 17 Oct 2025 00:08:14 +0530 Subject: [PATCH] fix(mcp): Fix AsyncIO crash on Windows Since our implementation uses `async` IO for subprocess communication, it's crucial to utilize the `fastMCP.run_async()` entry-point of FastMCP. This should fix crashes on Windows. ref: steveyegge/beads#53 --- integrations/beads-mcp/src/beads_mcp/server.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/integrations/beads-mcp/src/beads_mcp/server.py b/integrations/beads-mcp/src/beads_mcp/server.py index ddaa3a81..6e270f3c 100644 --- a/integrations/beads-mcp/src/beads_mcp/server.py +++ b/integrations/beads-mcp/src/beads_mcp/server.py @@ -1,5 +1,6 @@ """FastMCP server for beads issue tracker.""" +import asyncio import os import subprocess from functools import wraps @@ -374,9 +375,14 @@ async def debug_env() -> str: return "".join(info) +async def async_main() -> None: + """Async entry point for the MCP server.""" + await mcp.run_async(transport="stdio") + + def main() -> None: """Entry point for the MCP server.""" - mcp.run() + asyncio.run(async_main()) if __name__ == "__main__":