Nanomechanical computers promise robust, low energy information processing. However, to date, electronics have generally been required to interconnect gates, while no scalable, purely nanomechanical approach to computing has been achieved. Here, we demonstrate a nanomechanical logic gate in a scalable architecture. Our gate uses the bistability of a nonlinear mechanical resonator to define logical states. These states are efficiently coupled into and out of the gate via nanomechanical waveguides, which provide the mechanical equivalent of electrical wires. Crucially, the input and output states share the same spatiotemporal characteristics, so that the output of one gate can serve as the input for the next. Our architecture is CMOS compatible, while realistic miniaturisation could allow both gigahertz frequencies and an energy cost that approaches the fundamental Landauer limit. Together this presents a pathway towards large-scale nanomechanical computers, as well as neuromorphic networks able to simulate computationally hard problems and interacting many-body systems.