Small limit switches are used in robotics and CNC applications. They can be tricky to mount because they only have the two mounting holes. It always seems necessary to come up with some sort of bracket. This bracket can be used in many ways. So you can print up a bunch and keep them with your switch supply.
The large holes are designed for 4-40 hardware, but 3mm should work well. The switch can be mounted with either 2-56 or 2mm hardware.
PowerSpec 3D-Pro/Flash Forge
This device was designed in Fusion 360.