A mechanical interface for an undulator module comprises: a body, a laser beam sensor and an alignment feature. The laser beam sensor is attached to the body and is operable to determine the position of a reference laser beam relative to part of the mechanical interface. The alignment feature on the body is arranged to allow the mechanical interface to engage with an undulator module such that the laser beam sensor is maintained in fixed relationship with a magnetic centre of the undulator module.