Restoring appearance of master cylinder?

You can't properly paint it without removing all the rust and crud first. Only real way to do that is to remove the m.c. from the car first. When you do paint it, use engine paint, or something else that is glossy. All the flat "as-cast" paints are porous and you'll start seeing that cast iron rustiness start bleeding back thru eventually.