Stroke is a neurological disorder that profoundly affects patients' neural function and daily life. Although rehabilitation methods have made significant progress, there is still a need for innovative treatment strategies to improve the recovery outcomes of stroke patients. In this study, we employed electroencephalography (EEG) microstate analysis to investigate the influence of transcranial magnetic stimulation (TMS) on upper limb functional Rehabilitation in stroke patients with right hemiplegia, while also exploring the relationship between microstate patterns and improvements in muscle strength. The study involved 20 stroke patients with right-sided hemiparesis and 20 healthy right-handed control subjects recruited. All subjects underwent EEG and EMG data collection in a resting state. Before and after treatments,using the Upper Extremity Section of the Fugl-Meyer Assessment(FMA-UE) and the Action Research Arm Test (ARAT) to assess the upper extremity function of stroke patients. After one week of TMS treatment, data collection was repeated for patients. After TMS intervention, the FMA-UE scores and ARAT scores of stroke patients were significantly improved compared to the pre-treatment period (p < 0.05). Microstate B exhibited reduced time coverage and occurrence frequency in stroke patients (p < 0.05), but following TMS treatment, there was a significant increase in time coverage, approaching levels seen in the healthy control group (p < 0.05). Furthermore, we observed a significant reduction in the duration and time coverage of Microstate C and Microstate D following TMS treatment (p < 0.05). Encouragingly, the improvement in time coverage and occurrence frequency of Microstate B was positively correlated with the enhanced abilities of specific muscle groups, including upper limb muscles such as the flexor carpi ulnaris and extensor carpi ulnaris, highlighting the close relationship between Microstate B and improvements in motor control and muscle coordination. Changes in Microstate C were positively correlated with increased upper limb muscle strength, suggesting that Microstate C may play a crucial role in motor control and muscle coordination. This suggests that TMS may have a positive impact on neurorehabilitation in stroke patients, particularly concerning rehabilitation goals associated with Microstate B. In conclusion, our study underscores TMS can effectively promote upper limb motor function in stroke patients with right-sided hemiplegia and the critical link between microstate analysis and motor function recovery in stroke patients. Microstate B and Microstate C may serve as physiological indicators for assessing the progress of motor rehabilitation, providing valuable insights for developing more effective rehabilitation strategies and personalized rehabilitation plans.