Spaces:
Paused
Paused
Update calculator_server.py
Browse files- calculator_server.py +7 -3
calculator_server.py
CHANGED
|
@@ -37,7 +37,11 @@ def divide(a: float, b: float) -> float:
|
|
| 37 |
# 3. Add a main block to run the server
|
| 38 |
if __name__ == "__main__":
|
| 39 |
port = int(os.environ.get("PORT", 7860))
|
| 40 |
-
logger.info(f"Starting FastMCP server on port {port}")
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
# 3. Add a main block to run the server
|
| 38 |
if __name__ == "__main__":
|
| 39 |
port = int(os.environ.get("PORT", 7860))
|
| 40 |
+
logger.info(f"Starting FastMCP server on host 0.0.0.0 port {port}")
|
| 41 |
|
| 42 |
+
try:
|
| 43 |
+
# Remove the debug parameter - it's not supported
|
| 44 |
+
mcp.run(transport="streamable-http", host="0.0.0.0", port=port)
|
| 45 |
+
except Exception as e:
|
| 46 |
+
logger.error(f"Failed to start server: {e}")
|
| 47 |
+
raise
|