Magma intrusion has an important influence on the physical and mechanical properties of coal and rock. In the area of magma intrusion, disasters such as gas outburst are prone to occur. Revealing its invasion law will be conducive to disaster management and energy development. For this purpose, changes in industrial analysis components of coal, mineral composition, major oxides, trace elements, and rare earth elements of coal under the thermal metamorphism of magma intrusion were analyzed. It is found that the moisture and volatile matter contents of the thermally affected coals in the mining face are generally lower than that of normal coals, while moisture and volatile matter contents are reduced towards to the magma intrusion contact. For example, the moisture and volatile matter of coal sample M01 decreased by 64.6% and 38.6% respectively compared with coal sample M05. During magma intrusion, some minerals remain on the surface of the coal body, resulting in changes in the mineral composition of the coal body. The decrease in carbon atom net spacing, the increase in crystallite aggregation and ductility, and aromaticity in thermally affected coals have a positive impact on the improvement of coal metamorphism. Due to the influences of magmatic intrusion, the variation rules of major oxides in coal are different, and the closer to the magmatic intrusion zone, the easier the major oxides are to be depleted. However, magma intrusion will not lead to the loss of all major oxides in thermally affected coals, such as content of CaO is 54.8%, which is higher than that of coal not affected by magmatic hydrothermal fluid. Most of the trace elements in the thermally affected coals of the No. 9 coal seam are depleted. The contents of rare earth elements are low on the whole coalbasis, with an average of 29.48 μg/g, and the distribution pattern towards to magmatic intrusion shows a wide and gentle “V” curve with left high and right low, showing the characteristics of enrichment of light rare earth elements.