Modification of implantable scaffolds with magnesium and zinc for improvement of bone regeneration is a growing trend in the engineering of biomaterials. The aim of this study was to synthesize nano-hydroxyapatite substituted with magnesium (Mg2+) (HA-Mg) and zinc (Zn2+) (HA-Zn) ions in order to fabricate chitosan-agarose-hydroxyapatite (HA) scaffolds (chit/aga/HA) with improved biocompatibility. Fabricated biomaterials containing Mg2+ or Zn2+ were tested using osteoblasts and mesenchymal stem cells to determine the effect of incorporated metal ions on cell adhesion, spreading, proliferation, and osteogenic differentiation. The study was conducted in direct contact with the scaffolds (cells were seeded onto the biomaterials) and using fluid extracts of the materials. It demonstrated that incorporation of Mg2+ ions into chit/aga/HA structure increased spreading of the osteoblasts, promoted cell proliferation on the scaffold surface, and enhanced osteocalcin production by mesenchymal stem cells. Although biomaterial containing Zn2+ did not improve cell proliferation, it did enhance type I collagen production by mesenchymal stem cells and extracellular matrix mineralization as compared to cells cultured in a polystyrene well. Nevertheless, scaffolds made of pure HA gave better results than material with Zn2+. Results of the experiments clearly showed that modification of the chit/aga/HA scaffold with Zn2+ did not have any positive impact on cell behavior, whereas, incorporation of Mg2+ ions into its structure may significantly improve biocompatibility of the resultant material, increasing its potential in biomedical applications.