The structural, electronic and transport properties of metallocene molecules (MCp$_2$) and isolated or nanotube-encapsulated chains are studied by using a combination of density functional theory and non-equilibrium Green's functions. The analysis first discusses the whole series of isolated MCp$_2$ molecules, where M = V, Cr, Mn, Fe, Co, Ni, Ru, and Os. The series presents a rich range of electronic and magnetic behaviors due to the interplay between the crystal field interaction and Hund's rules, as the occupation of the $d$ shell increases. The article then shows how many of these interesting properties can also be seen when MCp$_2$ molecules are linked together to form periodic chains. It is argued that encapsulation of the chains inside carbon nanotubes, that is exothermic for radii larger than 4.5 \AA, provides the missing mechanical stability and electrical isolation. The structural stability, charge transfer, magnetic and electronic behavior of the ensuing chains, as well as the modification of the electrostatic potential in the nanotube wall produced by the metallocenes as thoroughly discussed. We argue that the full devices can be characterized by two doped, strongly correlated Hubbard models whose mutual hybridization is almost negligible. The charge transferred from the chains produces a strong modification of the electrostatic potential in the nanotube walls, which is amplified in case of semiconducting and endothermic nanotubes. The transport properties of isolated metallocenes between semi-infinite nanotubes are also analyzed and shown to lead to important changes in the transmission coefficients of clean nanotubes for high energies.