The geometrical structures of adsorbed aluminum atoms on different sites of undoped and boron (nitrogen)-doped single-walled carbon nanotubes (SWCNTs) were optimized using plane wave pseudopotential method with generalized gradient approximation based upon the density functional theory. The band structures,density of states,electron density difference,Mulliken population, adsorption energies of both undoped and boron (nitrogen)-doped SWCNTs were calculated theoretically. The results revealed that boron-doping enhances the adsorption energy Ea of Al on metallic (5,5) CNTs and semiconducting (8,0) CNTs by forming an electron-deficient structure filled with the electrons offered by Al atom. Meanwhile the results also suggest that nitrogen-doping increases Ea of Al on SWCNTs by forming electron-rich half-filled donor structure around Fermi level filled with the electrons of Al atom. Boron- and nitrogen-doping enhance the adsorption energy Ea by forming ionic-bond-type and covalent-bond-type bonds, respectively. The doping effect may also be beneficial to strengthening contact of interfaces between Al matrix and CNTs.