"a buffoon; a zany; a jack-pudding" [Johnson], "One whose business it is to make sport for others by jokes and ridiculous posturing" [Century Dictionary], according to OED, in early use properly a mountebank's assistant, 1670s, from merry + masc. proper name Andrew, but there is no certain identification with an individual, and the name here may be generic.