Disc brake master cylinders have a piston with a rubber seal built in, which needs to be replaced when worn or damaged. Some master cylinders are sold with the seal pre-installed in the piston as an OEM part, while others are sold separately. In this case, the seals are assembled, but preparations must be made to avoid damaging the delicate seals.
When the base of the lever is moist with brake fluid, it is a sign that it is time to overhaul the master cylinder.

Example of front brake master cylinder parts for overhaul. To the lower right of the spring is the master cylinder piston, and in the row below it are the primary and secondary cups. Some manufacturers sell the master cylinder with the cups assembled to the pistons, but if they are in pieces like this, the user must assemble them.

To remove the piston, remove the snap ring at the end of the master cylinder. Depending on the design of the master cylinder, pliers with long, thin tips may be necessary. If you try to use a pick tool as a substitute, you risk damaging the cylinder's inner wall, so prepare circlip pliers for the hole.

When the snap ring is removed, the piston pops out by the reaction force of the spring. If the brake fluid has not been changed for a long period of time and water has been mixed in, solids may accumulate inside the cylinder and the piston may not come out.

The primary cup is on the right and the secondary cup is on the left, pushed from the left by the brake lever to the right. The primary cup can be easily assembled from the right end of the piston, but the secondary cup must be assembled after expanding beyond the piston's outer diameter. Due to aging, the surface treatment of the two piston outer diameter areas in contact with the cylinder is worn away.

Aside from the piston to be replaced with a new one, any scratches on the cylinder can cause fluid leakage, so check the cylinder after cleaning. Pistons that have had their surface treatment peeled off by friction as they move back and forth inside the cylinder can contribute to cylinder scratches, so it is best to check the pistons as well as the lever pivots when there is discomfort in the lever touch.
The piston built into the master cylinder of a disc brake incorporates two types of rubber parts called primary and secondary cups. They push fluid in the reservoir tank toward the caliper when the brake lever is squeezed and pull fluid back into the tank when the lever is released.
While the importance of rubbing to clean and lubricate caliper pistons to prevent response and drag during braking is recognized, the master cylinder also requires proper maintenance. It is of utmost importance that the piston strokes smoothly through the master cylinder as the brake lever and brake pedal are operated and that no fluid leakage occurs during this process.
When the brake lever is not smooth when gripped, it is standard practice to grease up the lever pivot and the area in contact with the master piston, but it is also possible that the master cylinder and piston are scratched, worn, or dirty and friction.
Such abnormalities can spread to the primary and secondary cups. The cups have an umbrella-shaped cross-section, and the lip that contacts the inner surface of the master cylinder is narrow and delicate. If the cups are damaged by scratches on the inner wall of the master cylinder, they will not be able to hold brake fluid pressure and fluid leakage will occur. If the fluid in the reservoir tank that has not been changed regularly becomes altered and enters the master cylinder, it may bite into the lip and cause a leak.
When the master piston cup is damaged and brake fluid begins to seep in, the area around the master cylinder entrance where the brake lever meets the piston becomes moist with brake fluid. If the master cylinder is equipped with a dust cover at the piston insertion point, it may be difficult to notice the wetting, but be careful when there are areas of the master cylinder body where the paint is becoming detached.
Of the two cups, if the secondary cup, which is closer to the lever or pedal, is damaged, fluid leakage may become more noticeable when the brakes are applied. If this goes unnoticed, before you know it, the fluid in the reservoir tank will deplete, causing an air-biting condition, and you may suddenly lose braking ability. The front brake master cylinder is always right in front of you, so you probably won't miss it, but the rear brake master cylinder can be overlooked unless you consciously keep your eyes low and check it.
Remember that the master piston and piston cup need to be inspected when the master cylinder is damp, even if the lever or pedal touch is not uncomfortable.
POINT
Point 1 - Two types of rubber parts, primary and secondary cups, are incorporated in front and behind the piston inside the master cylinder.
Point 2 - Scratches or wear inside the master cylinder or damage to the lip of the cup can cause brake fluid leakage.
I want to use an installer to avoid damaging the master cup's inner diameter during expansion.

An example of a cylinder cup installer. This is for an automotive master cylinder, and the maximum outside diameter of the installer matches the piston diameter. If the piston diameter is the same, it can be used for motorcycles as well, but more often than not, generic products cannot be used because the motorcycle version is thinner. Motorcycle makers provide special tools for the original equipment, but they are not inexpensive.

Find a familiar object, such as a cap or jaw tip, that is tapered and could be used as an installer.
Ideally, it should be able to expand the inner diameter of the cup evenly and widen it to the same or slightly larger than the piston's outer diameter.

Insert the secondary cup into the homemade installer that has been coated with brake fluid and rubber seal assembly agent. The cups should be installed with the open end of the cup facing the direction of the piston.
If you are not sure about the direction of assembly, check with an old piston removed from the master cylinder.

Install the primary cup on the end side of the piston, place the spring on it, and insert it into the master cylinder.
Be careful that the umbrella part of the cup does not get caught on the end of the master cylinder and turn it upside down.
If the brake lever touch deteriorates or there is brake fluid seepage, and if there is no damage or wear inside the master cylinder, replace the master cylinder piston and cup. However, the time and difficulty of the assembly work will vary greatly depending on the piston and cup settings of the genuine parts. If the cup is pre-assembled to the piston, it is fine, but if you have to assemble it yourself, you will need to be creative.
To prevent the cup from coming off while moving the fluid in the reservoir tank, the master cylinder piston has a complicated shape, and it is necessary to widen the inside diameter when assembling the cup. This requires careful work because pulling with excessive force or damaging the cup with the end of the piston can cause fluid leakage.
The master cylinder for hydraulic brakes is the same for both motorcycles and automobiles, and for automobiles, there is a special tool called a general-purpose cylinder cup installer. When the installer, which has the same diameter as the outer diameter of the master piston, is set in place and the cup is pressed against it, the inner diameter spreads evenly over the largest diameter part of the piston and the cup is assembled in place. However, there are no general-purpose installers for motorcycles, which have smaller piston diameters than those for automobiles, and the manufacturer's OEM dedicated tools are not inexpensive for their infrequent use.
However, since the cylinder cup installer expands the inner diameter of the cup evenly to the piston diameter, it is possible to use a familiar object as a substitute. Specifically, oilers, liquid gaskets, or sealer tips may be used, as long as they are conical in shape with a narrow tip that thickens to the master piston diameter at the base, and have a smooth surface that will not damage the cup's inner diameter. When overhauling front forks, the tip of the inner tube is covered with plastic to prevent damage to the oil seal, and the concept is the same.
Here we used a silicone caulking tip, but the important thing is that the diameter of the conical base matches the outside diameter of the master piston and that a chemical such as MR20, which can be used to lubricate brake fluid and rubber parts, is applied to prevent it from getting stuck when inserting the cup. If you are concerned, you can cover the homemade installer and piston with plastic as well as the inner tube before inserting the cup.
The reason for this precaution is not only the danger of damaging the cups during assembly but also the fact that many genuine parts are sold as a set with pistons and cups and are not inexpensive. It would be extremely painful to have to repurchase parts that have never been used because of damage to the cups caused by careless mistakes or careless work during the assembly. The cups are not only safe to use, but they are also very easy to install and maintain.
If you can make your own installer that can safely assemble the cups, the time spent looking for substitutes and the slight processing effort should not be wasted.
POINT
Point 1 - The bore diameter must be enlarged when assembling the secondary cup to the piston
Point 2 - Installers needed for cup assembly can often be substituted with familiar items.