From 2011 to 2018, he played the role of Mayor of Portland, Oregon, in the IFC comedy "Portlandia". After the end of the short-lived 2012 series "Made in Jersey" where he starred as lawyer Donovan Stark, he was cast as a guest star in "The Good Wife". In 2013 and 2014 he appeared as prosecutor Josh Perotti in four episodes of "The Good Wife". In 2014 and 2015 he appeared in a recurring role on "Marvel's Agents of S.H.I.E.L.D." television series as Calvin Zabo / The Doctor. In 2015, he voiced the main character's father in the Pixar animated feature "Inside Out". In January 2015, it was announced that MacLachlan would return as Special Agent Dale Cooper for the new limited television series "Twin Peaks", which debuted on May 21, 2017. In an interview, MacLachlan said he doesn't understand all of Twin Peaks and that fans understand it much more than him.