Graphene composite foam with enhanced mechanical and electrochemical properties holds great promise for flexible supercapacitors. This work developed a cost-effective method for massive production of three-dimensional (3D) porous graphene composite using melamine foam (MF) as a flexible scaffold. The MF was coated reduced graphene oxide (RGO) to form an interconnected conductive layer by dip-coating and vapor reduction, and loaded with polyaniline (PANI) by in-situ polymerization. The resulted PANI/RGO/MF, as self-supporting electrode, exhibits extraordinary mechanical flexibility and a high specific capacitance of 806.2 mF cm−2 at 0.5 mA cm−2. Furthermore, the assembled solid-state supercapacitor exhibits an outstanding capacity of 299.1 mF cm−2 at 0.5 mA cm−2, a high energy density of 26.6 μWh cm−2 at 200 μW cm−2, nearly 100 % capacitance retention at 0°–180°, and good cycling stability. This study provides a scalable strategy for fabricating graphene composite foam suitable for flexible energy storage application.