We consider an optimal control problem for a model of a Stirling engine that is actively controlled through its displacer piston motion. The framework of optimal periodic control (OPC) is used as the setting for this active control problem. We use the idealized isothermal Schmidt model for the system dynamics and formulate the control problem so as to maximize mechanical power output while trading off a penalty on control (displacer motion) effort. An iterative first-order algorithm is used to obtain the optimal periodic motion of the engine and control input. We show that optimal motion is typically nonsinusoidal with significant higher harmonic content, and that a significant increase in the power output of the engine is possible through the optimal scheduling of the displacer motion. These results indicate that OPC may provide a framework for a large class of energy conversion and harvesting problems in which active actuation is available.