BGE->bpy->BGE

You need a script that runs in Blender to listen to the socket and perform the operations you request via this connection.
You need a Python controller in your game which sends these requests and receives the responses.

You need a script that runs in Blender to listen to the socket and perform the operations you request via this connection.

OK, Thank you sensei! That is the problem, how do I use the game to open the blend, and make it run the script? Because this is a game, and if that is possible, I prefer having blender running on the background. It might also be done outside the game, via, lets say (command prompt). Also I dont know much about bpy, will have to study more.

You need a Python controller in your game which sends these requests and receives the responses.

Appears to be the easy part.

Thank you very much Monster Sensei!

Are you trying make voxels or marching cubes?Because that is what it sounds like.Because why else would you want to do that.

Marching cubes is an algorithm and not an entity in its own right. Being able to edit meshes in real-ish time has many different use cases, such as destruction, terrain generation and a number of other cases.