From b7fa58e256642c88c26556b1cbf386651d2c7653 Mon Sep 17 00:00:00 2001 From: wcollins Date: Thu, 28 Aug 2025 20:53:14 -0400 Subject: [PATCH 1/3] Update default ports --- docker-compose.dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 6da3d8e..d075009 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -7,7 +7,7 @@ services: image: torero-local container_name: torero ports: - - "22:22" + - "2222:22" - "8001:8001" - "8080:8080" volumes: From 2a17ac11d954ee5e281c0a9223dd4556c5c75339 Mon Sep 17 00:00:00 2001 From: wcollins Date: Thu, 28 Aug 2025 20:53:22 -0400 Subject: [PATCH 2/3] Update default ports --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3b9ae47..0d68141 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: image: ghcr.io/torerodev/torero-container:latest container_name: torero ports: - - "22:22" + - "2222:22" - "8001:8001" - "8080:8080" volumes: From 25a7823dd2ed037af73c981ebe5fd1bf131d043d Mon Sep 17 00:00:00 2001 From: wcollins Date: Thu, 28 Aug 2025 20:55:11 -0400 Subject: [PATCH 3/3] Support additional formats --- opt/torero-mcp/torero_mcp/executor.py | 49 +++++++++++++++++++++------ 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/opt/torero-mcp/torero_mcp/executor.py b/opt/torero-mcp/torero_mcp/executor.py index 9b07b9b..6726ab9 100644 --- a/opt/torero-mcp/torero_mcp/executor.py +++ b/opt/torero-mcp/torero_mcp/executor.py @@ -155,8 +155,15 @@ async def get_services(self) -> List[Dict[str, Any]]: raw_output = await self.execute_command(["get", "services", "--raw"]) # handle different response formats - if isinstance(raw_output, dict) and "items" in raw_output: - return raw_output["items"] + if isinstance(raw_output, dict): + if "items" in raw_output: + return raw_output["items"] + elif "services" in raw_output: + return raw_output["services"] + else: + + # if dict has no known key, raise error + raise ToreroExecutorError(f"unexpected json structure: dict with keys {list(raw_output.keys())}") elif isinstance(raw_output, list): return raw_output else: @@ -186,10 +193,15 @@ async def get_decorators(self) -> List[Dict[str, Any]]: """get all decorators.""" raw_output = await self.execute_command(["get", "decorators", "--raw"]) - if isinstance(raw_output, dict) and "decorators" in raw_output: - return raw_output["decorators"] - elif isinstance(raw_output, dict) and "items" in raw_output: - return raw_output["items"] + if isinstance(raw_output, dict): + if "decorators" in raw_output: + return raw_output["decorators"] + elif "items" in raw_output: + return raw_output["items"] + else: + + # if dict has no known key, raise error + raise ToreroExecutorError(f"unexpected json structure: dict with keys {list(raw_output.keys())}") elif isinstance(raw_output, list): return raw_output else: @@ -220,8 +232,18 @@ async def get_secrets(self) -> List[Dict[str, Any]]: """get all secrets.""" raw_output = await self.execute_command(["get", "secrets", "--raw"]) - if isinstance(raw_output, dict) and "items" in raw_output: - return raw_output["items"] + if isinstance(raw_output, dict): + if "items" in raw_output: + return raw_output["items"] + elif "secrets" in raw_output: + return raw_output["secrets"] + elif "names" in raw_output: + # Handle case where only names are returned + return raw_output["names"] + else: + + # if dict has no known key, raise error + raise ToreroExecutorError(f"unexpected json structure: dict with keys {list(raw_output.keys())}") elif isinstance(raw_output, list): return raw_output else: @@ -236,8 +258,15 @@ async def get_registries(self) -> List[Dict[str, Any]]: """get all registries.""" raw_output = await self.execute_command(["get", "registries", "--raw"]) - if isinstance(raw_output, dict) and "items" in raw_output: - return raw_output["items"] + if isinstance(raw_output, dict): + if "items" in raw_output: + return raw_output["items"] + elif "registries" in raw_output: + return raw_output["registries"] + else: + + # if dict has no known key, raise error + raise ToreroExecutorError(f"unexpected json structure: dict with keys {list(raw_output.keys())}") elif isinstance(raw_output, list): return raw_output else: