  In this paper, we propose local matrix generalizations of the classical
$W$-algebras based on the second Hamiltonian structure of the
$\mathcal{Z}_m$-valued KP hierarchy, where $\mathcal{Z}_m$ is a maximal
commutative subalgebra of $gl(m,\mathbb{C})$.
