You must configure the espESP as an apAP, if you want it to have it'sits own IP. You then set up a tcp-server on the espESP (i think there are example functions in the ideIDE).
Keep in mind, that the communication (server/client you mentioned) has nothing to do with the way pcPC and espESP are connected with (whether the espESP is providing an accesspointAccess Point or logged into your wifiWiFi). Those are different protocol layers, which means you will not need to make any changes if you want pcPC and espESP communicate over your router at all.
Actually the espESP (or at least for the esp8266ESP8266-12f12F I know for sure) is capable of running both ap and wificlient at the same time It's.
It's not a big difference to serial communication, you will need to poll for incomming messages in your loop if you want to run a server. Sending messages to your pcPC is like printing to the serial interface.