McGrath worked in Reno, Nevada as a Reginald Heber Smith Community Lawyer Fellow from 1975 to 1976.[1] He became Montana's Assistant Attorney General in 1977 and served until 1982.[4]
McGrath defeated Jim Rice for Montana Attorney General in 2000.[4] He won a second term in 2004.[1] As Attorney General, he focused on methamphetamine prevention and natural resource and land issues.[4] In 2005, Montana was ranked as fifth worst for meth abuse among US states.[5]
McGrath campaigned against Ron Waterman for Chief Justice of the Montana Supreme Court in 2008.[6] He took office in January 2009 on the seat vacated by Karla Gray. He ran unopposed in 2016 for another eight year term. McGrath stated he would not run for re-election in 2024.[6]