Recent advances in Connected and Automated Vehicle (CAV) technologies have opened up new opportunities to enable safe, efficient, and sustainable transportation systems. However, developing reliable and rapid speed control algorithms in highly dynamic environments with complex inter-vehicle interactions and nonlinear vehicle dynamics is still a daunting task. In this paper, we develop a novel speed control method for CAVs to produce optimal speed profiles that minimize the fuel consumption and avoid idling at signalized intersections. To this end, an optimal control problem is formulated using the information of the upcoming traffic signal to adapt vehicles' speeds to avoid frequent stop-and-go driving patterns. By applying the pseudospectral discretization method and the sequential convex programming method, the computational efficiency is greatly improved, enabling potential real-time on-vehicle applications. In addition, the algorithm is implemented under a model predictive control framework to ensure online control with instant response for collision avoidance and robust vehicle coordination. The proposed algorithm is verified through numerical simulations of three different traffic scenarios. The convergence and accuracy of the proposed approach are demonstrated by comparing with a popular nonlinear solver. Furthermore, the benefit of the proposed method in both traffic mobility and fuel efficiency is validated using the speed profile determined from a traffic following model in a simulation software as the baseline.