Convert UDP packet script to TCP packet

The answer it's the same Ethernet library you are already using (there's no specific "EthernetTcp" library, just Ethernet).
The main difference is that TCP requires the establishment of a connection, so there are two different behaviors: the client requests the connection, while the server waits for incoming connection requests. From your code I think that the Arduino will work in the role of the server (EthernetServer). It will wait until some data (a request from the outside) is available(), then a Client will be created on the spot to read the incoming message, and finally the server will send the response to the outside client and close the connection.