The Rambam, in the laws of the red heifer (הלכות פרה אדומה ג:ד) tells us:
There were nine red heifers up to the destruction of the second temple. The first was done by Moshe, the second by Ezra, seven more till the destruction of the temple and the last will be done by the king Mashiach, may he be revealed speedily in our days.
Let's remember that Mishneh Torah is the Rambam's Halachic work. Obviously, he believed in the mashiach, as he wrote the "laws of the messianic king".But, There is no other place where a halachic book becomes a prayer book. The Rambam begins with a historical review of the previous red heifers, which is not new, as it is a repeat of what is written in the Mishna, but then he ends with his deep yearning "may he be revealed speedily in our days" This is not a quote from the Mishna or Gemara, this is an original prayer of the Rambam from deep in his heart.