Optical codes with large cardinality and tree structure of multiple levels of subsets of codewords for adjustable performance and cardinality have recently been studied. These codes support contemporary applications, such as a scalable, multihop, multilevel network architecture with rapid codeswitching/dropping and multicode-keying encryption for improving physical-layer confidentiality in optical code-division multiple-access systems and networks. In this paper, to further enlarge such code collection, two new families of optical codes are constructed from the rich families of cyclic maximal-distanceseparable (MDS) codes. The code performances are algebraically analyzed using both the distance and weight distributions of the MDS codes and validated with computer simulation.