We develop the Maxwell-Garnett theory for the effective medium approximation of composite materials with metallic nanoparticles by taking into account the quantum spatial dispersion effects in dielectric response of nanoparticles. We derive a quantum nonlocal generalization of the standard Maxwell-Garnettformula, by means the linearized quantum hydrodynamic theory in conjunction with the Poisson equationas well as the appropriate additional quantum boundary conditions.