The structural, electronic, and transport properties of metallocene molecules (MCp2) and isolated or nanotube-encapsulated metallocene chains are studied by using a combination of density functional theory and nonequilibrium Green's functions. The analysis first discusses the whole series of isolated (MCp2) 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 (MCp2) molecules are linked together to form periodic chains. Interestingly, a large portion of these chains display metallic, and eventually magnetic, behavior. These properties may render these systems as useful tools for spintronics applications but this is hindered by the lack of mechanical stability of the chains. It is finally argued that encapsulation of the chains inside carbon nanotubes, that is exothermic for radii larger than 4.5 Å, 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 are 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.