We propose a new micromechanical approach to probe bending rigidity at molecular scale. Long flexible filaments made of magnetic colloids and linkers are shown to adopt under magnetic field a hairpin configuration. Measuring the hairpin curvature as a function of the field intensity and the linker length from diffracted light allows us to deduce the linker bending rigidity kappa. The technique is presented for two types of linkers: a spontaneously adsorbing polymer and a grafted biomolecular.