We present a unified framework for renormalization group methods, including Wilson's numerical renormalization group (NRG), and White's density-matrix renormalization group (DMRG), within the language of matrix-product-states. This allows improvements over Wilson's NRG for quantum impurity models, as we illustrate for the one-channel Kondo model. Moreover, we use a variational method for evaluating Green's 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 linear scaling of complexity for n-chann...