Run away and shoot arrows. This is going to be your basic strategy. If he tries to dair camp you, run away. Most MK's will dair camp and then nado on their last jump, always hold shield up whenever he uses nado, this will prevent you from getting shieldpoked. You can 100% punish tornado with Pit this way. If he's really close, fsmash. If he's too far away to Fsmash but still kind of close, dash attack. If he's far away then just arrow him to punish his ending lag.
Don't be too predictable with your jumps and up b, don't try to glide if he chases you offstage. MK's up b > your glide. Try to ban stages where you cannot go under(PS1, YI), since going under the stage is really safe in this match up(your up b speed > MK's running speed).
Whenever he's offstage, just shoot arrows. It's too risky to chase him. A good MK won't let his recovery get reversed by your mirror shield, just forget it. You'll just get damage for trying. There's only one safe way to reverse his recovery and that's whenever you arrowed all his jumps and force him to use his side b or tornado, then you MIGHT gimp him. (Side b can be aimed upwards after reversed to make MK still land onstage, nado can be aimed at the stage again even after reversing it).
Punish his approaches with jabs and dtilts. Punish nair with utilt unless it's a retreating nair ofcourse. Do NOT approach if both characters are on the ground. SH nair will barely work. You could chase him when you're under him, but watch out for his dair. Retreating fairs might work, but I think he can grab you or do a dash attack.
Do NOT approach him if he planks. Pit is one of the few characters that can handle planking easily: by arrow looping. It'll probably take you a while but it's possible to damage MK if he planks if you loop an arrow correctly. Most MK's will get scared and stop with planking whenever you hit them. Be on your guard, though. You probably won't pay attention when you're looping so MK could do a quick nado approach while you're looping to hit you. Don't loop to close to the edge he's planking on so he cannot punish your looping. (lol at me promoting arrow looping, I normally hate it)
You'll kill MK quite early if your kill moves are fresh. The most important thing is: 'DO NOT FORGET TO SHOOT ARROWS WHENEVER YOU WANT TO KILL YOUR OPPONENT'. Don't just run into your opponent and spam fsmash, that won't work. Keep shooting arrows until you can get a kill move in, it's safe most of the time anyways since your opponent will probably camp because he's at a high %, and he has to approach you since you have the good projectile here. Bair kills really fast but is really hard to land on MK. Fsmash will kill him a bit later but your fsmash probably won't be fresh since it's a good move overall. Dsmash could kill him, and don't forget about dash attack (which is so underrated but kills him at around 130% if sweetspotted).
MK will kill you at around 140~160% if you play this match up correctly. Dsmash, up b and nair are his main killing moves. Up B OoS is just too good and gets me killed most of the time, it'll send you upwards and it'll kill you at around 150%. Be aware that MK can just Dsmash again if you shield his dsmash for the first time. It's a hard to punish move. Nair is just basic imo.
This match up is really stage dependent, try to pick FD or SV. Avoid YI and PS1. BF isn't that great but going to BF is better than going to YI.
Might've forgotten some things, ask me questions if you want to know something.