Skip to content

Self-hosted homelab infrastructure visualizer — interactive network diagram with live status monitoring

fix(mcp): handle uninitialized backend client

Sebastianc9ba702a717d
diff --git a/mcp/app/backend_client.py b/mcp/app/backend_client.py
index 4487db1..2ab3b56 100644
--- a/mcp/app/backend_client.py
+++ b/mcp/app/backend_client.py
@@ -61,6 +61,8 @@ class BackendClient:
await self._client.aclose()
async def request(self, method: str, path: str, **kwargs) -> dict:
+ if self._client is None:
+ raise BackendError(method, path, 503, "Backend client not initialized — startup failed")
resp = await self._client.request(method, path, **kwargs)
if resp.is_error:
raise BackendError(method, path, resp.status_code, _detail_of(resp))