  We present an algorithm for computing the $p$-component of the automorphic
representation arising from a cuspidal newform $f$ for a prime $p$. This is
equivalent to computing the restriction to the decomposition group at $p$ of
the $\ell$-adic Galois representations attached to $f$ for any $\ell\neq p$.
The situation is most interesting when $p^2$ divides the level of $f$, in which
case the $p$-component could be supercuspidal. In the supercuspidal case, the
local component is induced from an irreducible character of a
compact-mod-center subgroup of $\text{GL}_2(\mathbf{Q}_p)$; our algorithm
outputs both the group and the irreducible character. We provide examples which
illustrate how the local Galois representation can be completely read off from
the local component.
