Coenzyme F420 is a microbial redox cofactor that mediates diverse physiological functions and is increasingly used for biocatalytic applications. Recently, diversified biosynthetic routes to F420 and the discovery of a derivative, 3PG-F420, were reported. 3PG-F420 is formed via activation of 3-phospho-D-glycerate (3-PG) by CofC, but the structural basis of substrate binding, its evolution, as well as the role of CofD in substrate selection remained elusive. Here, we present a crystal structure of the 3-PG-activating CofC from Mycetohabitans sp. B3 and define amino acids governing substrate specificity. Site-directed mutagenesis enabled bidirectional switching of specificity and thereby revealed the short evolutionary trajectory to 3PG-F420 formation. Furthermore, CofC stabilized its product, thus confirming the structure of the unstable molecule and revealing its binding mode. The CofD enzyme was shown to significantly contribute to the selection of related intermediates to control the specificity of the combined biosynthetic CofC/D step. These results imply the need to change the design of combined CofC/D activity assays. Taken together, this work presents novel mechanistic and structural insights into 3PG-F420 biosynthesis and evolution and opens perspectives for the discovery and enhanced biotechnological production of coenzyme F420 derivatives in the future.