  We present detailed numerical studies of the magnetic anisotropy energy of a
magnetic impurity near the surface of metallic hosts (Au and Cu), that we
describe in terms of a realistic tight-binding surface Green's function
technique. We study the case when spin-orbit coupling originates from the
d-band of the host material and we also investigate the case of a strong local
spin-orbit coupling on the impurity itself. The splitting of the impurity's
spin-states is calculated to leading order in the exchange interaction between
the impurity and the host atoms using a diagrammatic Green's function
technique. The magnetic anisotropy constant is an oscillating function of the
separation d from the surface: it asymptotically decays as 1/d2 and its
oscillation period is determined by the extremal vectors of the host's Fermi
Surface. Our results clearly show that the host-induced magnetic anisotropy
energy is by several orders of magnitude smaller than the anisotropy induced by
the local mechanism, which provides sufficiently large anisotropy values to
explain the size dependence of the Kondo resistance observed experimentally.
