They have master cylinder rebuild kits, but they cost almost as much as a good rebuilt one, so considering as cheap as the master cylinders are I'd just buy one and replace it.
It is not too hard of a job if you know how to bleed your brakes, which includes bleeding them in the proper sequence.
Wheel Bleeding Sequence
Rear wheel drive models: if manual bleeding, RR-LR-RF-LF; if pressure bleeding, bleed front brakes together and rear brakes together.
Front wheel drive models: RR-LF-LR-RF
Remove and replace brake master cylinder