Metal–organic frameworks (MOFs) are a class of porous materials that have attracted enormous attention during the past two decades due to their high surface areas, controllable structures and tunable pore sizes. Besides the applications in gas storage and separation, catalysis, sensor, and drug delivery, MOFs are receiving increasing research interest in the field of electrochemical energy storage. By focusing on recent advances, this review provides a broad overview of MOF-based or MOF-derived rechargeable lithium ion batteries and supercapacitors.