Microbial fuel cell (MFC) is a technology that can generate electricity while degrading excess sludge. However, the complex components, intricate biological structures, and inhibitory compounds in sludge limit the application of MFC. Therefore, this study utilized chlorination as a sludge pretreatment method to improve the comprehensive performance of MFC in sludge treatment. Results showed that pre-chlorination at a dose of 0.2 mg/L increased output voltage of MFC by 500 % from approximately 100 mV to around 600 mV, and power density by 15.60 % from 3.15 W/m³ to 3.64 W/m³, and simultaneously increased the degradation of sludge MLSS (mixed liquor suspended solids), MLVSS (mixed liquor volatile suspended solids), EPS (extracellular polymeric substances) polysaccharide and protein by 9.64 %, 47.07 %, 18.63 % and 16.26 %, respectively. Molecular composition analysis of EPS in sludge by three-dimensional excitation emission matrix fluorescence spectroscopy (3D-EEM), Fourier transform infrared spectroscopy (FTIR) and Fourier transform ion cyclotron resonance mass spectrometry (FT-ICR-MS) indicated pre-chlorination significantly promoted the molecular transformation in MFC. The microbiome analysis of anode biofilm in MFC by scanning electron microscopy (SEM), confocal laser scanning microscopy (CLSM), metagenomics and metametabolomics revealed that pre-chlorination facilitated the development of biomass, enrichment of electricity-producing bacteria (EPB), enhancement of electricity-producing activity and metabolic activity. Moreover, the sludge EPS was the importance source for the microbial metabolites in MFC was validated by the joint analysis of FT-ICR-MS and metametabolomics.