By solving the Bogoliubov-de Gennes equations, we study the quasiparticle spectrum of a magnetic atom chain placed inside a short constriction-type Josephson junction. A helical magnetic order of the atomic spins is assumed, so that a topologically nontrivial state with Majorana edge modes at the ends of the chain can appear. It is found that in the presence of a nonzero Josephson phase the subgap spectrum of an infinite chain consists of four branches (Shiba bands). This spectrum is almost certainly gapped if the atomic spins form a coplanar spiral. The Majorana number of the given system is calculated analytically. It is demonstrated that a Josephson phase shift can be used to drive the system into a topologically nontrivial state and to tune the size of the topological gap. The spatial structure of Majorana edge modes is studied as well. We generalize the effective model based on discrete Bogoliubov-de Gennes equations developed by Pientka et al. for a bulk superconductor to the case of a Josephson junction. Using these discrete equations, the wave functions of Majorana zero modes are calculated analytically for a coplanar atomic spin spiral with arbitrary pitch. The wave functions exhibit an intermediate asymptotic behavior with a nonexponential fall-off with distance from the edge of the atomic chain.