Skip to content

Printer Control Tools ​

Every printer tool accepts host, port, type, and api_key, and Bambu printers also use bambu_serial and bambu_token. Omitted values fall back to PRINTER_HOST, PRINTER_PORT, PRINTER_TYPE, API_KEY, BAMBU_SERIAL, and BAMBU_TOKEN. Keep keys in the server configuration rather than passing them in calls.

What each call does depends on the backend; see printer backend setup for the exact API routes.

Every print start and positive heating command, on every backend, goes through a safety gate: the server inspects the exact G-code it will start, checks each heater target against hardware and material ceilings, checks that the printer is ready, and asks a human to confirm through MCP elicitation. Turning a heater off (temperature: 0) and cancel_print are never gated.

get_printer_status ​

Read the printer's current status. The response is the backend's own status data: Bambu returns temperatures, job state, progress, layers, time remaining, and AMS data; OctoPrint returns printer state and temperatures; Klipper returns the Moonraker host state only.

json
{
  "type": "klipper",
  "host": "192.168.1.50",
  "port": "7125"
}

list_printer_files ​

List the files stored on the printer or its host software. On Bambu printers it lists the cache/, timelapse/, and logs/ directories.

json
{
  "type": "octoprint",
  "host": "192.168.1.100"
}

upload_gcode ​

Upload G-code to the printer, and optionally start it. Pass gcode_path for a local file, or gcode with the content (or a local path). filename defaults to the basename of gcode_path; when printing, use a plain filename so the started file is exactly the uploaded one.

json
{
  "type": "klipper",
  "host": "192.168.1.50",
  "port": "7125",
  "gcode_path": "/path/to/benchy.gcode",
  "print": true,
  "material": "PETG"
}
  • Without print, the file is only uploaded and nothing is inspected or started.
  • With print: true, the exact uploaded bytes are inspected first (every S and R heater target, tool changes, and hardware and material ceilings), the printer's state is checked, and a human confirms before the job starts.
  • Printing needs a declared material: slicer metadata in the file (; filament_type = PLA) or the material argument, which must not contradict the file.
  • On Bambu printers, files go to cache/ over FTPS, and printing also needs the model (bambu_model or BAMBU_MODEL). Automatic printing after upload supports .gcode only; print .3mf projects with print_3mf.

start_print ​

Start a G-code file that is already stored on the printer. The server downloads that exact file, inspects it, checks the printer's state, asks a human to confirm, and then starts a uniquely named checked copy. This works on Bambu Lab, OctoPrint, Klipper (Moonraker), and Duet. Repetier, Prusa, and Creality refuse, because their adapters have no verified download route; use upload_gcode with print: true instead.

json
{
  "type": "octoprint",
  "host": "192.168.1.100",
  "filename": "benchy.gcode",
  "material": "PLA"
}

Pass material when the file has no filament_type metadata. On Bambu printers it also needs the model and supports .gcode files only; bare filenames are looked up in cache/.

cancel_print ​

Cancel the current print job. Cancelling is never gated and also cancels checked prints still waiting to start. There is no pause or resume tool; cancelling is not resumable.

json
{
  "type": "prusa",
  "host": "192.168.1.120"
}

set_printer_temperature ​

Set a target temperature for a printer component. Use bed or extruder; Bambu also accepts nozzle, tool, and tool0. OctoPrint nozzle targets are sent to tool0.

json
{
  "type": "klipper",
  "host": "192.168.1.50",
  "port": "7125",
  "component": "extruder",
  "temperature": 215,
  "material": "PLA"
}
  • temperature must be a finite number of 0 or more. 0 switches the heater off and is never gated.
  • Positive targets are checked before connecting against independent hardware ceilings and the material's ceiling, need a ready printer, and ask a human to confirm.
  • Positive nozzle heating needs material (for example PLA, PETG, or ABS), including for spools without RFID.
  • On Bambu printers, positive heating also needs bambu_model (or BAMBU_MODEL), and nozzle heating uses nozzle_diameter (0.2, 0.4, 0.6, or 0.8; default NOZZLE_DIAMETER or 0.4). Both are checked against the live printer.

Released under the GPL-2.0 license. An independent open-source project, not affiliated with any printer manufacturer or host software.