Skip to main content
Glama
klipper-prusaslicer-mcp

klipper-prusaslicer-mcp

by rhamblen

klipper-prusaslicer-mcp

An MCP server that lets Claude (or any MCP client) slice models with PrusaSlicer using your own saved profiles and drive a Klipper printer through Moonraker: status, camera, upload, start, pause, resume, cancel, and excluding single objects.

Built for a talk-to-print pipeline: design (e.g. Fusion MCP) → slice_model → upload_gcode → start_print, with a camera-based failure detector such as Obico watching the print.

Safety model

Every tool that starts, resumes, cancels, heats or moves the printer refuses to run unless it is called with confirmed=True. The server instructions tell the assistant to pass that only after the user has explicitly approved that action in the conversation, e.g. "bed's clear, go". Read-only tools and pause_print never need it.

Hard temperature limits are set by MAX_EXTRUDER_C / MAX_BED_C.

Related MCP server: printd

Tools

Tool

What it does

Needs approval

printer_status

State, progress, ETA, temps, filament sensor, position, objects

–

camera_snapshot

JPEG from the printer camera

–

console_log

Recent Klipper console lines

–

list_printer_files / printer_file_info

G-code on the printer + slicer metadata

–

print_history

Recent jobs and outcomes

–

active_spool

Spoolman's active spool (via Moonraker)

–

list_slicer_profiles / list_models

Available profiles and models

–

slice_model

PrusaSlicer CLI with saved profiles + overrides (infill, supports, brim, scale, rotate, copies) → time, filament, objects, warnings

–

upload_gcode

Upload sliced file to the printer (does not start)

–

pause_print

Pause (parks the head)

–

start_print

Start a file on the printer

✅

resume_print / cancel_print

✅

exclude_object

Cancel one object on a multi-part plate

✅

set_temperature

Preheat (cool-down needs no approval)

✅

send_gcode

Any G-code; read-only queries (M105, M114, QUERY_*) run freely

✅

emergency_stop

M112

✅

Run with Docker (Unraid)

Image: ghcr.io/rhamblen/klipper-prusaslicer-mcp:latest (amd64 + arm64).

  1. Copy unraid/klipper-prusaslicer-mcp.xml to /boot/config/plugins/dockerMan/templates-user/ on the flash drive (or fill in the same fields by hand under Docker → Add Container).

  2. Set Moonraker URL, an MCP API key, and the two paths:

    • /config → appdata. Copy your PrusaSlicer .ini files into profiles/printer, profiles/print and profiles/filament. On Windows they are in %APPDATA%\PrusaSlicer\{printer,print,filament}.

    • /data → a share with models/ (STL/3MF in) and gcode/ (sliced out). Make it an SMB share and your CAD tool can save straight into models/.

  3. Start it and open http://<ip>:8765/health. It should report Moonraker ok and your profile counts.

Plain Docker:

docker run -d --name printer-mcp -p 8765:8765 \
  -e MOONRAKER_URL=http://192.168.1.50 -e MCP_API_KEY=change-me \
  -v /path/to/config:/config -v /path/to/3dprint:/data \
  ghcr.io/rhamblen/klipper-prusaslicer-mcp:latest

Connect Claude Code

claude mcp add --transport http printer http://<ip>:8765/mcp \
  --header "Authorization: Bearer <MCP_API_KEY>"

Run locally (stdio)

Needs Python 3.11+, uv and PrusaSlicer installed. Locally it reads profiles straight from PrusaSlicer's own config folder.

cp .env.example .env        # set MOONRAKER_URL etc.
uv sync
uv run printer-mcp --check  # health check
claude mcp add printer -- uv --directory /path/to/klipper-prusaslicer-mcp run printer-mcp

Configuration

All settings are environment variables. See .env.example for the full list. Key ones: MOONRAKER_URL, MCP_API_KEY, DEFAULT_PRINTER_PROFILE, DEFAULT_PRINT_PROFILE, DEFAULT_FILAMENT_PROFILE, PROFILE_DIR, DATA_DIR.

Notes

  • PrusaSlicer 2.9 CLI crash workaround. Profiles saved by the GUI can contain bed_temperature_extruder = 0 or wipe_tower_extruder = 0, and either one makes the 2.9.x CLI segfault. The server strips those lines from a temporary copy before slicing; your files are never changed.

  • G-code is sliced with --gcode-label-objects firmware, so Klipper's exclude_object works. That needs [exclude_object] in printer.cfg.

  • CLI slicing has no painted supports, seam painting or manual arranging. Overrides cover the common cases.

License

MIT

Tool Schema Changelog

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

Loading tool schema changelog…

    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
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP clients to submit, slice, and start 3D prints with configurable gates, preview approval, and monitoring, via a self-hosted print daemon.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Exposes MCP tools that slice models with headless OrcaSlicer, stage gcode on Moonraker-based Klipper printers, gate job starts behind explicit operator authorization, and report status, telemetry-derived events, snapshots, and alerts. It also manages spools and lets AI agents query job estimates, blockers, and start-precondition checks.
      2
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      Enables MCP clients to inspect FreeCAD documents and export named solids to STL, find and derive OrcaSlicer presets, preview and run slices with recorded manifests, and then read G-code metadata, query a Moonraker printer, upload G-code, and start an uploaded print as a separate confirmed step.
      15
      MIT