async def test_create_mcp_clients_success(mock_mcp_client):
    """Test successful creation of MCP clients."""
    # Setup mock
    mock_client_instance = AsyncMock()
    mock_mcp_client.return_value = mock_client_instance
    mock_client_instance.connect_http = AsyncMock()

    # Test with two servers
    server_configs = [
        MCPSSEServerConfig(url='http://server1:8080'),
        MCPSSEServerConfig(url='http://server2:8080', api_key='test-key'),
    ]

    clients = await openhands.mcp.utils.create_mcp_clients(server_configs, [])

    # Verify
    assert len(clients) == 2
    assert mock_mcp_client.call_count == 2

    # Check that connect_http was called with correct parameters
    mock_client_instance.connect_http.assert_any_call(
        server_configs[0], conversation_id=None
    )
    mock_client_instance.connect_http.assert_any_call(
        server_configs[1], conversation_id=None
    )
Test successful creation of MCP clients.
tests/unit/test_mcp_utils.py