Nonlinear friction is a dominant factor affecting the control accuracy of CNC machine tools. This paper proposes a friction pre-compensation method for CNC machine tools through constructing a nonlinear model predictive scheme. The nonlinear friction-induced tracking error is firstly modeled and then utilized to establish the nonlinear model predictive scheme, which is subsequently used to optimize the compensation signal by treating the friction-induced tracking error as the optimization objective. During the optimization procedure, the derivative of compensation signal is constrained to avoid vibration of machine tools. In contrast to other existing approaches, the proposed method only needs the parameters of Stribeck friction model and an additional tuning parameter, while finely identifying the parameters related to the pre-sliding phenomenon is not required. As a result, it greatly facilitates the practical applicability. Both air cutting and real cutting experiments conducted on an in-house developed open-architecture CNC machine tool prove that the proposed method can reduce the tracking errors by more than 56%, and reduce the contour errors by more than 50%.