  Let $R$ be an integral domain and $G$ be a subgroup of its group of units. We
consider the category $\mathbf{\mathsf{Cob}}_G$ of 3-dimensional cobordisms
between oriented surfaces with connected boundary, equipped with a
representation of their fundamental group in $G$. Under some mild conditions on
$R$, we construct a monoidal functor from $\mathbf{\mathsf{Cob}}_G$ to the
category $\mathbf{\mathsf{pLagr}}_R$ consisting of "pointed Lagrangian
relations" between skew-Hermitian $R$-modules. We call it the "Magnus functor"
since it contains the Magnus representation of mapping class groups as a
special case. Our construction is inspired from the work of Cimasoni and Turaev
on the extension of the Burau representation of braid groups to the category of
tangles. It can also be regarded as a $G$-equivariant version of a TQFT-like
functor that has been described by Donaldson. The study and computation of the
Magnus functor is carried out using classical techniques of low-dimensional
topology. When $G$ is a free abelian group and $R = Z[G]$ is the group ring of
$G$, we relate the Magnus functor to the "Alexander functor" (which has been
introduced in a prior work using Alexander-type invariants), and we deduce a
factorization formula for the latter.
