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 and Windows. 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.stland 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.stlwon'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.
On Windows the same commands work. Install uv first (winget install --id=astral-sh.uv), and note:
- Write paths with forward slashes (
C:/Users/you/prusaslicer-output) or doubled backslashes in JSON. - The server looks for PrusaSlicer in
Program Files(Prusa3D\PrusaSlicer) and in yourAppData\Local\Programsfolder, and usesprusa-slicer-console.exe: the other program,prusa-slicer.exe, is the GUI build and writes nothing a tool can read. If you give it the GUI one and the console one sits beside it, the console one is used. For a portable unzip anywhere else, setPRUSASLICER_PATH. - Claude Desktop keeps its configuration in
%APPDATA%\Claude\claude_desktop_config.json. - CI runs the unit and integration tests on Windows against the portable PrusaSlicer 2.9.7 zip. The Windows installer's own folders are searched but have not been tried on a real installation, so if PrusaSlicer is not found, set
PRUSASLICER_PATHand please open an issue.
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_modelandpreview_modelhave 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);scaleis a factor (0.5 is half, not 50%);copiesis the total number of objects. Plates built from several files are not supported, because--mergecrashes 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_modelshows that at a glance andpreview_gcode(viewprofile) 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_modelreports it andslice_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, assuggest_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 atpreview_modelfirst: a cup scanned open at the top would be closed too.slice_modelreturns PrusaSlicer's own warnings in full and adds a warning when layers skip a large stretch of the height, so readwarningsbefore 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_modeltherefore centres a plain 3MF on the bed by default (centeromitted) and reportscentered; passcenter=falseto keep its stored position, orcenter=trueto 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_fitand, 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'soutput_pathmay 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%"}(seePrusaSlicer --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
- Roadmap: what's planned
- Architecture: how the server works
- Decision records: why it works that way (MADR)
CLAUDE.mdand.claude/rules/: conventions for Claude Code sessions in this repo
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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prusaslicer_mcp-0.3.2.tar.gz | 40.9 kB | Without provenance | Details for prusaslicer_mcp-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prusaslicer_mcp-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for prusaslicer_mcp-0.3.2-py3-none-any.whl |
Total release size: 85.7 kB
Release files / prusaslicer_mcp-0.3.2.tar.gz
| Download URL | prusaslicer_mcp-0.3.2.tar.gz |
|---|---|
| Size | 40.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e8d54cf43949679866073d2aec8a0945d1dd247f7492e5ebe0faf4fe048b4ba
|
|
BLAKE2b-256 checksum How to use checksums |
3d364d8d9ff796679ad417f09184c95c7ab061db8e3cd584132b1b575e640c78
|
| 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.2-py3-none-any.whl
| Download URL | prusaslicer_mcp-0.3.2-py3-none-any.whl |
|---|---|
| Size | 44.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e96c7239575c0ead9734485f338f752fb60aa68f08da64cb4f930a82f17d975
|
|
BLAKE2b-256 checksum How to use checksums |
762573c14726ecf1841c4ca795def5278902ff2143960b0734e2021170fbdd35
|
| 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.2
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.