When overmoulding optoelectronic devices with optical elements, precise alignment of the overmoulded part and the mould is of great importance. However, mould-integrated positioning sensors and actuators are not yet available as standard components. As a solution, we present a mould-integrated optical coherence tomography (OCT) device that is combined with a piezo-driven mechatronic actuator, which is capable of performing the necessary displacement correction. Because of the complex geometric structure optoelectronic devices may have, a 3D imaging method was preferable, so OCT was chosen. It is shown that the overall concept leads to sufficient alignment accuracy and, apart from compensating for the in-plane position error, provides valuable additional information about the sample both before and after the injection process. The increased alignment accuracy leads to better energy efficiency, improved overall performance and less scrap parts, and thus even a zero-waste production process might be feasible.