Mathematical modeling has become a crucial competence in mathematics education in many countries and regions due to the increasingly complex real-world problems that students face in the 21st century. Previous research has shown that mathematical modeling contributes to the development of students' creativity, particularly with respect to stimulating and protecting the curiosity of children. However, previous studies have not explored or examined the relationships among middle school students' mathematical modeling competency, curiosity, and creativity based on data drawn from large-scale assessments and have not investigated the influence of teachers' teaching methods in this context. This study used convenience sampling to select 4,531 seventh-grade students from eastern and western, urban and rural areas in China. Online tests and questionnaires were used to measure their mathematical modeling competency, curiosity, creativity and guided inquiry teaching, and a moderated mediation model was used to analyze the effect of mathematical modeling competency on creativity. The results showed the following. (1) There are statistically significant differences between boys and girls in terms of their mathematical modeling competency, curiosity, and creativity. Specifically, boys score significantly higher than girls on these variables. (2) Creativity exhibits a statistically significant positive correlation with mathematical modeling competency, curiosity, and guided inquiry teaching. (3) Curiosity mediates the relationship between mathematical modeling competency and creativity, and guided inquiry teaching moderates the influence of curiosity. In high-level guided inquiry teaching classes, curiosity has a stronger influence on creativity, and it mediates the relationship between mathematical modeling competency and creativity more strongly. This study empirically verified the influence of mathematical modeling competency on creativity and provided a possible way to cultivate children's creativity. Future research should use longitudinal analysis to verify the causal relationship between mathematical modeling competency and creativity and to systematically explore the possible path by which mathematical modeling competency affects creativity.