There have already been a couple suggestions for a repair shop, so I won't bother adding another one, although I do think it's a good idea.
Instead, I think it would be a lot easier to implement a mechanic for being able to gain back a % of rares used to construct/train mechs, or maybe even undead units. It could replace the perk that reduces the basic resource cost for training (or garrison heal time for humanoid units), since it's a pretty useless perk since it costs so much resources to even acquire it.
Lore wise this would make more sense than even repairing, since the mech has to return alive to be repaired. Picking up salvage and making new mechs out of it makes a lot more sense to me.
This solution doesn't require an extra building like a repair shop, and is effectively the same because instead of heal times to repair mechs, there is just the standard training time.