Ultracold neutral atoms can be trapped and coherently manipulated close to a surface using chip-based magnetic microtraps. This opens the possibility of studying interactions between atoms and on-chip solid-state systems such as micro- and nanostructured mechanical oscillators. This thesis reports experiments, where a controlled coupling between a Bose-Einstein condensate and a micromechanical oscillator is realized for the first time. The interaction relies on surface forces experienced by the atoms trapped at about 1 micrometer distance from the mechanical structure. The surface forces are used to resonantly couple the mechanical motion of the oscillator to collective motion of the atoms. Coupling via surface forces does not require magnets, electrodes, or mirrors on the oscillator and could thus be employed to couple atoms to molecular-scale oscillators such as carbon nanotubes. In the long-term, the toolbox for quantum manipulation of ultracold atoms could be employed to read out, cool, and coherently manipulate the quantum state of a mechanical oscillator. The thesis discusses three different scenarios that could enable atom-oscillator coupling at the quantum level.