The classification of materials into insulators and conductors has been shaken up by the discovery of topological insulators that conduct robustly at the edge but not in the bulk. In mechanics, designating a material as insulating or conducting amounts to asking if it is rigid or floppy. Although mechanical structures that display topological floppy modes have been proposed, they are all vulnerable to global collapse. Here, we design and build mechanical metamaterials that are stable and yet capable of harboring protected edge and bulk modes, analogous to those in electronic topological insulators and Weyl semimetals. To do so, we exploit gear assemblies that, unlike point masses connected by springs, incorporate both translational and rotational degrees of freedom. Global structural stability is achieved by eliminating geometrical frustration of collective gear rotations extending through the assembly. The topological robustness of the mechanical modes makes them appealing across scales from engineered macrostructures to networks of toothed microrotors of potential use in micromachines.