We present a unified framework for renormalization group methods, including Wilsons numerical renormalization group (NRG) and Whites density-matrix renormalization group (DMRG), within the language of matrix product states. This allows improvements over Wilsons NRG for quantum impurity models, as we illustrate for the one-channel Kondo model. Moreover, we use a variational method for evaluating Greens functions. The proposed method is more flexible in its description of spectral properties at finite frequencies, opening the way to time-dependent, out-of-equilibrium impurity problems. It also substantially improves computational efficiency for one-channel impurity problems, suggesting potentially emph{linear} scaling of complexity for $n$-channel problems.