Novel materials are being enabled by advances in synthesis techniques that achieve ever better control over the atomic-scale structure of materials. The pace of materials development has been further increased by high-throughput computational experiments guided by informatics and machine learning. We have previously demonstrated complimentary approaches using mathematical optimization models to search through highly combinatorial design spaces of atomic arrangements, guiding the design of nanostructured materials. In this paper, we highlight the common features of materials optimization problems that can be efficiently modeled via mixed-integer linear optimization models. To take advantage of these commonalities, we have created MatOpt, a Python package that formalizes the process of representing the design space and formulating optimization models for the on-demand design of nanostructured materials. This tool serves to bridge the gap between practitioners with expertise in materials science and those with expertise in formulating and solving mathematical optimization models, effectively lowering the barriers for applying rigorous numerical optimization capabilities during nanostructured materials development.