We develop a numerical model to study magnetohydrodynamic waves in a thin layer of stratified fluid near the surface of Earth's core. Past studies have been limited to using simple background magnetic field configurations. However, the choice of field distribution can dramatically affect the structure and frequency of the waves. To permit a more general treatment of background magnetic field and layer stratification, we combine finite volume and Fourier methods to describe the wave motions. We validate our model by comparisons to previous studies and examine the influence of background magnetic field configuration on two types of magnetohydrodynamic waves. We show that the structure of zonal Magnetic-Archimedes-Coriolis (MAC) waves for a dipole background field is unstable to small perturbations of the field strength in the equatorial region. Modifications to the wave structures are computed for a range of field configurations. In addition, we show that non-zonal MAC waves are trapped near the equator for realistic magnetic field distributions, and that their latitudinal extent depends upon the distribution of magnetic field strength at the CMB.