Prebunching via echo-enabled harmonic generation (EEHG) is an efficient way to reduce the radiator length and improve the longitudinal coherence as well as output stability in storage-ring-based free-electron lasers. We propose a conceptual design, which uses two straight sections to seed coherent extreme-ultraviolet (EUV) and soft X-ray emission with nearly MHz repetition rate. To take the large energy spread (10−3) of a storage ring into account and utilize the existing bending magnets between the two straight sections as the first chicane, we implement a special modeling tool, named EEHG optimizer. This tool has been successfully applied to maximize the prebunching with a reasonably low energy modulation, thereby generating intense coherent X-ray pulses within a short undulator length (a few meters) limited by the available space of a storage ring. Numerical simulations confirm that the optimized EEHG parameters can be directly applied to generate a 10 MW scale peak power with fully coherent ultrafast EUV to soft X-ray pulses based on the NSLS-II parameters. This method can be easily extended to other types of diffraction-limited storage rings.