To address the severe volume changes of transition metal chalcogenides that results in inferior cycling performance, herein, a unique yolk-shell microsphere composed of mesoporous cobalt sulfide yolk and alveolus-like carbon shell (M-CoS@C) is constructed. The mesoporous CoS yolks possess large surface area (46.3m2 g−1) accompanied with the interconnected mesoporous structure, which provide a large contact area to facilitate the permeation of the electrolyte and shorten the ion diffusion path. The alveolus-like carbon shells provide enough void spaces and highly self-adaptive structure to ensure the high stability of the electrode. Owing to the multifunctionality of this unique structure, the M-CoS@C electrode shows impressive cycling stability (790mAhg−1 after 500 cycles at 1Ag−1 for Li-storage, 532mAhg−1 after 100 cycles at 0.2Ag−1 for Na-storage) and excellent rate capability (330mAhg−1 at 20Ag−1 for Li-storage, 190mAhg−1 at 20Ag−1 for Na-storage). This unique mesoporous yolks@alveolus-like carbon shell structure and the self-sacrificing synthesis method present the effective strategies to promote the utilization of transition metal chalcogenides for practical applications.