Skip to main content
Glama
PrusaSlicer MCP

PrusaSlicer MCP

by JoFaTech2508
README.md
<h1 align="center">PrusaSlicer MCP</h1>

<p align="center">Ask your AI assistant how to print a part and how long it takes, and get answers from real slices made with your own PrusaSlicer presets.</p>

<p align="center">
  <img src="https://img.shields.io/badge/platform-macOS-lightgrey?style=flat-square" alt="macOS">
  <img src="https://img.shields.io/badge/TypeScript-strict-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript">
  <img src="https://img.shields.io/badge/Node.js-22%2B-5FA04E?style=flat-square&logo=nodedotjs&logoColor=white" alt="Node.js 22 or newer">
  <img src="https://img.shields.io/badge/MCP-stdio-000000?style=flat-square&logo=modelcontextprotocol&logoColor=white" alt="MCP over stdio">
  <img src="https://img.shields.io/badge/PrusaSlicer-2.9-FA6831?style=flat-square&logo=prusa3d&logoColor=white" alt="PrusaSlicer 2.9">
  <img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="MIT license">
</p>

---

## Why PrusaSlicer MCP

Questions like "which side should go down?" or "how much longer with 4 perimeters instead of 3?" usually mean opening PrusaSlicer, changing a setting, slicing, writing the number down and changing it back. The existing PrusaSlicer MCP servers either slice in the cloud with generic profiles or only work on Windows.

This server runs locally on a Mac, uses the PrusaSlicer you already have installed and the presets you have selected, and lets the assistant slice several variants side by side. It speaks the Model Context Protocol over stdio, so it works with any MCP client. It never changes your PrusaSlicer settings and never writes next to your model.

---

## Tools

| Tool | What it does |
|---|---|
| `read_presets` | Shows the selected printer, print and filament presets |
| `check_orientation` | Ranks the six sides by bed contact and overhang |
| `slice` | Slices one variant: time, filament, layers |
| `compare` | Slices several variants and returns a table |

All four tools are read-only. Slicing happens in a temp folder that is removed afterwards.

---

## Example

Original Prusa MK3S, PETG, 0.20 mm layers:

| Slice | Perimeters | Infill | Time | Filament |
|---|---|---|---|---|
| **Option 1** (preset) | 2 | 20% gyroid | 2h 44m | 39.9 g |
| Option 2 | 4 | 20% gyroid | 2h 53m | 52.3 g |
| Option 3 | 4 | 15% grid | 2h 33m | 51.2 g |

---

## Getting started

You need macOS, Node.js 22 or newer, and PrusaSlicer installed in `/Applications` (either the plain app or the one inside "Original Prusa Drivers").

```bash
git clone https://github.com/JoFaTech2508/prusaslicer-mcp.git
cd prusaslicer-mcp
npm install
npm run build
```

Then add it to your MCP client. Every client needs the same two things: the command `node` and the absolute path to `dist/index.js` in your clone. Most clients read a JSON entry like this:

```json
{
  "mcpServers": {
    "prusaslicer": {
      "command": "node",
      "args": ["/Users/me/prusaslicer-mcp/dist/index.js"]
    }
  }
}
```

| Client | Where it goes |
|---|---|
| Claude Desktop | `claude_desktop_config.json`, under `mcpServers` |
| Cursor | `~/.cursor/mcp.json`, under `mcpServers` |
| VS Code | `.vscode/mcp.json`, under `servers`, with `"type": "stdio"` added |
| Claude Code | `claude mcp add --scope user prusaslicer -- node "$PWD/dist/index.js"` |

Restart the client and ask something like "how long does part.stl take with 3 vs 4 perimeters?". To try the tools without any client, run `npx @modelcontextprotocol/inspector node dist/index.js`.

---

## Good to know

- **Saved presets only.** The server reads the preset files on disk. A preset shown as "(modified)" in the PrusaSlicer window has unsaved changes that the server cannot see, so save it first if those changes matter.
- **Compare variants with each other.** The CLI estimate comes out a few minutes off the number in the PrusaSlicer window. The difference between two variants is reliable.
- **Allowed settings.** `slice` and `compare` accept a fixed list of overrides: perimeters, top and bottom solid layers, infill density and pattern, layer heights, support, brim, seam position, ironing, a few speeds, max volumetric speed, rotation and scale. Anything else is refused.
- **Other presets.** Pass `presets` with a printer, print or filament name to slice with something other than the selected ones. Unknown names are refused, since the PrusaSlicer CLI crashes on them without a message.
- **No auto-orientation.** The CLI slices the model as it lies in the file. Use `rotate-x` or `rotate-y` to try another side down.

---

## Configuration

Nothing is needed for a standard install. These environment variables cover the rest:

| Variable | Default | What it does |
|---|---|---|
| `PRUSASLICER_PATH` | the two `/Applications` locations | Path to the PrusaSlicer binary |
| `PRUSASLICER_DATADIR` | `~/Library/Application Support/PrusaSlicer` | PrusaSlicer config folder (read only) |
| `PRUSASLICER_TIMEOUT_S` | `600` | Time limit for one slice, in seconds |

To run the tests against a real model, set `PRUSASLICER_TEST_MODEL` to an STL path and run `npm test`.

---

<p align="center">Built with TypeScript, the MCP TypeScript SDK and the PrusaSlicer CLI.</p>

<p align="center">&copy; 2026 JoFaTech2508</p>

TDQS

A4/5.0

Scored across 4 tools

Disambiguation4/5

read_presets and check_orientation are clearly distinct (config inspection vs. geometry analysis), and slice vs. compare is separated by compare being an explicit multi-variant batch with a diff table. The only mild overlap is that an agent could emulate compare with repeated slice calls, but the descriptions make the intended boundary clear.

Naming Consistency4/5

All names are lowercase snake_case and start with an action verb, so the set reads predictably. However, two use verb_noun (read_presets, check_orientation) while two use bare verbs (slice, compare), a minor deviation from a strict pattern.

Tool Count5/5

Four tools is well-scoped for a focused slicing/analysis server: inspect presets, analyze orientation, slice, and compare variants. Each tool has a distinct role and none feels redundant or filler.

Completeness3/5

The core workflow (inspect config, check orientation, slice, compare) is covered, but there is no way to list available presets to choose from, no explicit orientation/rotation operation beyond slice overrides, and no tool to export or locate the resulting G-code. These are workable gaps but notable for a full lifecycle.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues