This study introduces a novel method using the Mu¨ntz-Legendre polynomials for numerically solving fractional optimal control problems. Utilizing the unique properties of Mu¨ntz-Legendre polynomials when dealing with fractional operators, these polynomials are used to approximate the state and control variables in the considered problems. Consequently, the fractional optimal control problem is transformed into a nonlinear programming problem through collocation points, yielding unknown coefficients. To achieve this, stable and efficient methods for calculating the fractional integral and derivative operators of Mu¨ntz-Legendre functions based on three-term recurrence formulas and Jacobi-Gauss quadrature rules are presented. A thorough convergence analysis, along with error estimates, is provided. Several numerical examples are included to demonstrate the efficiency and accuracy of the proposed method