In order to improve the mechanical, thermal and flame-resistant properties of polyimide foams (PIFs), in the present study, flexible polyimide (PI)/graphite composite foams were prepared with dianhydride and isocyanate as the starting materials and graphite as the filler. The experimental results showed that most cells of PIFs possessed an open cell structure, and the open cell content decreased by graphite incorporation. While with the increase in graphite, the distribution of cellular size became uneven and the size distribution became broad. The compressive strength increased initially and then decreased and reached the maximum value of 26.4 kPa when the graphite content was 1.98 wt%, but all the composite foams exhibited higher strength than the neat PIF. In addition, the limiting oxygen index increased from 31% to 34.8% with the increase in graphite from 0 wt% to 3.25 wt%. The peak heat release rate of composite foams was 2.3% to 24.7% lower than the neat PIF and reached a minimum value of 42.36 kW m−2 with the graphite content of 1.98 wt%. Considering the above analysis, it is feasible to improve mechanical properties, thermal stability and flame-resistant properties of PIFs by graphite addition.