||We present a method to construct a Hilbert space for dynamical mean-field theory, exploiting the sparsity structure of the impurity Hamiltonian. While it is relatively easy to obtain the ground state energy with limited accuracy, calculating Green functions requires special care to build appropriate Hilbert spaces. Insufficient accuracy results in an unphysical self-energy, breaking the self-consistency of the dynamical mean-field solution. We introduce processes particle (or hole) creation followed by adaptive truncation to avoid the breakdown. As a benchmark, we apply the method to the one-dimensional Hubbard model with a cluster of eight impurity sites.