From 17e9272a536feae3cb12ab0ee269b62bbeddeab2 Mon Sep 17 00:00:00 2001 From: Eleftheria Stein-Kousathana Date: Mon, 16 Feb 2026 16:12:15 +0100 Subject: [PATCH] mac fix --- main.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index f40c9b7..d9a0f9a 100644 --- a/main.py +++ b/main.py @@ -262,11 +262,8 @@ async def get_tool_details(server: str, tool_name: str) -> str: sys.exit(1) # Check if running in container (ToolHive will manage thv serve) - # If TOOLHIVE_HOST is set or RUNNING_IN_DOCKER=1, we're in container mode - in_container = ( - os.environ.get("TOOLHIVE_HOST") is not None - or os.environ.get("RUNNING_IN_DOCKER") == "1" - ) + # If TOOLHIVE_HOST is set, we're in container mode and shouldn't start thv serve + in_container = os.environ.get("TOOLHIVE_HOST") is not None if not in_container: # Local development mode: Initialize ToolHive client - starts thv serve and lists workloads @@ -309,7 +306,7 @@ async def get_tool_details(server: str, tool_name: str) -> str: if "--host" not in sys.argv: mcp_host_env = os.environ.get("MCP_HOST") - if mcp_host_env: + if mcp_host_env and not in_container: host = mcp_host_env if transport == "stdio":