feat(ssh): make SSH server optional with --ssh flag

- Added --ssh flag to session create command
- Modified mc-init.sh to check MC_SSH_ENABLED environment variable
- SSH server is now disabled by default
- Updated README.md with new flag example
- Fixed UnboundLocalError with container_name in exception handler
This commit is contained in:
2025-04-01 18:57:39 -06:00
parent 30c6b995cb
commit 5678438661

View File

@@ -394,9 +394,16 @@ class ContainerManager:
except Exception as e:
print(f"Warning: Failed to start MCP server '{mcp_name}': {e}")
# Remove from the container names list if failed
if container_name in mcp_container_names:
mcp_container_names.remove(container_name)
# Get the container name before trying to remove it from the list
try:
container_name = self.mcp_manager.get_mcp_container_name(
mcp_name
)
if container_name in mcp_container_names:
mcp_container_names.remove(container_name)
except Exception:
# If we can't get the container name, just continue
pass
elif mcp_config.get("type") == "remote":
# For remote MCP, just set environment variables