Neutron capture on $$^{16}$$ O may serve as a neutron poison in certain nucleosynthesis scenarios. We revisit this reaction at energy ranges of astrophysical interest, employing a novel theoretical approach that self-consistently treats capture through bound and resonant levels. Our covariant density functional theory is based on a relativistic mean field (RMF) theory with contributions from resonant orbitals included via the analytical continuation of the coupling constant (ACCC), and pairing correlations included via the resonant Bardeen–Cooper–Schrieffer (BCS) technique. We employ this RMF + ACCC + BCS approach to extract bound states, resonant states, and pairing correlations in $$^{17}$$ O in a self-consistent microscopic way. We calculate $$^{16}$$ O(n, $$\gamma $$ ) $$^{17}$$ O direct capture cross sections resulting from neutron E1 transitions from scattering states to bound states, resonant cross sections from a Breit–Wigner formalism, and Maxwellian-averaged cross sections and thermonuclear reaction rates for astrophysical applications. We use different effective interactions to determine the viability of our approach to determine the $$^{17}$$ O level structure and corresponding reaction rates. Comparisons to measurements and database values are given.