Skip to main content

prusaslicer-mcp

An MCP server that lets Claude (or any MCP client) drive the PrusaSlicer 2.9.x command line: discover installed printers and profiles, sanity-check and look at a model, work out which way up to print it, slice it headlessly with your real presets, and get print time and filament use back.

It runs PrusaSlicer as a separate process, so it works while the GUI is open and does not touch it. It does not control the GUI itself (PrusaSlicer 2.9.x has no remote-control API), and it targets 2.9.x only; PrusaSlicer 3.x is not supported yet.

Status: early. Seven tools, tested against PrusaSlicer 2.9.7 on macOS. See the roadmap.

An independent project. It is not affiliated with, endorsed by or supported by Prusa Research. PrusaSlicer and Prusa are trademarks of Prusa Research a.s.

Example

Once registered with an MCP client, you can ask things like:

"Which printers do I have installed? Check ~/models/bracket.stl and slice it on the MINI with Prusament PLA at 0.20mm, 25% infill. How long will it take and how much filament does it use?"

Behind that, the client calls list_printers → list_profiles → inspect_model → slice_model and reads back the print time and filament use. preview_model and preview_gcode let it look at the model and at what was sliced, and suggest_orientation proposes which way up to print.

A scan that will not slice is a different conversation:

"~/scans/statue.stl won't slice. What's wrong with it, and which way up should I print it?"

Behind that: inspect_model reports an open base, suggest_orientation with close_holes finds the orientation that stands the capped base flat on the bed (and, given your profiles, measures what the supports would cost in each), preview_model shows it before anything is sliced, and slice_model prints it.

Tools

Tool What it does
list_printers Installed printer models, exact printer profile names, nozzle variants, bed sizes
list_profiles Print (quality) profiles and compatible filament profiles for a printer profile
inspect_model Size, volume, watertightness, open holes (and how many are flat gaps close_holes can cap), part count; optional build-volume fit check (via trimesh), a warning when a 3MF's stored position is off the bed, and, for a 3MF saved from PrusaSlicer, the profiles and key settings (infill, brim, supports) stored in it
slice_model Slice with printer_profile / print_profile / material_profile (all three, or none for a PrusaSlicer project, which then keeps its own saved settings), optional setting overrides, center (plain 3MF files are centred automatically), transforms (rotate_x/y/z, scale, scale_to_fit, split, copies), and close_holes to cap a flat hole such as a scan's missing base; returns G-code path, time, filament, cost, layers, whether the project's or the profiles' settings were used, whether the model was centred, and how many holes were closed
suggest_orientation Ranks the ways to stand a model: its large flat faces, the axes and the orientation as stored, each with the rotate_x/rotate_y to reach it, its height, how much of it lies on the bed, how much overhang would need support, and whether it rests on a real base. close_holes lets a scan's missing base count. Geometry only (near-equal overhang is a tie), unless you also give the three profiles: then each option, at most six, is sliced with supports on and reports its real support filament, filament and print time (slow, one slice each)
preview_model A PNG of a model from iso, front, side or top, or all four on one sheet, with its size and which way is up; shows a Y-up scan lying on its side at a glance. Takes the same rotate_*, scale and scale_to_fit as slice_model, and close_holes, and draws the model as PrusaSlicer will transform it, so an orientation can be checked before slicing. A pale grid is the bed, level with the model's lowest point, so it is plain which face rests on it
preview_gcode A PNG of sliced G-code: one layer's toolpaths coloured by feature, or front and side silhouettes of everything printed, where an empty stretch shows as a blank band

Profile names must match exactly; use list_printers and list_profiles to discover them.

Projects. A 3MF saved from PrusaSlicer carries its own settings (supports, brim, infill...). Slice it with no profiles to keep them; passing profiles makes PrusaSlicer ignore them and use the plain profile values (ADR 0007). inspect_model shows what a project saves. G-code is always written as text (--binary-gcode=0) so statistics can be read back.

Install

Requires Python 3.12+ and PrusaSlicer 2.9.x. The easiest way is uv, which runs the server without a separate install step:

uvx prusaslicer-mcp

or install it with pip install prusaslicer-mcp (or pipx install prusaslicer-mcp) and run prusaslicer-mcp. The server talks MCP over stdio, so you normally do not run it yourself: you register it with a client, below.

Configuration

Variable Purpose Default
PRUSASLICER_PATH PrusaSlicer executable auto-detected (PATH, /Applications/**/PrusaSlicer.app, ...)
PRUSASLICER_DATADIR Profile/config directory platform default
PRUSASLICER_MCP_OUTPUT_DIR Where G-code goes when no output path is given; created in full if missing ./output
PRUSASLICER_MCP_TIMEOUT Slice timeout (seconds, must be positive) 600

Register with an MCP client

Claude Code:

claude mcp add prusaslicer \
  -e PRUSASLICER_MCP_OUTPUT_DIR="$HOME/prusaslicer-output" \
  -- uvx prusaslicer-mcp

Claude Desktop and other clients take the same command in their configuration file:

{
  "mcpServers": {
    "prusaslicer": {
      "command": "uvx",
      "args": ["prusaslicer-mcp"],
      "env": { "PRUSASLICER_MCP_OUTPUT_DIR": "/Users/you/prusaslicer-output" }
    }
  }
}

Set PRUSASLICER_MCP_OUTPUT_DIR: the default, ./output, is relative to wherever the client starts the server, which is rarely a folder you want G-code in. PRUSASLICER_PATH is only needed when auto-detection fails (a nonstandard install folder; quote paths containing spaces). claude mcp list should show prusaslicer.

These are ordinary environment variables, so give them through the client's env setting, as above. The .env file in a clone is only a convenience for development.

Notes

  • STEP files (.step, .stp) work in every tool: inspect_model and preview_model have PrusaSlicer convert them to a temporary mesh, so their triangle count and watertightness describe PrusaSlicer's tessellation (ADR 0016).

  • Transforms use PrusaSlicer's own flags: rotations apply in the fixed order X, then Y, then Z (with one oddity, exactly +-90 about Y together with a Z rotation, so check with preview_model(rotate_*), which asks PrusaSlicer itself: ADR 0015); scale is a factor (0.5 is half, not 50%); copies is the total number of objects. Plates built from several files are not supported, because --merge crashes PrusaSlicer 2.9.7 (ADR 0012).

  • A slice that succeeds is not always printable. A scan exported Y-up slices without an error and with plausible statistics, but it lies on its side, so parts of its height print nothing. preview_model shows that at a glance and preview_gcode (view profile) shows the empty stretches. A scan can also have a real hole, such as a missing base, which PrusaSlicer refuses (no extrusions in the first layer); inspect_model reports it and slice_model(close_holes=true) caps it in a temporary copy, leaving the file alone (ADR 0014), with a flat base even where the scan's rim is ragged (ADR 0017). A scan's base is rarely square to its axis (the statue's is 16 degrees off), so stand it on the capped base rather than on an axis, as suggest_orientation(close_holes=true) does: a tilted base touches the bed along one edge (ADR 0018). Only simple, nearly flat holes are capped, so look at preview_model first: a cup scanned open at the top would be closed too. slice_model returns PrusaSlicer's own warnings in full and adds a warning when layers skip a large stretch of the height, so read warnings before trusting the numbers.

  • Plain 3MF files (exported from CAD, not saved from PrusaSlicer) keep their stored coordinates, so a part modelled around the origin sits half off the bed. slice_model therefore centres a plain 3MF on the bed by default (center omitted) and reports centered; pass center=false to keep its stored position, or center=true to centre a project, STL or OBJ. STL and OBJ files are placed by PrusaSlicer, and projects keep their own layout (ADR 0013).

  • When PrusaSlicer refuses a slice, the error keeps its own message and adds advice where we know the remedy: a model larger than the bed (with its size, the bed's size, scale_to_fit and, if it fits across the diagonal, rotate_z=45), an empty first layer (preview_model, rotate_x/rotate_y, repair), and the wipe-tower conflict (an override).

  • --query-* actions exit with status 1 on success in 2.9.7; the server judges them by their output file.

  • slice_model's output_path may create its last folder only; if the folder above it does not exist the call is refused, because that is almost always a typo.

  • Setting overrides use PrusaSlicer config option names, e.g. {"fill_density": "25%"} (see PrusaSlicer --help-fff). Options the server sets itself (profiles, output, binary_gcode, datadir, save) are rejected.

Limitations

  • No live GUI control: each call runs a separate PrusaSlicer process and cannot see what is open in the GUI.
  • Output is always text G-code, even where the profile prefers binary (.bgcode).
  • FFF (filament) slicing only; single material; no transform options yet. See the roadmap.

Development

Work from a clone (see CONTRIBUTING.md):

git clone https://github.com/sebastienc/prusaslicer-mcp && cd prusaslicer-mcp
uv sync
cp .env.example .env     # then edit; machine-specific, git-ignored
direnv allow             # optional: loads .env into your shell
claude mcp add --scope project prusaslicer -- uv run prusaslicer-mcp   # run the checkout, not the PyPI release

The repository ships a .mcp.json that registers the checkout for Claude Code (it contains no paths; uv run resolves the project from the working directory). In VS Code, open prusaslicer-mcp.code-workspace.

Everything runs through uv; Poe the Poet chains the checks (uv has no task runner).

uv sync                      # install
uv run poe check             # lint, format check, type check, unit tests (what CI runs, minus integration)
uv run poe fix               # apply safe lint fixes, then format
uv run poe test-integration  # tests that need a real PrusaSlicer (skip when absent)
uv run poe                   # list every task
uv run poe dogfood run <folder>   # run every tool over a folder of real models and report (opt-in; docs/dogfooding.md)

uv format, uv check and uv audit are uv's own formatter, type checker (ty, pinned) and dependency audit. Ruff does the linting and pyright type-checks alongside ty (ADR 0010). Commits follow Conventional Commits (feat: ..., fix: ...): CI checks them with commitlint, and Release Please opens a release pull request from them. See ADR 0008 and ADR 0009.

Documentation

License

MIT. PrusaSlicer itself is AGPL-3.0 and is invoked as a separate program, not bundled or linked.

See CONTRIBUTING.md to help, and SECURITY.md to report a vulnerability.

Metadata

Release files for prusaslicer-mcp 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prusaslicer-mcp 0.3.1
File Size Uploaded Provenance Actions
prusaslicer_mcp-0.3.1.tar.gz 40.0 kB Without provenance Details for prusaslicer_mcp-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for prusaslicer-mcp 0.3.1
File Interpreter ABI Platform Actions
prusaslicer_mcp-0.3.1-py3-none-any.whl Python 3 none any Details for prusaslicer_mcp-0.3.1-py3-none-any.whl

Total release size: 84.0 kB

Release files / prusaslicer_mcp-0.3.1.tar.gz

Download URL prusaslicer_mcp-0.3.1.tar.gz
Size 40.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4a9c998d9a833a1c2a5e185cdf5004885f5c61b5aa6a6617da4cb1361d7a238c
BLAKE2b-256 checksum
How to use checksums
c2ce86ca97ca5a04cc7d18cfb054aacf3e97ba7d3b864823772478b5bff065ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / prusaslicer_mcp-0.3.1-py3-none-any.whl

Download URL prusaslicer_mcp-0.3.1-py3-none-any.whl
Size 44.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee677b1547a4d979443ca4fc65eb7ee6641d7ee63f428019039e0c31298b0901
BLAKE2b-256 checksum
How to use checksums
70bd524209d97f36b7a0b02bb650a6bd52267d44320126e4b71bbed5d3562b60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for prusaslicer-mcp 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page