We develop a theory for the dynamics of an Andreev bound state (ABS) hosted by a weak link of finite length for which charging effects are important. Assuming that the charging energy associated with an electron in the ABS is small compared to the superconducting order parameter in the leads, we derive the linear response of both the current through the link and charge accumulated in it with respect to the phase and gate voltage biases. The resulting matrix encapsulates the spectroscopic properties of a weak link embedded in a microwave resonator. In the low-frequency limit, we obtain the response functions analytically using an effective low-energy Hamiltonian, which we derive. This Hamiltonian minimally accounts for Coulomb interaction and is suitable for a phenomenological description of a weak link having a finite length.