kRPC allows you to control Kerbal Space Program from scripts running outside of the game. It comes with client libraries for many popular languages including C#, C++, C, Java, Lua, Python and others. It also supports websockets and serialio (for example on Arduino).
The mod exposes most of KSPs API for controlling and interacting with rockets, and also includes support several popular mods including Ferram Aerospace Research, Kerbal Alarm Clock and Infernal Robotics.
This functionality is provided to client programs via a server running in the game. Client scripts connect to this server and use it to execute ‘remote procedures’. This communication can be done on local machine only, over a local network, or even over the wider internet if configured correctly. The server is extensible - additional remote procedures (grouped into “services”) can be added to the server using the Service API.