We study the algebra MD of generating functions for multiple divisor sums and its connections to multiple zeta values. The generating functions for multiple divisor sums are formal power series in q with coefficients in Q arising from the calculation of the Fourier expansion of multiple Eisenstein series. We show that the algebra MD is a filtered algebra equipped with a derivation and use this derivation to prove linear relations in MD. The (quasi-)modular forms for the full modular group SL2(Z) constitute a subalgebra of MD, and this also yields linear relations in MD. Generating functions of multiple divisor sums can be seen as a q-analogue of multiple zeta values. Studying a certain map from this algebra into the real numbers we will derive a new explanation for relations between multiple zeta values, including those of length 2, coming from modular forms.