Quillen shows at the beginning of his article on higher algebraic K-theory that you can calculate the fundamental group $\pi_1(C,a)$ of a category $C$ at an object $a$ by forming the localisation $C[\operatorname{Mor}(C)^{-1}]$ at all arrows, then by taking $\operatorname{Hom}(a,a) = \operatorname{Aut}(a)$ in this groupoid. There are size issues, clearly, but for essentially small $C$ these can be ignored.