Mess John is the old epithet in Scottish ballad poetry for a priest, derived from the celebration of the mass, so that "Mess John" signified in irreverent phrase, John who celebrated the mass. The English have a kindred phrase, "Jack Priest".
References
Mess John Wikipedia(Text) CC BY-SA