From 41bd8445e950dd288c8efd23977edd0aae143980 Mon Sep 17 00:00:00 2001 From: Ryan Malloy Date: Fri, 6 Feb 2026 00:49:41 -0700 Subject: [PATCH] fix: Make docker_health use current instance port by default docker_health now uses get_instance_port(port) like all other tools, so it defaults to the current working instance when no port is specified. Workflow: 1. docker_auto_start(binary) -> returns port 2. Poll docker_health(port=N) until healthy 3. instances_use(port=N) to set as current 4. All subsequent analysis calls omit port --- src/ghydramcp/mixins/docker.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ghydramcp/mixins/docker.py b/src/ghydramcp/mixins/docker.py index f81e31b..aed393f 100644 --- a/src/ghydramcp/mixins/docker.py +++ b/src/ghydramcp/mixins/docker.py @@ -881,17 +881,18 @@ class DockerMixin(MCPMixin): description="Check if a GhydraMCP container's API is responding", ) async def docker_health( - self, port: int = 8192, timeout: float = 5.0, ctx: Optional[Context] = None + self, port: Optional[int] = None, timeout: float = 5.0, ctx: Optional[Context] = None ) -> Dict[str, Any]: """Check if a GhydraMCP container's API is healthy. Args: - port: API port to check (default: 8192) + port: API port to check (uses current instance if not specified) timeout: Request timeout in seconds Returns: Health status and API info if available """ + port = self.get_instance_port(port) loop = asyncio.get_event_loop() return await loop.run_in_executor( None, self._sync_health_check, port, timeout @@ -982,7 +983,7 @@ class DockerMixin(MCPMixin): "container_name": start_result.get("name"), "port": actual_port, "api_url": f"http://localhost:{actual_port}/", - "message": f"Container starting on port {actual_port}. Poll docker_health(port={actual_port}) to check when ready.", + "message": f"Container starting on port {actual_port}. Poll docker_health(port={actual_port}), then call instances_use(port={actual_port}) when healthy.", } @mcp_tool(