Approximately 1 in 20 people develops kidney stones at some point in their life. Although the surgical removal of stones is common, the recurrence rate remains high and it is therefore important to prevent the occurrence of kidney stones. We chose Astragalus membranaceus (AM), which is a traditional Chinese medicine, to study the prevention of urolithiasis using a Drosophila model based on our previous screening of traditional Chinese herbs. Wild-type Drosophila melanogaster Canton-S adult fruit flies were used in this study. Ethylene glycol (EG, 0.5%) was added to food as a lithogenic agent. The positive control agent (2% potassium citrate (K-citrate)) was then compared with AM (2, 8, and 16 mg/mL). After 21 days, the fruit flies were sacrificed under carbon dioxide narcotization, and the Malpighian tubules were dissected, removed, and processed for polarized light microscopy examination to observe calcium oxalate (CaOx) crystallization. Then, the ex vivo dissolution of crystals in the Malpighian tubules was compared between K-citrate and AM. Survival analysis of the EG, K-citrate, and AM groups was also performed. Both 2% K-citrate and AM (16 mg/mL) significantly inhibited EG-induced CaOx crystal formation. Mean lifespan was significantly reduced by the administration of EG, and the results were significantly reversed in the AM (8 and 16 mg/mL) groups. However, AM extract did not directly dissolve CaOx crystals in Drosophila Malpighian tubules ex vivo. In conclusion, AM extract decreased the ratio of CaOx crystallization in the Malpighian tubules and significantly ameliorated EG-induced reduction of lifespan. AM prevented CaOx crystal formation in the Drosophila model.