We present results for the electronic and magnetic structure of Mn and Fe clusters on Nb(110) surface, focusing on building blocks of atomic chains as possible realizations of topological superconductivity. The magnetic ground states of the atomic dimers and most of the monatomic chains are determined by the nearest-neighbor isotropic interaction. To gain physical insight, the dependence on the crystallographic direction as well as on the atomic coordination number is analyzed via an orbital decomposition of this isotropic interaction based on the spin-cluster expansion and the difference in the local density of states between ferromagnetic and antiferromagnetic configurations. A spin-spiral ground state is obtained for Fe chains along the [] direction as a consequence of the frustration of the isotropic interactions. Here, a flat spin-spiral dispersion relation is identified, which can stabilize spin spirals with various wave vectors together with the magnetic anisotropy. This may lead to the observation of spin spirals of different wave vectors and chiralities in longer chains instead of a unique ground state.