Users' demands for multigroup transport calculations are wide and diverse, encompassing routine, rough, and fast calculations as well as very precise simulations. For these reasons, the use of accurate and efficient multigroup cross-section libraries is needed. In this work, we present an adaptive energy mesh constructor (AEMC) that builds a multigroup mesh from predefined requisites of precision and calculation time. For a given self-shielding model and number of groups, AEMC looks for the optimal bounds of a multigroup mesh that minimizes the errors of the multigroup transport solutions for a predefined set of infinite homogeneous medium problems. We have applied this methodology to define two energy meshes for fast sodium reactor applications: a 600-group mesh associated with an extension of the Livolant-Jeanpierre self-shielding method and a 1200-group mesh based on subgroup self-shielding. Tests in homogeneous media prove that the multigroup solutions are almost equivalent to Monte Carlo simulations. Simplified one-dimensional transport calculations confirm the accuracy of the 1200-group mesh and show that this mesh provides a precision similar to that obtained with the well-validated 1968-group ECCO mesh. The same tests reveal that the 600-group mesh optimized for subgroup self-shielding offers a good compromise between simulation time and precision.