diff --git a/src/mcrentcast/server.py b/src/mcrentcast/server.py index fd55999..670f21e 100644 --- a/src/mcrentcast/server.py +++ b/src/mcrentcast/server.py @@ -768,15 +768,16 @@ else: def main(): """Main entry point for the MCP server.""" - # FastMCP handles the stdio communication automatically - # when the module is imported - pass + # Run the FastMCP server + import asyncio + try: + asyncio.run(app.run()) + except KeyboardInterrupt: + pass + except Exception as e: + logger.error(f"Server error: {e}") + raise if __name__ == "__main__": - # Keep the process running for MCP communication - import asyncio - try: - asyncio.get_event_loop().run_forever() - except KeyboardInterrupt: - pass \ No newline at end of file + main() \ No newline at end of file