Placing vertices based upon mouse position

In blender I want to make a script that enables me to place vertices based upon mouse position, when the mouse is clicked, what is the best way that I can place the vertices?

With nothing selected which in edit mode hold cntrl and click the left mouse button.

sorry if I didn’t clarify, I meant via python script. Like, using: Mesh.verts.extend([x,y,z])
where the [x,y,z] is determined by mouse position