Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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":
Expand Down