MoS2/reduced graphene oxide composites (MoS2/rGO) were successfully prepared by a designed tris(hydroxymethyl)methyl aminomethane (named THAM)-assisted hydrothermal method, which involves the modification of THAM on the surfaces of graphene oxide via hydrogen bonds and then the adsorption of MoO42− on the decorated surfaces due to the electrostatic attraction. The three-dimensional framework of interconnected rGO nanosheets provides good electronic conductivity and facile strain release during the electrochemical reaction, thus enhancing the overall performance of the MoS2-based electrode. Herein, the composite delivers high specific capacity, excellent cycling stability and rate performance for lithium- and sodium- ions batteries (LIBs and SIBs). The MoS2/rGO anode exhibits capacities of 880 mAh g−1 at 1 A g−1 after 200 cycles and 396 mAh g−1 even at 2 A g−1 after 2000 cycles for LIBs. As to SIBs, the reversible capacities of 485 mAh g−1 and 339 mAh g−1 can be retained at 0.1 A g−1 after 60 cycles and 0.5 A g−1 after 300 cycles, respectively. Our results demonstrate that the MoS2/rGO anode is one of the attractive anodes for LIBs and SIBs. Furthermore, the facile method can be extended to biosensing, catalytic, and biomedical applications.