Small enough leak in PCV hose will do it with same result.
Your vacuum leak would be power booster not master cylinder. Quick way to check. Go somewhere like big parking lot at 3 in the morning and disconnect booster vacuum supply hose and plug it. Your brakes will have no power assist then so much harder to push pedal and car will not stop as quick, the reason for being in big space by yourself. If the motor at that time idles correctly then problem is the booster.
Passenger side engine mount going bad can seem to idle rough if motor beginning to shake, it will show every time you put on brake and disappear as soon as you let off. The difference is true engine roughness versus vibration felt through chassis, the two often perceived by many as the same thing................