Although superconducting systems provide a promising platform for quantum computing, their networking poses a challenge as they cannot be interfaced to light—the medium used to send quantum signals through channels at room temperature. We show that mechanical oscillators can mediate such coupling and light can be used to measure the joint state of two distant qubits. The measurement provides information on the total spin of the two qubits such that entangled qubit states can be postselected. Our scheme works in analogy to experimental technique already established in the microwave domain but employs an optical channel at room temperature. The use of light greatly enhances the distance over which the qubits can become entangled. The generalization to the optical domain—although relatively straightforward from the experimental point of view—is highly nontrivial and requires a systematic investigation of new sources of decoherence; thermal mechanical noise and optical transmission loss have to be analysed. Such an analysis requires adiabatic elimination of the complex transducer dynamics since the Hilbert space dimension is too large to allow numerical simulations. Compared to earlier proposals of optomechanical transducers, our strategy requires no time-dependent control. This simplicity leads to modest requirements on the system parameters; optomechanical cooperativity moderately larger than unity is sufficient and large transmission losses can be tolerated. The approach is scalable to generation of multipartite entanglement and represents a crucial step towards quantum networks with superconducting circuits.