diff --git a/mcp/server.py b/mcp/server.py index 89aeccb..f895991 100755 --- a/mcp/server.py +++ b/mcp/server.py @@ -99,10 +99,17 @@ def _run_via_hubris(remote_host: str, cmd: list[str], f"{SSH_USER}@{HUBRIS_HOST}", joined, ] - return subprocess.run( + proc = subprocess.run( ssh_args, capture_output=True, text=True, timeout=timeout or SSH_TIMEOUT * 3, ) + if proc.returncode != 0: + import logging as _l + _l.getLogger("homelab-mcp").warning( + "ssh failed rc=%s host=%s cmd=%r stderr=%r", + proc.returncode, remote_host, joined, proc.stderr.strip(), + ) + return proc def _service_to_host(service: str) -> str: