dpgaspar commented on code in PR #35163:
URL: https://github.com/apache/superset/pull/35163#discussion_r2366749328
##########
superset/mcp_service/simple_proxy.py:
##########
@@ -0,0 +1,74 @@
+#!/usr/bin/env python3
+"""
+Simple MCP proxy server that connects to FastMCP server on localhost:5008
+"""
+
+import logging
+import signal
+import sys
+import time
+from typing import Any, Optional
+
+from fastmcp import FastMCP
+
+# Configure logging
+logging.basicConfig(
+ level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s -
%(message)s"
+)
+logger = logging.getLogger(__name__)
+
+# Global proxy instance for cleanup
+proxy: Optional[FastMCP] = None
+
+
+def signal_handler(signum: int, frame: Any) -> None:
+ """Handle shutdown signals gracefully"""
+ logger.info("Received signal %s, shutting down gracefully...", signum)
+ if proxy:
+ try:
+ # Give the proxy a moment to clean up
+ time.sleep(0.1)
Review Comment:
ooof, not a blocker, but sleeps are usually not a maintainable solution
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]