Getting Started#

This guide sets up the kRPC for KSA server, and runs a Python script that reads telemetry from the game.

The Server Mod#

Installation#

The server is a code mod, which runs in the game through StarMap, the KSA code mod loader. The simplest way to install it is with the Borea mod manager. Borea installs StarMap and the mod, and launches the game through StarMap.

To install the mod by hand:

  1. Install StarMap 0.4.8.

  2. Copy the kRPC folder from the release archive into the KSA mods folder, <Documents>/My Games/Kitten Space Agency/mods.

  3. Enable the mod in <Documents>/My Games/Kitten Space Agency/manifest.toml:

    [[mods]]
    id = "kRPC"
    enabled = true
    
  4. Launch the game through StarMap.

Note

Version 0.1.0 named the mod kRPC.KSA. To upgrade from it, delete the mods/kRPC.KSA folder, and change its manifest.toml entry to id = "kRPC".

The server starts once the game has loaded its mods. It listens on 127.0.0.1, with RPC port 50000 and stream port 50001, and accepts every connection.

Game Versions#

kRPC for KSA 0.2.0 is built for KSA 2026.10.25.5707, and may run on other versions. If the mod detects that the game version is not supported, a pop-up warns you, and lists the RPCs that use game code missing from it. Those RPCs throw an exception when called. Other RPCs may still behave differently, as the check finds only missing code. Don’t show again for this version hides the pop-up until the game updates.

Configuration#

The kRPC menu in the game’s menu bar opens the server window and the server info window, and starts and stops the server. The server window shows each server’s address and connected clients, and edits its protocol, address and ports. Advanced settings at the bottom of the window holds the connection and rate control settings. The kRPC documentation describes the rate control settings in more detail.

Set the address to Any to accept connections from other machines.

The window saves its settings to kRPC/settings.toml in the mods folder. Installing the mod again restores the default settings.

The Python Client#

Installation#

Install the kRPC Python client from PyPI:

pip install krpc==0.7.0

Your First Script#

This script connects to the game, and prints the bodies of the system and the active vehicle:

conn = krpc.connect(name="KSA telemetry")
ksa = conn.ksa
print(f"Bodies: {', '.join(sorted(ksa.bodies))}")

vehicle = ksa.active_vehicle
print(f"Active vehicle: {vehicle.name} ({vehicle.situation})")

The complete script, telemetry.py, goes on to print the vehicle’s altitude, apoapsis and attitude once a second.

Next Steps#

  • The Tutorials walk through complete scripts, from Launching into Orbit to planning and executing burns.

  • The User Guides describe how the server and the game behave, from reference frames to the auto-pilot. They cover running code in the game using server side functions, the timing of calls, and the lifetime of the objects the server returns.

  • The Clients pages cover installing and using each client language, with its API reference.