It is not known when Mao Wenxi was born. His family was originally from Gaoyang, although he was probably not born there, as his father Mao Guifan served as the minister of husbandry for the Tang Dynastyimperial government. Mao Wenxi was said to have passed the imperial examinations in the Jinshi class at the young age of 13. At one point, he went to Chengdu and became an official under Wang Jian, the founding emperor of Former Shu, although historical accounts do not indicate whether that was before or after the founding of Former Shu.
Service under Wang Jian
Sometime during Wang Jian's reign as emperor of Former Shu, Mao Wenxi became the chief imperial scholar. In 914, after Wang Jian executed an adoptive son, Wang Zongxun the military governor of Wutai Circuit for disrespecting him, he made Pan the military governor of Wutai and made Mao the minister of rites, as well as acting Shumishi. In or around that year, Wang Jian contemplated a plan suggested to him for conquest of rival Later Liang's Jingnan Circuit — by destroying a dam on the Yangtze River and use the water to flood Jingnan's capital Jiangling Municipality. Mao urged against the plan, stating: Wang Jian agreed and did not carry out the plan. By 917, at which time Mao was carrying the additional honorary title of Situ, he was facing political rivalries with the powerful eunuch Tang Wenyi and Tang's ally, the chancellorZhang Ge. At that time, Mao happened to be preparing to give a daughter in marriage to the son of another chancellor, Yu Chuansu. He held a feast with his family at the Office of the Director of Palace Communications, with music playing, without first receiving approval from Wang Jian. When Wang Jian heard the music and found it odd, Tang used the opportunity to make false accusations against Mao. As a result, Mao was demoted to the position of military advisor to the prefect of Mao Prefecture, while his son Mao Xun was demoted to commoner rank and exiled to Wei Prefecture, and all of Mao Xun's assets were confiscated. Mao Wenxi's younger brother Mao Wenyan was also demoted, while Yu Chuansu was removed from his chancellor position. Mao Wenxi was replaced in his duty as acting director of palace communications by Yu's distant cousin Yu Ningji.
After Wang Jian's reign
At some point, Mao Wenxi must have been recalled to the Former Shu imperial government, for he was described to be among the officials who, along with Wang Jian's son and successor Wang Zongyan, surrendered to the invading army of Later Tang in 925. After Wang Yan was later executed by Later Tang's Emperor Zhuangzong, some Former Shu officials remained in the Later Tang imperial administration while some returned to the Shu lands. Mao appeared to have done the latter, for he was described to have served under Meng Zhixiang, the Later Tang military governor of Xichuan Circuit, who would eventually the founding emperor of an independent state of Later Shu. In particular, Meng favored him, along with Ouyang Jiong and three others, for their poetic abilities. Mao wrote two volumes on the history of Former Shu, one volume on the art of tea, and a number of poems, and was said to have written a particularly famous poem about Mount Wu. Traditional histories did not indicate when he died, including whether it was before or after Meng's establishment of Later Shu.