The magnetic and transport properties of the metal phthalocyanine (MPc) and F$_{16}$MPc (M = Sc, Ti, V, Cr, Mn, Fe, Co, Ni, Cu, Zn and Ag) families of molecules in contact with S-Au wires are investigated by density functional theory within the local density approximation, including local electronic correlations on the central metal atom. The magnetic moments are found to be considerably modified under fluorination. In addition, they do not depend exclusively on the configuration of the outer electronic shell of the central metal atom (as in isolated MPc and F$_{16}$MPc) but also on the interaction with the leads. Good agreement between the calculated conductance and experimental results is obtained. For M = Ag, a high spin filter efficiency and conductance is observed, giving rise to a potentially high sensitivity for chemical sensor applications.