The article presents the results of research in the field of university training of mathematics teachers aimed at realising STEM education at school and other educational organisations. The authors identified 1) insufficient readiness of school teachers to implement STEM training, and 2) lack of professional mathematics teachers having special qualification in this area. Based on Russian and foreign experience, the authors propose to use the potential of the elective courses for purposeful preparation of future mathematics teachers to implement STEM training. The approach to designing the content and technological components of such a course rests on the principles of practical orientation, multidisciplinarity, professional orientation and the application of a regional context. The course consists of theoretical and practical modules, which make it possible to integrate the potential of all STEM components in the professional training of teachers and to master the basics of STEM implementation.