The composition of cloud services plays a vital role in optimizing resource allocation, load balancing, task scheduling, and energy management. However, it remains a significant challenge due to the dynamic nature of workloads and the variability in resource demands, where addressing these challenges is essential for ensuring seamless service delivery. This research investigated the implementation of the Cuckoo Optimization Algorithm (COA) in a cloud computing environment to optimize service composition. In the proposed approach, each service was treated as an egg, where high-demand services represented the host’s original eggs, while low-demand services represented the cuckoo bird’s eggs that competed for the same resources. This implementation enabled the algorithm to balance workloads dynamically and allocate resources efficiently while optimizing load balancing, task scheduling, cost reduction, processing and response times, system stability, and energy management. The simulations were conducted using CloudSim 5.0, and the results were compared with the Particle Swarm Optimization (PSO) and Ant Colony Optimization (ACO) algorithms across key performance metrics. Experimental results clearly demonstrate that the COA outperformed both PSO and ACO across all evaluated metrics. The COA achieved higher efficiency in task scheduling, dynamic load balancing, and energy-aware resource allocation. It consistently maintained lower operational costs, reduced SLA violations, and achieved superior task completion and VM utilization rates. These findings underscore the COA’s potential as a robust and scalable approach for optimizing cloud service composition in dynamic and resource-constrained environments.