  We calculate the Sivers and $\cos2\phi$ azimuthal asymmetries in $J/\psi$
production in polarized and unpolarized semi-inclusive $ep$ collision
respectively, using the formalism based on transverse momentum dependent parton
distributions (TMDs). Non-relativistic QCD based color octet model is employed
for calculating the $J/\psi$ production rate. The Sivers asymmetry in this
process directly probes the gluon Sivers function. The estimated Sivers
asymmetry at $z=1$ is negative which is in good agreement with COMPASS data. We
also investigate the effect of TMD evolution on the Sivers asymmetry. The
$\cos2\phi$ asymmetry is sizable and probes the linearly polarized gluon
distribution in an unpolarized proton.
