An effective interaction for the mean-field calculations is explored from a semimicroscopic standpoint. The M3Y interaction is modified so as to reproduce the saturation density, energy and the LS splittings. This semi-microscopic interaction describes the properties of the symmetric nuclear matter reasnoably well. This interaction is also applied to the Hartree-Fock calculations for the stable and unstable oxygen isotopes by using the recently proposed numerical method. Recent experimental data have disclosed the exotic structure of unstable nuclei. 1) We have halos or skins in several nuclei close to the neutron drip line. It has also been clarified that the well-known magic numbers in the β-stability can disappear and new magic numbers may appear in the neutron-rich region. These observed phenomena cast some quests on the nuclear mean-field and the single-particle orbits built on it. The existence of the halos indicates the importance of the wavefunction asymptotics, which is not easy to be handled in numerical calculations. The effective interactions for the mean-field calculations have been developed so as to reproduce the properties of the nuclei in and around the β-stability. However, depending on the parameters, these interactions behave differently from one another in the neutron-rich region. In order to investigate the effective interaction for the neutron-rich nuclei, microscopic interactions would provide us with a guidance. In this regard, the so-called M3Y interaction, 2) which is derived from the bare NN interaction and still have a tractable form, seems to give a suitable starting point. The M3Y interaction has been successfully applied to the low-energy nuclear reactions with slight modification, and is also known to be moderately good as a shell-model interaction. We have recently proposed a new method to implement the Hartree-Fock (HF) calculations. 3) In this method we can handle finite-range interactions even with the Yukawa form, and the wave-function asymptotics can be properly reproduced. In this work we discuss modification of the M3Y interaction from the mean-field viewpoints, and apply the modified interaction to stable and unstable oxygen isotopes.