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:

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