All objects, including magic items, have hit points. Some magic items, such as Ioun Stones and the Apparatus of Kwalish, specify how many hit points they have in their description, while the rest of the magic items can be assigned hit points based on the Object Hit Points table (DMG p.247).
Moreover, as explained in Magic Item Resilience (DMG p.141), many magic items even have resistance to all damage, so even though in my experience it's rare for magic items to take damage, it is nonetheless possible. In particular, the Apparatus of Kwalish is likely to take damage at some point while being used.
However, I can't find any guidelines to repair magic items, hence the question.
If a magic item takes damage, how can it be repaired? Is it any different from repairing mundane items?
A good answer should be based on existing rules, not arbitrary suggestions. Pointing out that no such rules exist is also an acceptable answer, should that be the case.