A numerical scheme based on the method of fundamental solutions (MFS) is proposed for the solution of 2D and 3D Stokes equations. The fundamental solutions of the Stokes equations, Stokeslets, are adopted as the sources to obtain flow field solutions. The present method is validated through other numerical schemes for lid-driven flows in a square cavity and a cubic cavity. Test results obtained for a rectangular cavity with wave-shaped bottom indicate that the MFS is computationally efficient than the finite element method (FEM) in dealing with irregular shaped domain. The paper also discusses the effects of number of source points and their locations on the numerical accuracy.