They're easy to rebuild. Usually it's a spring/ring clip, a piston, a seal and a cup, with a dust cover. Doing the work isn't the big deal. Doing the work while clean and knowing what to look for is the bigger issue.
9 times out of 10, maybe 8 times out of 10, it's a temporary solution. The seals go bad because of rust or dirt in the cylinder, and there is scoring in the bore that will rear its ugly head again at some point.
"The only variable is time." -- Quentin Barnes, GFL Series, Scott Sigler
For a life-critical thing like brakes, certainly for the master cylinder, I'd replace new. I've rebuilt plenty of calipers with great success, and some master cylinders, too, but I completely believe it's a band aid.
If you want to try a rebuild, go to a decent auto parts store, and get a proper parts cleaner dunk tank (usually sold in 1-gallon cans with a basket, around $35), and some soft bristle bore brushes.
Or just order this:
https://www.amazon.com/Berryman-Products-0996-Arm-Chemical-Fluid_Ounces/dp/B077Y1YSZ5You want to make sure the bore is pristine before you even think about putting it back together. Then get some brake cleaner to clean up after you water-rinse the dunk cleaner off, then immediately coat the inner bore with brake fluid (clean, new) and inspect it as carefully as you can. If you see ANY scoring along the length of the bore, just buy a new one. It's just not worth futzing with; you don't have and don't want to pay for the stuff to re-hone it. Plus, it's aluminum, and require a finesse that most machine shops used to doing cars won't or can't do.
I can't really over emphasize how critical it is to just skip the rebuild if there's any scoring.
If not, and you just have worn rubbers, go for it.
But!!!!!!!
FULL BLEED!
All DOT-class brake fluids EXCEPT 5.1 are alcohol-based and their job is to capture water; bleeding the entire system is critical. Get all the water out and gone. FULL bleed.
If you don't wanna tackle it, send it here; I'll hand it off to my buddy to do. He owes me a favor or two.