We present a first-principles study of the electronic and transport properties of linear clusters Mo 2 X 2 (X = Fe,Co,Ni), formed by two X atoms separated by a nearly nonmagnetic Mo dimer, connected to gold electrodes. Density functional theory, as implemented in the SIESTA code with the generalized gradient approximation, is used to determine the spin-polarized electronic structure of the molecular contact for relaxed distances. We show that the Mo 2 X 2 clusters anchored to the gold electrodes have two different magnetic states, corresponding to the spin isomers found in the freestanding environment, one of which has parallel magnetic coupling between the X atoms across the Mo dimer and another that has antiparallel coupling. The transmission coefficients, current-voltage characteristics, and conductivity are then computed with the SMEAGOL code for the two magnetic states. We show that this system presents spin-filtering properties and magnetoresistance driven by the magnetic state of the molecular contact.