Several studies have investigated the causative role of the microbiome in the development of rheumatoid arthritis (RA), but changes in the gut microbiome in RA patients during drug treatment have been less well studied. Here, we tracked the longitudinal changes in gut bacteria in 22 RA patients who were randomized into two groups and treated with Huayu-Qiangshen-Tongbi formula (HQT) plus methotrexate (MTX) or leflunomide (LEF) plus MTX. There were differences in the gut microbiome between untreated (at baseline) RA patients and healthy controls, with 37 species being more abundant in the RA patients and 21 species (including Clostridium celatum) being less abundant. Regarding the functional analysis, vitamin K2 biosynthesis was associated with RA-enriched bacteria. Additionally, in RA patients, alterations in gut microbial species appeared to be associated with RA-related clinical indicators through changing various gut microbiome functional pathways. The clinical efficacy of the two treatments was further observed to be similar, but the response trends of RA-related clinical indices in the two treatment groups differed. For example, HQT treatment affected the erythrocyte sedimentation rate (ESR), while LEF treatment affected the C-reactive protein (CRP) level. Further, 11 species and 9 metabolic pathways significantly changed over time in the HQT group (including C. celatum, which increased), while only 4 species and 2 metabolic pathways significantly changed over time in the LEF group. In summary, we studied the alterations in the gut microbiome of RA patients being treated with HQT or LEF. The results provide useful information on the role of the gut microbiota in the pathogenesis of RA, and they also provide potentially effective directions for developing new RA treatments.