The invention discloses a microbial fuel cell with double chambers for simultaneous phosphorus and nitrogen removal. The fuel cell comprises a reaction system and a data acquisition monitoring system. The reaction system comprises an anode reaction system and a cathode reaction system, wherein the anode reaction system comprises anode microorganisms, an anode electrode, an anode chamber, a sampling hole, a sample feeding hole and an electrolyte; the cathode reaction system comprises cathode microorganisms, a cathode electrode, a cathode chamber, a water feed pipe, a water outlet pipe, a constant flow pump hose, an air-blowing pump, a brown buffer bottle, an aeration head, a constant flow pump and an electrolyte. The anode electrode and the cathode electrode are tightly attached on the two sides of a proton exchange membrane. The data acquisition monitoring system comprises a static wire, a load, a lead, a data acquirer and a computer. The microbial fuel cell runs discontinuously, and is simple in structure, low in internal resistance and efficient and stable in performance; the microbial fuel cell has the effects in two aspects of capacity and water treatment, and therefore, a new method is developed for phosphorus and nitrogen removal by use of the microbial fuel cells.