This little 12.5x6x6mm microswitch can be easily mounted using two m2 screws. Note that you should make an afford to avoid repeated strain on the wire due to moving of the axes. The wires will break off easily, so make sure to fasten the wires as well. The wires are connected to the normally open and common pin of the endstop, so you should use the pull-up and invert endstop function of the firmware and connect the wires onto signal and ground. You can also use an external pull-up resistor of 10K between 5V and the signal pin to reduce effects of electrical noise.