Skip to content

Commit 2013bad

Browse files
kantordeleftherias
andauthored
fix host on mac
Co-authored-by: Eleftheria Stein-Kousathana <eleftheria@stacklok.com>
1 parent 0d435fc commit 2013bad

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

main.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,8 @@ async def get_tool_details(server: str, tool_name: str) -> str:
262262
sys.exit(1)
263263

264264
# Check if running in container (ToolHive will manage thv serve)
265-
# If TOOLHIVE_HOST is set or RUNNING_IN_DOCKER=1, we're in container mode
266-
in_container = (
267-
os.environ.get("TOOLHIVE_HOST") is not None
268-
or os.environ.get("RUNNING_IN_DOCKER") == "1"
269-
)
265+
# If TOOLHIVE_HOST is set, we're in container mode and shouldn't start thv serve
266+
in_container = os.environ.get("TOOLHIVE_HOST") is not None
270267

271268
if not in_container:
272269
# 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:
309306

310307
if "--host" not in sys.argv:
311308
mcp_host_env = os.environ.get("MCP_HOST")
312-
if mcp_host_env:
309+
if mcp_host_env and not in_container:
313310
host = mcp_host_env
314311

315312
if transport == "stdio":

0 commit comments

Comments
 (0)