Space missions have always assumed that the risk of spacecraft malfunction far outweighs the risk of human system failure. This assumption breaks down for longer duration exploration missions and exposes vulnerabilities in space medical system. Space agencies can no longer buy down the majority of human system risk through the crew member selection process and emergency re-supply or evacuation. No mature medical solutions exist to close the risk gap. With recent advances in biotechnology, there is promise in augmenting a space pharmacy with a biologically-based space foundry for on-demand manufacturing of high-value medical products. Here we review the challenges and opportunities of molecular pharming, the production of pharmaceuticals in plants, as the basis of a space medical foundry to close the risk gap in current space medical systems. Plants have long been considered an important life support object in space and can now also be viewed as programmable factories in space. Advances in molecular pharming-based space foundries will have widespread application in promoting simple and accessible pharmaceutical manufacturing on Earth.