Quantum matter with exotic topological order has potential applications in quantum computation. However, in present experiments, the manipulations on topological states are still challenging. We here propose an architecture for optical control of topological matter. We consider a topological superconducting qubit array with Su-Schrieffer-Heeger (SSH) Hamiltonian which couples to a microwave cavity. Based on parity properties of the topological qubit array, we propose an optical spectroscopy method to observe topological phase transition, i.e., edge-to-bulk transition. This new method can be achieved by designing cavity-qubit couplings. A main purpose of this work is to understand how topological phase transition affects light-matter interaction. We find that topological bandgap plays an essential role on this issue. In topological phase, the resonant vacuum Rabi splitting of degenerate edge states coupling to the cavity field is protected from those of bulk states by the bandgap. In dispersive regime, the cavity induced coupling between edge states is dominant over couplings between edge and bulk states, due to the topological bandgap. As a result, quantum interference between topological edge states occures and enables single-photon transport through boundaries of the topological qubit array. Our work may pave a way for topological quantum state engineering.