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
This commit is contained in:
Baishampayan Ghose
2025-10-17 00:08:14 +05:30
parent ee94d817ed
commit 67739fbdc7

View File

@@ -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__":