The rural areas of North China Plain, an important grain producer in China, are endowed with abundant new energy resources such as biomass, solar, and wind energy. The revitalization of the rural villages is confronted with the shortage of clean and low carbon energy supply. This work proposes a multi-energy complementary distributed energy system (DES) tailored for daily energy consumption in a typical scattered village on the basis of the field survey results. The geothermal heat pump, photovoltaic system (PV), biomass gasification equipment, and other energy conversion devices are integrated in the DES model. The state grid is used as a fundamental ensuring resource to improve the robustness of the system. The improved particle swarm optimization (PSO) algorithm is employed to determine the optimal unit capacity configuration by examining investment cost, payback period, system self-sufficiency, accommodation rate, and annual CO2 emissions. The main available renewable energy resources are biomass and solar energy with the annual amount of 1608.9 tons and 1679 kW h/m2. The heat, gas, and electricity load account for 76.84%, 3.14%, and 20.02%, respectively. Based on the daily peak-to-valley price differentials in Beijing of over $0.15/kWh, DES optimization was carried out with PSO module in MATLAB software. The cost of the energy supply with DES, Scenario 3, was compared with that of the mere grid and renewable systems, Scenario 1 and Scenario 2. The direct DES cost is $0.52 million with the internal rate of return of 8.46%, resulting in a payback period of 6.15 years. The overall system self-sufficiency index except for grid achieved a value of 0.42. The application of the DES lead to energy costs of residents and annual carbon emission reduction by 32.5% and more than 3800 tons, respectively, compared to grid-only energy consumption, showcasing the feasibility of grid-aided combined heat and electricity production in rural areas.