Metal-organic frameworks (MOFs) and their derivatives are two developing families of functional materials for energy storage and conversion. Their high porosity, versatile functionalities, diverse structures, and controllable chemical compositions offer immense possibilities in the search for adequate electrode materials for rechargeable batteries. Despite these advantageous features, MOFs and their derivatives as electrode materials face various challenging issues, which impede their practical applications. From this perspective, we present both the opportunities and challenges that MOFs/MOF composites and MOF-derived materials bring to rechargeable batteries, including lithium-ion batteries, lithium-sulfur batteries, lithium-oxygen batteries, and sodium-ion batteries. By discussing the development of MOFs/MOF composites and MOF-derived materials in each battery system, some design principles that dominate the specific electrochemical behaviors are outlined, with the key requirements that a practical electrode should fulfill. At the end, a basic guidance and future directions for further development are provided.