I use a quick clamp with plastic faces, look at the pictures. a small G clamp can also work well but make sure you can see it moving into the depth of the recess and don't put too much pressure on it.
Brake Master Cylinder Sight Glass, Universal O Ring Seal Reservoir with 18mm Conversion Fit for Motorcycle Front Rear Brake System Tuning
Master cylinder sight glass 10mm Front Rear Brake Clutch Motorcycle UK seller
18mm Motorcycle Master Cylinder Sight Glass and Rubber Gasket Kit Front Rear Brake Reservoir Replacement for Honda for suzuki
DystopiaWorld 2 Pack 18mm Brake Master Cylinder Sight Glass Lens & Gasket for Honda for suzuki Dirt Bike Motorcycle Oil Mirror Replacement
Beatanug 4pcs 18mm Motorcycle Brake Master Cylinder Sight Glass Lens Gasket Kit Silver Metal ABS Replacement for Old Bikes Front Rear Reservoir Window Seal
Universal Brake Cylinder Sight Glass, Durable Replacement for Front Rear Use