Rahmati started his professional career with Fajr Sepasi in 2000,, he stayed for four years at the club and made 40 appearances before transferring to Sepahan. After only one season with Sepahan, Rahmati again transferred, this time to Esteghlal. Although he had good performance in the Esteghlal squad, Vahid Talebloo had better performances and he proved himself as the number one keeper for Esteghlal Rahmati again left this time to Mes Kerman where he played very well. He continued performing well in Mes and helped the club qualify for the AFC Champions Leaguefor the first time in the club's history. Persepolis showed some interest on him but he reject the bid.
Sepahan
On July 14, 2009, Rahmati signed a two-year contract with Sepahan for an approximate sum of $450,000 turning down an offer from Norwegian giants Rosenborg BK. At Sepahan he was the first choice keeper for the entire season and one of the most important players that helped the club win the league. He repeated the same feat with Sepahan the next season, he was regarded as the league's best goalkeeper after his performances with Sepahan.
Esteghlal
He joined Esteghlal in July 2011 where he won the Hazfi Cup in the first season. He extended his contract for another season on June 18, 2012. On April 12, 2013, Rahmati achieved a recorded twenty-four clean sheets, equalling with Iker Casillas in a season. He also helped his team to win league title after four years. At the end of the season, he extended his contract with the club. After the retirement of Farhad Majidi, Rahmati was named as Esteghlal's captain.
On June 18, 2014, Rahmati left Esteghlal and joined Paykan for $1.5 million, signing a two-year contract. He played his first match for Paykan in 3-4 home loss to Tractor Sazi Tabriz F.C in 2014 Shohada Cup
Return to Esteghlal
On June 29, 2015, Rahmati returned to his former club Esteghlal on a one-year contract. In 2018 he won the Hazfi Cup with Esteghlal. He holds the record for the most Appearance in Persian gulf league and is the first player who appeared in 18 consecutive seasons in Persian gulf league. Considered one of the best goalkeepers in Asia, He also holds the record of most clean sheet in Persian gulf league with.
On January 20, 2013, Mehdi Rahmati announced his temporary retirement from the national team, he stated in an interview "Maybe I cannot be at the service of Team Melli, so I temporarily announce my resignation." He added, "Due to some problems, I prefer not to say anythingfor the time being, but I have to say just one thing that I am not at the service of Team Melli for a while." After the announcement Iran national football team Coach Carlos Queiroz made a comment that he respects Rahmati's decision and will not invite him any more. Many in the Iranian FA tried to convince him to invite Rahmati again but Queiroz said that he was not involved in the decision and he can not see any reason to negotiate this matter with Rahmati. In March 2013 Rahmati made a comment that Queiroz should not be the coach of Iran and the best he could do was to help as the assistant. At the end of the season Rahmati apologised to the Iranian people but not Queiroz personally in Navad TV show. Before the final 3 matches in June 2013 for the World cup qualifications it was rumoured that the Iranian FA and Queiroz asked him to sign an apology letter provided by them which he refused. A month later in July 2013, Hadi Aghili revealed that Rahmati told him not to sign the apology and they will beg us to return after they lose the first match which did not happen. However Rahmati was present in Training Camp in October 2014, but he was never called for an international match.