The invention provides a mechanical device for applying a harmonic reducer to bothway transmission. The mechanical device comprises a motor, a box, a switching mechanism, a clamping mechanism, a harmonic reduction mechanism, a bearing and a coupler. The mechanical device can be applied to a mechanical system needing bothway transmission. When an output shaft of the harmonic reducer serves as the input end to do reverse transmission, a wave generator, a flexible gear and a rigid gear of the harmonic reducer are locked through the clamping mechanism, the harmonic reducer is not connected with the box, and the harmonic reducer does not have the speed changing effect at the time and is equivalent to a coupler with the transmission ratio being 1:1. System power passes through the harmonic reduction mechanism and is not influenced by the reduction ratio of the harmonic reduction mechanism, and therefore the dragging resistance is smaller; and when the mechanical system uses an output shaft of the motor as the input end to do forward transmission, the locking state of the wave generator, the flexible gear and the rigid gear of the harmonic reducer can be ended through the switching mechanism, meanwhile the harmonic reducer is installed on the box, the system power is subject to the reduction ratio effect of the harmonic reduction mechanism, and therefore the large output torque can be obtained.