We demonstrate the controllable electron doping into metallic atomic wires, indium wires self-assembled on the Si͑111͒ surface, which feature one-dimensional ͑1D͒ band structure and temperature-driven metal-insulator transition. The electron filling of 1D metallic bands is systematically increased by alkali-metal adsorption, which, in turn, tunes the macroscopic property, that is, suppresses the metal-insulator transition. On the other hand, the dopant atoms induce a local lattice distortion without a band-gap opening, leading to a microscopic phase separation on the surface. The distinct bifunctional, electronic and structural, roles of dopants in different length scales are thus disclosed.