Use these larger extremely versatile rotary limit switches on your CNC. The action of these switches are rotational, so the lever arm can be mounted in a way that the switch can be actuated and not interfere with the structure that is pushing the lever.
The lever angle of rotation can be rotated 90 degrees. There is a free spinning wheel at the end of the lever so the structure will not get hung up going in the reverse direction after actuating the switch.
The switch can handle 5A (Amps of current) at 250 volts. In most cases, the wires will be digital level (5v), but can be connected to much high voltages if needed.
No soldering needed since the wire connections are screw terminals. If you need a NO (Normally Open) connection, connect the circuit through the #3 and #4 terminals (for example, wire #3 to GND and #4 to the input pin). NC (Normally Closed) operation uses the #1 and #2 screw terminals. The #1 and #2 screw terminals are the two terminals closest to the cable strain relief. The #3 and #4 screw terminals are closest to the lever arm.
Mounting holes are located at the back of this rotary limit switch and measure 21 mm on center and the long dimension is 56 mm on center.