Yoshi vs MK is massively overhyped. Once MK realizes there's no reason to stop swinging his sword vs a Yoshi, the only thing Yoshi has going for him is a grab release that - sometimes - deals 25 damage, and will score a kill at like 170% damage. Tails and feet are not nearly disjoint enough or high enough in damage to keep up with MK, and Yoshi gets gimped hard.
Yoshi's cool, but MK is not a reason to play him.
Beating a spammy MK is about extreme patience and fast reaction time. If he does a glide attack after an up-B, you can powershield it then punish with grab or something. Altenatively, Olimar's pivot grab is probably disjoint enough to catch him before even the absurdly long range glide attack can hit you. If he goes for the grab, you have all your typical anti-grab options available to you, provided you see it coming - attack, spotdodge, or even just grab first; olimar's got enough range for it.