The pursuit of urban energy sustainability is driving growing efforts and pledges to achieve low-energy or net-zero energy performance at urban scales. However, studies covering urban energy performance and renewables integration often lack a systematic consideration of the urban built context (form and function) and its resulting effects on energy demand and supply dynamics. This paper presents a holistic and scalable agent-based modeling framework that incorporates contextual factors in the energy demand and supply evaluation of urban areas using multi-dimensional performance metrics. It leverages the local climate zone (LCZ) classification of typical urban built types, which is commonly used in urban planning or transportation applications (as opposed to energy planning). The framework is demonstrated through a comparative case study of compact high-rise and low-rise urban areas with different proportions of lodging and office buildings equipped with rooftop solar photovoltaic (PV) systems. Results show that the average energy self-sufficiency of the compact low-rise area exceeded 25%. In contrast, the self-sufficiency of the compact high-rise area remained below 5% despite achieving a self-consumption ratio of 99% from locally generated solar energy. The uncovered trends are critical to inform context-sensitive urban energy solutions and policies.