We study chiral algebras associated with Argyres-Douglas theories engineered from M5 brane. For the theory engineered using 6d (2,0) type J theory on a sphere with a single irregular singularity (without mass parameter), its chiral algebra is the minimal model of W algebra of J type. For the theory engineered using an irregular singularity and a regular full singularity, its chiral algebra is the affine Kac-Moody algebra of J type. We can obtain the Schur index of these theories by computing the vacua character of the corresponding chiral algebra.