In a previous paper we have constructed an invariant of four-dimensional manifolds with boundary in the form of an element in the stable homotopy group of the Seiberg-Witten Floer spectrum of the boundary. Here we prove that when one glues two four-manifolds along their boundaries, the Bauer-Furuta invariant of the resulting manifold is obtained by applying a natural pairing to the invariants of the pieces. As an application, we show that the connected sum of three copies of the K3 surface contains no exotic nuclei. In the process we also compute the Floer spectrum for several Seifert fibrations.