Ophiocordyceps xuefengensis is an ethnopharmacological fungus with broad pharmacological properties. Light is a critical environmental factor for the stromata formation and development of many fungi. In this study, photomorphogenesis and blue light receptor genes were studied using a strain of O. xuefengensis. Light represses vegetative growth, but conidia linked to stromata can be observed under both light and dark conditions. Light and dark conditions had little effect on the accumulation of polysaccharides and adenosine. The genes Oxwc-1 and Oxwc-2 encoding photoreceptors of O. xuefengensis were cloned and predicted to possess polypeptides of 937 and 525 amino acids, respectively. A phylogenetic analysis based on fungal WC-1/2 supported OxWC-1 and OxWC-2 were photoreceptor. The expression of both the Oxwc-1 and Oxwc-2 genes reached a maximum after receiving light stimulation for 15 min, which might relate to the inhibition of stromata growth.