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 ℓ-adic Galois representations attached to f for any ℓ=p. The situation is most interesting when p2 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 GL2(Qp); 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.