The yield of a microbial fuel cell (MFC) is significantly influenced by the media composition, which mainly consists of carbon, nitrogen sources and aeration rate. This study uses fuzzy modelling and optimization to enhance the performance of MFC. First, a simulation of the microbial fuel cell model using three input parameters—glucose (g/L), yeast extract (g/L), and aeration (ml/min)—was performed using experimental data sets. Three output parameters—power density (W/m2), COD removal (%), and coulombic efficiency (%)—are used to assess the performance. Then, the ideal values for three input controlling parameters are found using the salp swarm optimizer (SSO) for simultaneously increasing power density, COD elimination, and coulombic efficiency. For the fuzzy model of the power density, the RMSE values for the training and testing data sets are 1.35 e−07 and 0.0424, respectively. The R-squared values for training and testing are 1.0 and 0.98, respectively. Low RMSE values and high R-squared proved the accuracy of fuzzy model. Then using, SSA, the coulombic efficiency climbed from 38 % to 40.33 %, and the COD removal went from 80 % to 81.71 %. Under this condition, the performance index increased from 118.525 to 122.532 by around 3.4 %