File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import json
33import logging
44from typing import Dict , Any , Optional
5+ import asyncio
56
67from fastmcp import FastMCP
78from pydantic import BaseModel , Field
@@ -565,6 +566,16 @@ async def calculate_token_amount_from_dollars(
565566 }
566567
567568
569+ async def run_as_server ():
570+ await mcp .run_async (
571+ transport = "http" ,
572+ host = "127.0.0.1" ,
573+ port = 8080 ,
574+ )
575+
576+ def run_standard_server ():
577+ mcp .run ()
578+
568579if __name__ == "__main__" :
569580 try :
570581 config = get_config ()
@@ -576,7 +587,8 @@ async def calculate_token_amount_from_dollars(
576587 log_path = os .path .join (os .path .dirname (os .path .abspath (__file__ )), 'hyperliquid_mcp.log' )
577588 logger .info (f"Logs will be written to: { log_path } " )
578589
579- mcp .run ()
590+ # run_standard_server()
591+ asyncio .run (run_standard_server ())
580592 except Exception as e :
581593 logger .error (f"Failed to start server: { e } " )
582594 print (f"Failed to start server: { e } " )
You can’t perform that action at this time.
0 commit comments