@dpcons that is correct. The ESP communicates directly with the MQTT broker.
It's very easy if you're ESP has been Tasmotized. I am of the understanding that one can compile their own Tasmota binary to suit particular needs. I have not done this.
If you're using the Arduino IDE to program your ESP, it is possible to communicate directly to the MQTT broker. You will have to come up with your own protocol though, This I have done and it takes some perseverence.
Both Tasmota and Arduino IDE accomodate Over-The-Air (OTA) updates. This is nice, especially when your device is behind a panel or up the hill. Interestingly enough, if something is Tasmotized, an Arduino IDE binary can replace it OTA; and vice versa. This I have done many times. (Yes, some failures to communicate and a hike up the hill