Urban smart-city transitions increasingly depend on distributed, digitally coordinated, and reliable energy infrastructures. Among these, community microgrids supported by cloud-based peer-to-peer (P2P) coordination provide a practical pathway for integrating distributed energy resources, reducing transaction costs, and improving operational flexibility. This paper presents a structured cloud-coordinated P2P energy-sharing framework for microgrid energy systems, with explicit emphasis on cost reduction, system reliability, and scalable energy management for urban communities. The framework integrates distributed energy resources (DERs), a cloud-based microgrid energy management system (EMS), a peer-Multi Agent System (p-MAS) for peak-load coordination, and Modelling Leveraging Agents (MLA) for bill estimation and prosumer settlement. Internal market operation is governed by a supply-demand-ratio (SDR) pricing rule, while a performance measure is defined to evaluate the realized benefit of energy sharing within the Energy Shared Region (ESR). The empirical study uses the India Residential Energy Survey (IRES) 2020 and associated Microgrid Load Explorer profiles, covering more than 10,000 households in 500+ villages, 50+ districts, and 10 states. Experimental comparisons are conducted against established P2P settlement models, including Bill Sharing (BS), Mid-Market Rate (MMR), and SDR. The source-grounded results indicate that the proposed cloud-based P2P model improves consumer-side cost efficiency and reliability, achieving an overall performance increase of approximately 5% and consumer cost savings of about 8% relative to comparator methods. Reported operational outcomes further indicate that shared energy coordination increases effective ESS utilization from 125 MW per hour without sharing to approximately 200.5–300.5 MWh with sharing, while the model maintains stable operation under node failure conditions. The study demonstrates that cloud-enabled P2P microgrid coordination is a relevant smart-city energy strategy for resilient, data-driven, and economically efficient urban development.