In the present study, a direct semi‐active control method is introduced to mitigate the seismic responses of structures equipped with magnetorheological (MR) dampers. Bouc–Wen model is utilized to investigate the nonlinear behavior of the MR dampers, and an efficient controller is proposed based on this model features. In this method, for conducting the MR damper control force close to the estimated optimal control force at any moment, the optimal magnitude of current voltage that is applied to produce a magnetic field in the MR damper is calculated through the use of linear quadratic regulator optimal control algorithm. This algorithm is applied to control seismic vibrations of a three‐story and an 11‐story sample shear building that have been equipped with the MR damper control system, and the performance of the controller is evaluated. Copyright © 2012 John Wiley & Sons, Ltd.