This work presents a new methodology for designing input and output filters to be applied in a three-phase matrix converter, with an optimization problem solved by a metaheuristic algorithm. The algorithm determines the optimal values of the passive elements of the filters, taking as the fundamental performance criterion the response in magnitude. It is based on the resonant frequency, in order to eliminate the harmonics in the input currents and the output voltages produced by the bidirectional switching and disturbances in the power supply. These filters are implemented in a direct matrix converter using a Venturini-type modulation in open loop configuration. Other developments for this filter design have been carried out, but most of them were based on the conventional procedure of determining a random value for some element and then finding the magnitude of the remaining elements. That approach does not ensure the best dynamic filter response. The proposed design technique requires no initial elements, since all values are calculated by the metaheuristic algorithm.