Is it the original Master Cylinder or have you changed some of the parts inside.
I had the non return valve at the end of the MC snap off (or it can just float around, working sometimes). This stopped the fluid releasing and basically the pedal locked up and I had no brakes. These were new replacement parts. I changed them for more new replacement parts and it has been good ever since.
Shouldn’t need to pull the engine for brakes though.
Ian