This document proposes an optimal relay selection and beamforming scheme for MIMO cognitive multi-relay networks. The problem is formulated as selecting the optimal relay and designing the beamforming matrix to maximize the secondary user's signal-to-noise ratio under transmit power constraints at the relays and interference power constraints at the primary users. Simulation results show that the average capacity increases with the maximum transmit power at relays and the number of relays and antennas.