The oscillation frequencies of a molecule on a surface are determined by the mass distribution in the molecule and the restoring forces that occur when the molecule bends. The restoring force originates from the atomic-scale interaction within the molecule and with the surface, which plays an essential role in the dynamics and reactivity of the molecule. In 1998, a combination of scanning tunneling microscopy with inelastic tunneling spectroscopy revealed the vibrational frequencies of single molecules adsorbed on a surface. However, the probe tip itself exerts forces on the molecule, changing its oscillation frequencies. Here, we combine atomic force microscopy with inelastic tunneling spectroscopy and measure the influence of the forces exerted by the tip on the lateral vibrational modes of a carbon monoxide molecule on a copper surface. Comparing the experimental data to a mechanical model of the vibrating molecule shows that the bonds within the molecule and with the surface are weakened by the proximity of the tip. This combination of techniques can be applied to analyze complex molecular vibrations and the mechanics of forming and loosening chemical bonds, as well as to study the mechanics of bond breaking in chemical reactions and atomic manipulation.