Skip to main content
Glama
Topsail

Topsail

by AidanZealley

Topsail

An MCP server for Klipper 3D printers through Moonraker. One server controls several printers and keeps their state live over Moonraker's websocket. Your MCP client decides which actions need your approval.

Set up Topsail

Install Node.js 24 or newer on the machine running your agent. The same machine needs to be able to reach Moonraker on your printer.

Register Topsail with your client:

Codex

codex mcp add topsail -- npx -y topsail

Claude Code

claude mcp add --transport stdio --scope user topsail -- npx -y topsail

Another local MCP client

Choose stdio and enter npx as the command, with -y and topsail as two arguments.

Open a session and ask the agent to add your printer. Give it a short ID and your printer's IP address or hostname. Topsail tries port 7125. For a custom setup, give the full Moonraker URL. If your client supports MCP forms, Topsail can ask for missing details in a form. Otherwise, the agent asks in chat.

Your client starts Topsail when it connects. The printer list starts empty and is saved at ~/.config/topsail/printers.sqlite. Sessions running under the same user account on the same machine share the list. Ask your agent to list your printers to see their saved Moonraker URLs and status.

Moonraker must allow requests from the machine running Topsail without credentials. If you used a previous version with a TOML file or MOONRAKER_URL, add those printers again through chat.

Related MCP server: Klipper MCP Server

Tools

Tool

Marked destructive

list_printers, printer_status, list_files, list_macros, webcam_snapshot

no, read only

add_printer, upload_gcode

no

pause_print, turn_off_heaters, emergency_stop

no, so nothing delays them

start_print, resume_print, cancel_print

yes

set_temperature, run_macro, restart_klipper

yes

remove_printer

yes. It doesn't stop an active print.

Tools that act on a printer take its ID in printer. You can omit it when only one printer is configured, except in remove_printer.

Approval

Topsail never asks before an action. It marks each tool with MCP annotations, and your client decides what needs your approval. A client that runs everything without asking can start a print or heat a printer unattended. Check its settings before you connect a printer.

list_macros shows macros loaded by Klipper, with their descriptions and any parameters Topsail can identify. run_macro accepts a public macro name and optional params with uppercase keys and numeric or single-token string values. Klipper controls what the macro does, so only approve macros you trust.

Print a file

upload_gcode takes the absolute path of a .gcode file on the machine running Topsail and stores it on the printer under a unique name. Pass the returned filename to start_print.

upload_gcode and list_files return what the slicer recorded about a file: material, temperatures, height and time. Those come from the file, so they help catch mistakes, not attacks.

Topsail doesn't check what the G-code does. Klipper enforces its configured temperature and travel limits, but a print runs whatever is in the file, so only print files you trust. Topsail can upload any .gcode file its user can read.

Develop

npm install
npm test         # end-to-end against a fake Moonraker, on both protocol eras
npm run dev

Release

Push a tag such as v0.2.0. The Publish workflow tests it, publishes that version to npm and makes a GitHub release. A prerelease tag, such as v0.2.0-rc.1, goes to npm's next.

Available Tools

17 tools
add_printerA

Set up a Klipper printer when the user asks to add one. Supply details the user already gave. If the tool reports missing fields, ask for those in chat and retry.

Inputs: name, address.

cancel_printA
Destructive

Cancel the current print. It can't be resumed afterwards.

Inputs: printer.

emergency_stopA

Immediately halt the printer and turn off heaters. Use when something is going wrong; Klipper needs a firmware restart afterwards.

Inputs: printer.

list_filesB
Read-only

List G-code files on the printer, newest first, with what the slicer recorded about each: material, temperatures, height and time.

Inputs: limit, search, printer.

list_macrosA
Read-only

List the printer's G-code macros with their descriptions and the parameters they read. Macros starting with _ are internal and hidden unless asked for.

Inputs: printer, include_internal.

list_printersA
Read-only

List configured printers with their saved Moonraker URLs, connection and print state. If empty, offer to help set up a printer with add_printer.

Inputs: no named parameters.

pause_printB

Pause the current print.

Inputs: printer.

printer_statusA
Read-only

Live status of one printer: print state, file, progress, temperatures, position and Klipper's message.

Inputs: printer.

remove_printerA
Destructive

Remove a saved printer from Topsail. Use list_printers to find its ID. It doesn't stop an active print.

Inputs: printer (required).

restart_klipperA
Destructive

Restart Klipper, for example after a shutdown. A firmware restart also resets the MCUs.

Inputs: printer, firmware.

resume_printB
Destructive

Resume a paused print.

Inputs: printer.

run_macroB
Destructive

Run an existing public Klipper macro. Use list_macros to find its name and parameters.

Inputs: name (required), params, printer.

set_temperatureA
Destructive

Set a heater's target temperature in °C, such as to preheat or cool down. 0 turns it off; turn_off_heaters turns them all off. Klipper refuses targets above the heater's max_temp. Doesn't wait to reach the target; check printer_status.

Inputs: heater (required), target (required), printer.

start_printA
Destructive

Start printing a G-code file from list_files or upload_gcode. First tell the user which file and printer, with its facts. Check the bed is clear with webcam_snapshot first when a webcam exists.

Inputs: filename (required), printer.

turn_off_heatersA

Turn off every heater. A print in progress will fail. It waits for the command Klipper is running, such as heating up: use emergency_stop if it can't wait.

Inputs: printer.

upload_gcodeA

Upload a sliced G-code file to a printer. Returns the filename it was stored under and what the slicer recorded: material, temperatures, height and time. This never starts a print: use start_print with that filename.

Inputs: path (required), printer.

webcam_snapshotC
Read-only

Take a picture from one of the printer's webcams.

Inputs: camera, printer.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 17 tools

    Disambiguation4/5

    Each tool maps to a distinct action on a printer, file, or heater, and descriptions explicitly disambiguate the risky pairs (upload_gcode vs start_print, set_temperature 0 vs turn_off_heaters, restart_klipper vs emergency_stop). Minor residual overlap between list_printers and printer_status (both report connection/print state) and between turn_off_heaters and emergency_stop, but the descriptions resolve it.

    Naming Consistency4/5

    Nearly all tools follow a snake_case verb_noun pattern (add_printer, list_files, pause_print, run_macro). The exceptions are noun-first names like printer_status and webcam_snapshot, which break the pattern slightly but remain readable and unambiguous.

    Tool Count4/5

    17 tools is at the upper edge but each maps to a real operation in the printer-control domain (lifecycle, files, heaters, macros, recovery). Nothing appears redundant, though the set is large enough that grouping or trimming a couple of recovery tools could help.

    Completeness4/5

    Core workflows are covered: printer CRUD, print start/pause/resume/cancel, file listing and upload, temperature control, macros, and recovery (restart, emergency stop). Gaps exist for file deletion, axis homing/jogging, and bed-leveling or object-exclusion operations, but agents can still accomplish the main remote-management tasks.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables interaction with 3D printer management systems through an MCP server, supporting STL file manipulation, slicing, and control of printers like OctoPrint, Klipper, Duet, and more.
      30
      959 npm
      272
      GPL 2.0
    • F
      license
      Not graded
      quality
      C
      maintenance
      An MCP server that enables AI assistants to control and monitor Klipper 3D printers via the Moonraker API. It supports comprehensive printer management, including G-code execution, toolchanger operations, and real-time status monitoring.
      30
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables MCP clients to monitor and control a Bambu Lab P1S printer over the local network, including status, file management, slicing, and print operations.
      11
      MIT
    • A
      license
      C
      quality
      C
      maintenance
      Enables MCP clients to monitor a Creality K2 printer via live Moonraker state, camera snapshots, and print history, while also inspecting local G-code, 3MF projects, and installed Creality Print profiles to review or create slice plans.
      15
      1
      MIT