Curtis and Dominic
Hanuman was a character in the Ramayana. He was son of the god Vayu (god of the wind) and a monkey and was thus a demigod.
The Ramayana chronicles one of the several Incarnations of the god Vishnu on earth in the form of a Prince.
The villain (Ravana) and his brother (Kumbhakarna) were the incarnations of some St. Peter like gate guards of Vishnu's abode.The pissed of a couple of child sages (well they look like children) and were cursed. They begged forgiveness and were offered the choice to live as gods for four lifetimes or be reborn as demons and be killed by Vishnu seven times. The chose the latter option with the idea that living as gods they would enjoy themselves but would not have as close a relationship with Vishnu, but if they were his enemy they would get killed by him directly and would be much closer to him.
The details above vary from version to version, but I never saw a connection between the Monkey King and Hanuman, but that could because of my exposure to Hanuman for decades before I caught wind of the Monkey King. I also do not find much literary comparison, but my research is not extensive.