How do I run a microPython run without a PC

I want the xbee to receive serial data from a microcontroler Tx/Rx and post that data trough MQTT
This is explained here:
https://www.digi.com/resources/documentation/digidocs/90001525/tasks/t_use_mqtt.htm

My question is how do I make xbee run this code, how do I send MQTT parameters (IP, topic, payload) through serial?