The magnetic anisotropy and exchange coupling between spins localized at the positions of 3d transition metal atoms forming two-dimensional metal–organic coordination networks (MOCNs) grown on a Au(111) metal surface are studied. In particular, we consider MOCNs made of Ni or Mn metal centers linked by 7,7,8,8-tetracyanoquinodimethane (TCNQ) organic ligands, which form rectangular networks with 1:1 stoichiometry. Based on the analysis of X-ray magnetic circular dichroism (XMCD) data taken at T = 2.5 K, we find that Ni atoms in the Ni–TCNQ MOCNs are coupled ferromagnetically and do not show any significant magnetic anisotropy, while Mn atoms in the Mn–TCNQ MOCNs are coupled antiferromagnetically and do show a weak magnetic anisotropy with in-plane magnetization. We explain these observations using both a model Hamiltonian based on mean-field Weiss theory and density functional theory calculations that include spin–orbit coupling. Our main conclusion is that the antiferromagnetic coupling between Mn spins and the in-plane magnetization of the Mn spins can be explained by neglecting effects due to the presence of the Au(111) surface, while for Ni–TCNQ the metal surface plays a role in determining the absence of magnetic anisotropy in the system.