File tree Expand file tree Collapse file tree
src/greptimedb_mcp_server Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import asyncio
22import sys
33
4- if sys .platform == "win32" :
4+ # Windows: use SelectorEventLoop for HTTP transports (signal handling),
5+ # but keep ProactorEventLoop for stdio (pipe I/O support)
6+ if sys .platform == "win32" and any (t in sys .argv for t in ("sse" , "streamable-http" )):
57 asyncio .set_event_loop_policy (asyncio .WindowsSelectorEventLoopPolicy ())
68
7- if "-m" not in sys .argv :
8- from . import server
9-
109
1110def main ():
1211 """Main entry point for the package."""
12+ from . import server
13+
1314 try :
1415 server .main ()
1516 except KeyboardInterrupt :
@@ -19,4 +20,4 @@ def main():
1920
2021
2122# Expose important items at package level
22- __all__ = ["main" , "server" ]
23+ __all__ = ["main" ]
Original file line number Diff line number Diff line change 11"""GreptimeDB MCP Server using FastMCP API."""
22
3+ import asyncio
4+ import sys
5+
6+ # Windows: use SelectorEventLoop for HTTP transports (signal handling),
7+ # but keep ProactorEventLoop for stdio (pipe I/O support)
8+ if sys .platform == "win32" and any (t in sys .argv for t in ("sse" , "streamable-http" )):
9+ asyncio .set_event_loop_policy (asyncio .WindowsSelectorEventLoopPolicy ())
10+
311from greptimedb_mcp_server .config import Config
412from greptimedb_mcp_server .formatter import format_results , VALID_FORMATS
513from greptimedb_mcp_server .utils import (
1523 audit_log ,
1624)
1725
18- import asyncio
1926import json
2027import logging
2128import re
You can’t perform that action at this time.
0 commit comments