Skip to main content
Glama

kos-telnet-mcp

一个让 AI agent 通过 MCP 控制 Kerbal Space Program 里 kOS 计算机的 server。

Telnet 命令通道 + Archive 文件高带宽通道 + 本地混合检索文档引擎,110 个工具让 agent 能写、跑、调试 kerboscript,并即时拿到飞行反馈。

目录

Related MCP server: KotorMCP

架构

flowchart LR
    Agent["AI Agent<br/>(Cursor / Claude)"]
    Agent -- "MCP / stdio" --> MCP

    subgraph MCP["kos-telnet-mcp (Node + TS)"]
        direction TB
        Telnet["Telnet Bridge<br/>+ XTERM emulator"]
        Lifecycle["Program Lifecycle<br/>eval / run / write_file"]
        Recorder["Recorder Toolkit<br/>(自治采样)"]
        Sim["KUniverse / Timewarp"]
        Inspect["Craft Inspect<br/>+ 分组 Snapshot"]
        Watch["Watch / Bg / Repl"]
        Authoring["Lint / Format"]
        Docs["Docs Engine<br/>BM25 + MiniLM"]
        KB["Agent KB"]
        Scaffold["任务模板"]
        KspIO["KSP Player.log"]
    end

    MCP -- "TCP 5410" --> Game["KSP + kOS"]
    MCP -- "FS R/W" --> Archive["Ships/Script/<br/>(Archive 卷)"]
    MCP -- "FS read" --> UnityLog["Player.log"]
    Game --- Archive
    Game --- UnityLog

    subgraph Vessel["飞船"]
        CPU1["主 CPU"]
        CPU2["Recorder CPU<br/>boot 自启"]
    end
    Game --- Vessel
    CPU2 -- "WRITE / READ" --> Archive

设计要点:

  • Telnet 命令通道——所有交互(输入、读屏、求值、上传小文件)都走它;MCP 进程独占连接,工具调用全局串行化(mutex),不会互相打断。

  • Archive 高带宽通道——大文件、recorder 数据、KB 都走 KSP 的 Ships/Script/ 文件系统;agent 调 kos_recorder_tail 完全不占 telnet。

  • 本地文档检索——167 个 RST 解析后落到 .cache/docs/:BM25(minisearch)+ MiniLM 量化向量(@xenova/transformers)混合,无需联网。

  • 试错友好——kos_kuniverse_quicksave/quickload 让 agent 自由失败重来;kos_timewarp_warp_to 拉时间。

安装

需要 Node ≥ 20。

# 1. 装依赖
npm install

# 2. 编译 TypeScript(输出到 dist/)
npm run build

# 3. 一次性建文档索引(RST → BM25 + 向量;约 1 分钟,落到 .cache/docs/)
npm run docs:build

第 3 步是可选的(不建索引也能跑,但 kos_docs_* 会返回 docs_index_missing)。也可以让 agent 跑 kos_docs_rebuild_index。

配置 KSP

1. 打开游戏内 telnet

进游戏,随便上一艘有 kOS 处理器的船,打开 kOS 终端窗口(在该处理器零件的右键菜单里),输入:

SET CONFIG:TELNET TO TRUE.
SET CONFIG:TPORT TO 5410.
SET CONFIG:IPADDRESS TO "127.0.0.1".

也可以从 KSP 主菜单的 Settings → kOS 里改。

2. 让 telnet 在每次启动游戏时自启(推荐)

在 Ships/Script/boot/auto_telnet.ks 写:

SET CONFIG:TELNET TO TRUE.
SET CONFIG:TPORT TO 5410.
SET CONFIG:IPADDRESS TO "127.0.0.1".

然后在 VAB/SPH 里把任意一艘船的 kOS 处理器 boot file 设为 auto_telnet.ks。

3. 验证

游戏内随意操控,回到桌面执行:

node dist/index.js

stderr 应该输出:

[kos-telnet-mcp] ready - telnet=127.0.0.1:5410 archive=...\Kerbal Space Program\Ships\Script tools=110

tools=110 说明所有命名空间都注册成功。

配置 MCP 客户端

完整示例:config/mcp.client.example.json

Cursor

把以下内容写入 ~/.cursor/mcp.json(或 Cursor 的 Settings → MCP):

{
  "mcpServers": {
    "kos-telnet": {
      "command": "node",
      "args": ["c:/Users/liet/project/moeru/ksp/kos-telnet-mcp/dist/index.js"],
      "env": {
        "KOS_MCP_CONFIG": "c:/Users/liet/project/moeru/ksp/kos-telnet-mcp/config/kos-mcp.config.json"
      }
    }
  }
}

Claude Desktop

写入 %APPDATA%/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "kos-telnet": {
      "command": "node",
      "args": ["c:/Users/liet/project/moeru/ksp/kos-telnet-mcp/dist/index.js"]
    }
  }
}

server 端配置(kos-mcp.config.json)

参考 config/kos-mcp.config.example.json:

{
  "telnet": {
    "host": "127.0.0.1",
    "port": 5410,
    "terminal": "XTERM",
    "rows": 24,
    "cols": 80
  },
  "archive": {
    "ksp_install_dir": null,
    "auto_detect": true
  },
  "session": {
    "history_kb": 100,
    "default_wait_timeout_ms": 10000
  }
}

字段说明:

  • telnet.host/port:和 KSP CONFIG:IPADDRESS / CONFIG:TPORT 对齐。

  • archive.ksp_install_dir:KSP 安装根目录(含 Ships/、GameData/ 的那个)。null + auto_detect:true 会扫 Steam/GOG/Epic 常见路径。

  • archive.auto_detect:是否自动扫描;找到的 Ships/Script/ 会用作 archive_root。

  • session.history_kb:内存里 telnet 滚动历史的最大字节数。

  • session.default_wait_timeout_ms:kos_session_wait_for 等阻塞工具的默认超时。

加载顺序:KOS_MCP_CONFIG env → ./kos-mcp.config.json → ./config/kos-mcp.config.json → 内置默认。

快速跑通(三步)

  1. 启动 server

    node dist/index.js

    或者通过 MCP 客户端拉起。

  2. 从客户端列工具

    在 Cursor 里 @kos-telnet 应能看到 110 个 tool。或在程序里调 tools/list。

    Cursor 自 2025-11 起强制工具名只能用 [a-zA-Z0-9_]。本项目所有工具的 wire-name 都是下划线形式(kos_session_connect),调用时直接用下划线名即可。源码注释里偶尔出现的 dot 形式(kos.session.connect)只是文档惯例,runtime 已自动 normalize。

  3. 第一次列 CPU 并 attach

    先确保 KSP 跑着,飞船可控,然后 agent 调:

    kos_session_list_cpus()
    → { ok:true, cpus:[ { index:1, vessel:"Test Rocket", cpu_tag:"main", ... } ], count:1 }
    
    kos_session_connect({ index:1 })
    → { ok:true, mode:"attached", attached_cpu:{...} }
    
    kos_program_eval({ expr:"SHIP:ALTITUDE" })
    → { ok:true, result:"123.4", ... }

接下来怎么干完全交给 agent。AGENTS.md 是给它看的指南。

110 个工具一览

命名空间

数量

一句话作用

kos_session_*

11

telnet 终端:list/connect/detach、send_input、read_screen、history、wait_for、interrupt、sync_state

kos_program_*

10

程序生命周期:eval、双模式 write/read_file、list、delete、run/terminate/compile、disk_status、power_status

kos_recorder_*

8

自治飞行记录仪:install_and_start 一键部署、tail/dump/status/stop/clear/uninstall/list_sessions

kos_kuniverse_*

10

模拟控制:quicksave/quickload(_list)、pause、revert(_to_launch/_to_editor/can)、active_vessel/force_set/debug_log

kos_timewarp_*

7

set/set_index、warp_to、cancel、status、mode、wait_until_settled

kos_craft_*

8

飞船检视:parts、engines、resources、staging、crew、delta_v_budget、mass_summary、tag_lookup

kos_maneuver_*

5

机动节点:list/add/remove/clear/execute

kos_snapshot_*

9

分组遥测:orbit/fuel/attitude/thermal/throttle/target/surface/body/all

kos_watch_*

5

流式监控:add/remove/list/clear/read

kos_bg_*

4

后台触发器(基于 WHEN):start/list/kill/kill_all

kos_repl_*

5

持久状态会话:execute/set/print/get_globals/reset

ksp_log_*

6

KSP Player.log tail/grep/marker 三件套

kos_authoring_*

3

kerboscript lint、format、lint_file

kos_kb_*

5

Agent 跨会话知识库:write/read/list/delete/search

kos_scaffold_*

2

任务模板:templates、generate(launch/hohmann/suicide_burn 等 8 个)

kos_docs_*

12

文档检索:search、get_topic/structure/method/function/keyword、list_examples、cheatsheet、related、symbol_at、index_status、rebuild_index

每个工具都有完整的 zod schema 描述,agent 能直接读到入参/返回结构。

更多文档

  • AGENTS.md —— 给 LLM agent 看的速查 + 典型工作流 + kerboscript 雷区,先读这个。

  • 设计方案 —— 项目原始设计 plan,含架构图、决策依据、未实现项。

  • 各模块源码 src/<ns>/register.ts 是命名空间真相之源,描述就是 zod .describe()。

已知限制

  • ksp_screenshot 暂未实现(plan 中标为可选);建议 agent 直接用 kos_snapshot_* 获取数值数据。

  • kos_docs_* 首次使用前必须 npm run docs:build 或 kos_docs_rebuild_index;否则返回 docs_index_missing。

  • archive 路径未配置时,kos_recorder_*、kos_kb_*、kos_authoring_lint_file 会返回 no_archive_root;编辑 kos-mcp.config.json 设置 archive.ksp_install_dir。

  • kOS 1KB 本地盘:写大程序请用 kos_program_write_file 的 mode:"fs"(直接写 archive,绕过 1KB 限制),或 mode:"auto" 让 server 按大小决定。

许可

MIT。

Available Tools

110 tools
kos_authoring_formatA

Pretty-print kerboscript: uppercase keywords, 2-space indent, } on its own line, statements terminated with ., and strings/comments preserved. The formatter is idempotent.

Inputs: code (required), use_tabs, indent_size.

kos_authoring_lintA

Run the kerboscript static linter against an in-memory snippet. Returns a list of diagnostics with stable error codes (unbalanced_brace, missing_period, unterminated_string, undeclared_variable, cooked_steering_trigger, etc).

Inputs: code (required), max_diagnostics.

kos_authoring_lint_fileA

Read a file from the archive volume (or any local path) and lint it. Useful before re-uploading a recently edited script.

Inputs: path (required), max_diagnostics, archive_relative.

kos_bg_killA

Stop a background task by setting its _BG_<name>_RUN flag to FALSE. The dormant trigger remains parked until the program ends.

Inputs: name (required).

kos_bg_kill_allA

Stop every background task. Same kerboscript caveat as kos_bg_kill. Returns ok=true even when a per-task kill failed; check failures for the names.

Inputs: no named parameters.

kos_bg_listA

List every background task known to this MCP instance.

Inputs: no named parameters.

kos_bg_startA

Install a kerboscript code block as a background trigger. The block is wrapped in WHEN _BG_<name>_RUN AND (<run_until>) THEN { <code>. PRESERVE. }. WARNING: kOS interrupts the mainline to run the trigger; do NOT WAIT inside code and keep the body short or the rest of the program will starve.

Inputs: code (required), name, run_until.

kos_craft_crewB

List SHIP:CREW() with name, trait, experience, gender, tourist flag.

Inputs: timeout_ms.

kos_craft_delta_v_budgetB

Total ship delta-V plus per-stage delta-V and effective vacuum ISP (averaged across that stage's active engines).

Inputs: timeout_ms.

kos_craft_enginesA

List engines (LIST ENGINES IN _E) and report thrust, ISPs, fuel flow, ignition / flameout / throttle-lock state.

Inputs: timeout_ms.

kos_craft_mass_summaryB

Print SHIP:MASS / SHIP:DRYMASS / SHIP:WETMASS (in metric tonnes), with derived fuel = mass - dry.

Inputs: timeout_ms.

kos_craft_partsA

List parts on the current vessel. Capped at 80 rows; pass a filter to narrow down. Optionally groups results by module/stage/tag on the MCP side.

Inputs: filter, group_by, timeout_ms.

kos_craft_resourcesA

Snapshot of STAGE:RESOURCES (current stage) and SHIP:RESOURCES (whole vessel).

Inputs: timeout_ms.

kos_craft_stagingB

Current stage number, total stage count, plus delta-V (current/vac/asl/duration) for every stage from current down to 0.

Inputs: timeout_ms.

kos_craft_tag_lookupA

Find every part whose nametag matches tag exactly. Returns {exists, count, parts}.

Inputs: tag (required), timeout_ms.

kos_docs_cheatsheetA

Compact card: name + one-line summary + first example.

Inputs: topic (required).

kos_docs_get_functionA

Return a global function definition (eg ABS, ROUND).

Inputs: name (required).

kos_docs_get_keywordB

Return a kerboscript keyword/command definition (eg RUN, LOCK, WAIT).

Inputs: name (required).

kos_docs_get_methodB

Return a method definition. Provide parent to disambiguate (Vessel:STAGEDELTAV).

Inputs: name (required), parent.

kos_docs_get_structureA

Return a full structure with its attributes, methods, and inherited siblings.

Inputs: name (required).

kos_docs_get_topicA

Return the full markdown of a topic (file-level entry) given its slug, eg general/telnet.

Inputs: slug (required).

kos_docs_index_statusA

Inspect the docs index: whether it's loaded, build_time, model, entry counts.

Inputs: no named parameters.

kos_docs_list_examplesA

List code-block examples. Filter by topic slug or owning structure name.

Inputs: limit, topic, structure.

kos_docs_rebuild_indexA

Trigger a fresh index build in a detached child process. Returns immediately; first build downloads the MiniLM model (~30 MB), expect 1-3 minutes.

Inputs: no named parameters.

kos_docs_symbol_atA

Reverse-resolve a kerboscript symbol at the given (line, col) cursor position. Walks suffix chains like SHIP:ORBIT:APOAPSIS.

Inputs: col (required), code (required), line (required).

kos_kb_deleteA

Delete a knowledge-base topic (markdown file + index entry). Idempotent: returns removed:false when the topic was not present.

Inputs: topic (required).

kos_kb_listA

List knowledge-base entries from the index, optionally filtered by tag and capped by limit. Sorted newest-updated first.

Inputs: tag, limit.

kos_kb_readB

Read a knowledge-base topic. Returns the markdown body plus its index metadata.

Inputs: topic (required).

kos_kb_writeA

Write or update a knowledge-base topic. Stored as <archive>/kb/<topic>.md plus an index entry. Topic must match [a-zA-Z0-9_-]+, max 60 chars.

Inputs: topic (required), content (required), mode, tags, +1 more.

kos_kuniverse_active_vesselA

Return the name of the currently active vessel (KUNIVERSE:ACTIVEVESSEL:NAME).

Inputs: no named parameters.

kos_kuniverse_can_revertA

Snapshot CANREVERT, CANREVERTTOLAUNCH and CANREVERTTOEDITOR in a single round-trip. Use this before offering revert as an option to the user / planner.

Inputs: no named parameters.

kos_kuniverse_debug_logA

Append a line to the Unity Player.log via KUNIVERSE:DEBUGLOG. Pairs naturally with ksp_log_tail for cross-stack tracing - drop a marker before/after a tricky operation and grep the log for it.

Inputs: message (required).

kos_kuniverse_force_set_active_vesselA

Switch the active vessel even when KSP would normally refuse (e.g. atmospheric flight, under acceleration). NOTE: KSP may treat the previous vessel as if it were re-entering the atmosphere, which can delete it. Prefer the safer non-force vessel switch via SET KUNIVERSE:ACTIVEVESSEL TO ... when conditions allow.

Inputs: vessel_name (required).

kos_kuniverse_pauseA

Call KUNIVERSE:PAUSE() to bring up the in-game escape menu. ⚠ DESTRUCTIVE TO AGENT FLOW: kOS execution halts entirely while paused; the agent CANNOT issue further commands until a human clicks 'Resume' (Ctrl-C through kos_session_interrupt also works). Use sparingly.

Inputs: no named parameters.

kos_kuniverse_quickloadA

Trigger KSP's quickload (revert to a prior quicksave). With name, uses QUICKLOADFROM. WARNING: a successful load tears down the current scene; expect the telnet session to drop and the agent to need to reconnect / re-attach.

Inputs: name, timeout_ms.

kos_kuniverse_quicksaveA

Trigger KSP's quicksave. With name, calls QUICKSAVETO; otherwise QUICKSAVE. Refuses to act when KUNIVERSE:CANQUICKSAVE is false (e.g. quicksaves disabled in difficulty options, or the active scene does not support saving).

Inputs: name, timeout_ms.

kos_kuniverse_quicksave_listA

Enumerate all quicksave files in the current game (KUNIVERSE:QUICKSAVELIST). Uses a delimited FOR loop instead of LIST:TOSTRING so parsing is robust across kOS versions.

Inputs: no named parameters.

kos_kuniverse_revert_to_editorA

Revert to the editor (VAB or SPH per the vessel's origin) via KUNIVERSE:REVERTTOEDITOR. Refuses when KUNIVERSE:CANREVERTTOEDITOR is false (typically true after loading a saved game).

Inputs: no named parameters.

kos_kuniverse_revert_to_launchA

Revert the active vessel to the launch pad / runway via KUNIVERSE:REVERTTOLAUNCH. Refuses when KUNIVERSE:CANREVERTTOLAUNCH is false (e.g. the revert window has expired or the vessel was loaded from a save). Like quickload, expect the telnet session to drop on success.

Inputs: no named parameters.

kos_maneuver_addA

Add a maneuver node via ADD NODE(time, radial, normal, prograde). Provide either eta (seconds from now) or time (UT seconds).

Inputs: eta, time, normal, radial, +2 more.

kos_maneuver_clearA

Remove every node from the flight plan with a portable UNTIL NOT HASNODE { REMOVE NEXTNODE. } loop.

Inputs: timeout_ms.

kos_maneuver_executeA

Upload the standard execute-node template (0:/inspect/execute_node.ks) and RUN it detached. Poll completion via kos_session_wait_for "BURN_COMPLETE:". The agent retains control of the session while the burn runs.

Inputs: index, timeout_ms, throttle_curve.

kos_maneuver_listB

List every node on the active vessel's flight plan (in chronological order).

Inputs: timeout_ms.

kos_maneuver_removeA

Remove one node by index (0-based). Omitting index removes NEXTNODE.

Inputs: index, timeout_ms.

kos_program_compileB

Run COMPILE [TO ]. Returns the resolved destination path.

Inputs: src (required), dst, timeout_ms.

kos_program_delete_fileB

Delete a file or directory via DELETEPATH(...).

Inputs: path (required).

kos_program_disk_statusA

Print capacity and free space for every visible volume.

Inputs: no named parameters.

kos_program_evalB

Evaluate a single kerboscript expression with PRINT (...) and return the printed value.

Inputs: expression (required), timeout_ms.

kos_program_list_filesC

Run LIST FILES IN <vol>. and return the parsed table.

Inputs: volume.

kos_program_power_statusA

Print the MODE of every kOSProcessor on the active vessel.

Inputs: no named parameters.

kos_program_read_fileA

Read a kerboscript file. For paths on the archive volume we read directly from disk; for local kOS disks we route through telnet.

Inputs: path (required).

kos_program_runB

RUNPATH a saved script. detached=true returns immediately; otherwise we wait for the prompt.

Inputs: path (required), args, detached, timeout_ms.

kos_program_terminateB

Send Ctrl-C to break the currently running script.

Inputs: no named parameters.

kos_program_write_fileB

Upload a kerboscript file to a kOS volume. Picks fs vs telnet automatically.

Inputs: code (required), path (required), mode, compile, +1 more.

kos_recorder_clearB

Reset the data CSV by writing {clear:true} into cmd.json. The boot loop deletes data.csv, recreates it with the header, and acks by overwriting cmd.json with {state:'running'}.

Inputs: session_id (required).

kos_recorder_dumpB

Return the full recorder data set in csv / json / ndjson form.

Inputs: session_id (required), since, format.

kos_recorder_install_and_startA

Generate a recorder boot script for the given channels, deploy it onto a recorder kOSProcessor, activate it, and wait until the recorder writes its READY status.

Inputs: channels (required), session_id, on_existing, schedule_hz, +3 more.

kos_recorder_list_sessionsA

List every recorder session known to this MCP instance (in-memory plus archive index).

Inputs: no named parameters.

kos_recorder_statusA

Inspect the live status of a recorder session: state (starting/running/stopped/error), frame count, latest_t, data_bytes.

Inputs: session_id (required).

kos_recorder_stopA

Mark the recorder for graceful shutdown by writing {stop:true} into cmd.json. The boot loop polls cmd.json once per second.

Inputs: session_id (required).

kos_recorder_tailA

Read recorder rows newer than since_t. Reads the CSV directly from the archive disk (does not occupy telnet).

Inputs: session_id (required), limit, since_t.

kos_recorder_uninstallA

Stop the recorder, clear BOOTFILENAME on the recorder CPU, delete the archive directory, and forget the session.

Inputs: session_id (required), recorder_cpu_tag.

kos_repl_executeA

Send statements directly to the active CPU's interpreter. Unlike kos_program_eval, GLOBAL state survives between calls. Multi-line input is split on \n and each line is sent + flushed individually via the completion sentinel; multi-line BLOCK statements (e.g. an open IF { ... } spanning physical lines) are NOT supported.

Inputs: stmt (required), timeout_ms.

kos_repl_get_globalsA

List the variable names this MCP instance has touched via kos_repl_set. kOS exposes no introspection over the GLOBAL scope, so this is a hint set, NOT the authoritative list of every GLOBAL on the CPU.

Inputs: no named parameters.

kos_repl_printA

PRINT a single name and return the displayed value. Equivalent to kos_program_eval(name) but limited to a bare identifier.

Inputs: name (required), timeout_ms.

kos_repl_resetA

Issue REBOOT. on the active CPU. WARNING: this restarts the kOS interpreter, killing every LOCK, GLOBAL, WHEN/ON trigger and the running program. Watch and bg registries on the MCP side are NOT cleared automatically; the dormant entries become orphans pointing at no-longer-existent kOS state. (Spec calls this RESET.; kOS uses REBOOT..)

Inputs: timeout_ms.

kos_repl_setA

Send SET <name> TO (<expr>). and remember name so kos_repl_get_globals can list it.

Inputs: expr (required), name (required).

kos_scaffold_generateA

Render a bundled mission template into a kerboscript snippet. Defaults from the template's schema fill in any params you omit.

Inputs: template (required), params.

kos_scaffold_templatesA

List the bundled mission templates with their descriptions, parameter schemas, and operational notes.

Inputs: no named parameters.

kos_session_clear_historyA

Drop everything currently in the in-memory rolling history buffer.

Inputs: no named parameters.

kos_session_connectA

Attach to a CPU by 1-based menu index, then wait for the kOS attach banner (kOS 1.5+ never emits a kOS> prompt; success is signalled by the boot banner ending in Proceed.).

Inputs: index (required).

kos_session_detachA

Send Ctrl-D to leave the current CPU and return to the welcome menu.

Inputs: no named parameters.

kos_session_interruptA

Send Ctrl-C (telnet IP) to break the running kOS program. Same as send_keys with CTRL_C.

Inputs: no named parameters.

kos_session_list_cpusA

List the CPUs visible from the kOS welcome menu. Triggers a redraw on the first call so the menu is always fresh.

Inputs: refresh.

kos_session_read_historyA

Return entries from the rolling history buffer, optionally filtered by timestamp / regex / size.

Inputs: grep, limit, since_ts.

kos_session_read_screenA

Return the current 80x24 (or configured) terminal frame plus cursor coords.

Inputs: no named parameters.

kos_session_send_inputA

Send literal text to the active CPU (or the menu). Optionally append ENTER. Does NOT wait for a prompt.

Inputs: text (required), with_enter.

kos_session_send_keysA

Send one or more named special keys, in order. Useful for Ctrl-C / arrows / Home / End / etc.

Inputs: keys (required).

kos_session_sync_stateA

Look at the current screen and reconcile session.mode (menu vs attached) with what kOS is actually showing. Use this if connect() returned attach_timeout but you suspect attach actually succeeded - or after a manual Ctrl-D / detach you want to re-detect. Returns the corrected state.

Inputs: no named parameters.

kos_session_wait_forB

Block until a regex matches the screen text, or a timeout elapses.

Inputs: pattern (required), timeout_ms, capture_groups.

kos_snapshot_allA

Convenience wrapper that runs every snapshot.* tool sequentially and returns one merged object. Warning: this returns a relatively large payload; prefer the individual snapshots when you only need part of the picture.

Inputs: timeout_ms.

kos_snapshot_attitudeC

Pitch / yaw / roll from SHIP:FACING, the up-vector, angle-of-attack, vertical/ground/airspeed, and current TWR.

Inputs: timeout_ms.

kos_snapshot_bodyA

Body summary (radius, MU, atmosphere height, rotation period). When name is omitted, returns the SOI body.

Inputs: name, timeout_ms.

kos_snapshot_fuelA

Per-resource snapshot for LIQUIDFUEL, OXIDIZER, MONOPROPELLANT, ELECTRICCHARGE, SOLIDFUEL, XENONGAS. Returns ship-wide and current-stage amounts.

Inputs: timeout_ms.

kos_snapshot_orbitB

Single-prompt snapshot of orbit: APOAPSIS, PERIAPSIS, SEMIMAJORAXIS, INCLINATION, ECCENTRICITY, PERIOD, BODY:NAME, ETA:APOAPSIS, ETA:PERIAPSIS.

Inputs: timeout_ms.

kos_snapshot_surfaceC

Altitude, radar altitude, latitude, longitude, vertical/ground speed, and an approximate terrain slope.

Inputs: timeout_ms.

kos_snapshot_targetB

Target state. Returns present:false when nothing is targeted; otherwise distance, relative velocity, and ETA-to-closest-approach (negative if moving away).

Inputs: timeout_ms.

kos_snapshot_thermalA

List the hottest parts (by current temperature / max temperature ratio). Defaults to the top 5.

Inputs: top_n, timeout_ms.

kos_snapshot_throttleC

Throttle, steering string, wheel-steering, RCS, SAS, gear, brakes, lights.

Inputs: timeout_ms.

kos_timewarp_cancelA

Cancel any active warp - both WARPTO and manual rate changes (KUNIVERSE:TIMEWARP:CANCELWARP).

Inputs: no named parameters.

kos_timewarp_modeA

Set TIMEWARP:MODE to PHYSICS or RAILS. PHYSICS warp keeps the simulation running and is required during atmospheric flight or under thrust; RAILS warp is the fast on-rails warp used between burns.

Inputs: mode (required).

kos_timewarp_setA

Set time warp by target rate. Reads RATELIST for the current MODE, picks the closest legal entry, and SETs WARP to its index. Returns both the requested rate and the actually applied rate so the agent can compensate for snap-to-list quantisation.

Inputs: rate (required).

kos_timewarp_set_indexA

Set the WARP integer index directly (0,1,2,...). Use this when you already know the index you want; the corresponding multiplier depends on MODE and RATELIST.

Inputs: index (required).

kos_timewarp_statusA

Snapshot of TIMEWARP state in one round-trip: rate (current effective multiplier), warp_index, mode, is_settled (true once the live rate has caught up with the commanded one), and current_time (TIME:SECONDS).

Inputs: no named parameters.

kos_timewarp_wait_until_settledA

Poll KUNIVERSE:TIMEWARP:ISSETTLED until true or the timeout elapses. Use after kos_timewarp_set / set_index / warp_to so subsequent reads reflect the final rate rather than the in-progress ramp.

Inputs: poll_ms, timeout_ms.

kos_timewarp_warp_toB

WARPTO a universal timestamp. Pass an absolute UT in seconds (compute from TIME:SECONDS via kos_timewarp_status if you only have a delta). Optionally switches MODE first.

Inputs: time_seconds (required), mode.

kos_watch_addA

Register a periodic kerboscript expression. The MCP injects a WHEN ... THEN { PRINT ... PRESERVE. } trigger that prints [W:<id>:<label>] <value> every 1/hz seconds. The expression is NOT sandboxed - the agent is responsible for not breaking the host script.

Inputs: expr (required), hz, label.

kos_watch_clearA

Mute every registered watch. Same kerboscript caveat as kos_watch_remove. Returns ok=true even when a per-watch mute failed; check failures for the ids.

Inputs: no named parameters.

kos_watch_listA

List every watch known to this MCP instance.

Inputs: no named parameters.

kos_watch_readA

Pull tagged watch lines out of the rolling telnet history. ts_ms is the time the line arrived over telnet, NOT the in-game time.

Inputs: limit, since_ts, watch_id.

kos_watch_removeA

Mute a watch by setting its _W_<id>_RUN flag to FALSE. The trigger itself remains parked on the kOS CPU until the program ends - kerboscript has no syntax to retire a PRESERVE'd trigger early. See known_issues.

Inputs: watch_id (required).

ksp_log_clear_markerA

Set an in-memory marker at the current Player.log byte offset. Subsequent calls to ksp_log_since_marker only return text written after this point.

Inputs: override_path.

ksp_log_grepA

Grep Player.log for a regex pattern. Reads up to max_kb of the tail (default 1024 KB) to avoid memory blow-up; truncated becomes true when the cap is hit.

Inputs: pattern (required), max_kb, max_matches, override_path.

ksp_log_marker_statusA

Inspect the in-memory marker (byte offset, set timestamp). Useful for debugging when log_since_marker returns less than expected.

Inputs: no named parameters.

ksp_log_pathA

Return the platform-specific Player.log path used by KSP (Unity). Includes existence + size info so the agent can decide whether it's worth tailing.

Inputs: override_path.

ksp_log_since_markerA

Return everything written to Player.log since the last ksp_log_clear_marker call. If no marker has been set yet, behaves as if the marker were placed at the current EOF.

Inputs: max_kb, override_path.

ksp_log_tailB

Read the tail of Player.log (default: last 64 KB, last 100 lines). Optional filter by level / source regex / message regex.

Inputs: kb, filter, n_lines, override_path.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 110 tools

    Disambiguation2/5

    Many tools are cleanly separated by domain prefix, but there are genuine overlaps: kos_craft_staging and kos_craft_delta_v_budget both return per-stage delta-V, kos_program_eval/kos_repl_print/kos_repl_execute cover similar evaluation ground, and kos_session_interrupt duplicates send_keys with CTRL_C. On a 110-tool surface this creates real misselection risk despite mostly helpful descriptions.

    Naming Consistency4/5

    Names follow a consistent kos_<domain>_<action> snake_case convention and most actions are predictably verb-first (list/delete/run/connect). Minor deviations include noun-style getters such as kos_craft_staging, kos_snapshot_orbit, and kos_kb_read, but the overall pattern is readable and navigable.

    Tool Count1/5

    110 tools is an extreme count for a single MCP server, far beyond the 50+ threshold. The server bundles several separable concerns like vessel control, program/files, recorder, timewarp, docs, knowledge base, and logs, which makes tool selection costly and the surface unnecessarily heavy.

    Completeness3/5

    The surface is very broad and covers file/program lifecycle, session management, timewarp, maneuvers, recorder, docs, KB, and logs. However, it is read-heavy for actual flight control: there is no direct stage, throttle, SAS/RCS, or steering setter, which is a notable gap even though arbitrary kOS can be executed through the REPL tools.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers