I want to get the position of the mouse

The added object is often at the world origin, and I want to make a button to bring it directly to the mouse position or to the center area of the viewport.
Is it possible, thanks!
Is it possible, thanks!