Metadata-Version: 2.5
Name: anycubic-slicer-mcp
Version: 1.4.0
Summary: MCP server that lets AI agents slice, preview, diagnose and optimise 3D prints with Anycubic Slicer Next (Windows and macOS), and send and watch prints over LAN mode or Anycubic Cloud
Project-URL: Homepage, https://pri-te-sh.github.io/anycubic-slicer-mcp/
Project-URL: Repository, https://github.com/pri-te-sh/anycubic-slicer-mcp
Project-URL: Issues, https://github.com/pri-te-sh/anycubic-slicer-mcp/issues
Author: pcb
License-Expression: MIT
License-File: LICENSE
Keywords: 3d-printing,ai,antigravity,anycubic,anycubic-slicer-next,claude,cursor,gcode,kobra,mcp,model-context-protocol,slicer
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
Classifier: Topic :: Printing
Requires-Python: >=3.10
Requires-Dist: cryptography>=42
Requires-Dist: httpx>=0.27
Requires-Dist: mcp<2,>=1.20
Requires-Dist: numpy>=1.24
Requires-Dist: paho-mqtt>=2.0
Requires-Dist: pillow>=10.1
Requires-Dist: pyobjc-framework-applicationservices>=10; sys_platform == 'darwin'
Requires-Dist: pyobjc-framework-quartz>=10; sys_platform == 'darwin'
Requires-Dist: pyobjc-framework-vision>=10; sys_platform == 'darwin'
Provides-Extra: test
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

<!-- mcp-name: io.github.pri-te-sh/anycubic-slicer-mcp -->
<p align="center">
  <a href="https://pri-te-sh.github.io/anycubic-slicer-mcp/"><img src="https://raw.githubusercontent.com/pri-te-sh/anycubic-slicer-mcp/main/docs/assets/hero.svg" alt="Anycubic Slicer MCP: your AI agent slices, checks and tunes your 3D prints in Anycubic Slicer Next" width="100%"></a>
</p>

<p align="center">
  <a href="https://github.com/pri-te-sh/anycubic-slicer-mcp/actions/workflows/tests.yml"><img alt="Tests" src="https://github.com/pri-te-sh/anycubic-slicer-mcp/actions/workflows/tests.yml/badge.svg"></a>
  <a href="https://pypi.org/project/anycubic-slicer-mcp/"><img alt="PyPI" src="https://img.shields.io/pypi/v/anycubic-slicer-mcp?color=005aff"></a>
  <img alt="Windows and macOS" src="https://img.shields.io/badge/platform-Windows%20%7C%20macOS-005aff">
  <img alt="Python 3.10 or newer" src="https://img.shields.io/badge/python-3.10%2B-005aff">
  <a href="https://modelcontextprotocol.io"><img alt="MCP server" src="https://img.shields.io/badge/MCP-server-005aff"></a>
  <a href="https://github.com/pri-te-sh/anycubic-slicer-mcp/blob/main/LICENSE"><img alt="MIT licence" src="https://img.shields.io/badge/licence-MIT-005aff"></a>
  <a href="https://github.com/pri-te-sh/anycubic-slicer-mcp/blob/main/CONTRIBUTING.md"><img alt="PRs welcome" src="https://img.shields.io/badge/PRs-welcome-005aff"></a>
</p>

<p align="center">
  <a href="https://pri-te-sh.github.io/anycubic-slicer-mcp/"><b>Website</b></a> ·
  <a href="#install">Install</a> ·
  <a href="#tools">Tools</a> ·
  <a href="#faq">FAQ</a> ·
  <a href="https://github.com/pri-te-sh/anycubic-slicer-mcp/blob/main/CONTRIBUTING.md">Contribute</a>
</p>

# Anycubic Slicer MCP

**Anycubic Slicer MCP** is an open-source [Model Context Protocol](https://modelcontextprotocol.io) server for **Anycubic Slicer Next** on Windows and macOS. It lets Claude, Cursor, Codex, Antigravity, DeepSeek Harness or any other MCP client slice STL, 3MF, OBJ and STEP files, preview the G-code and plan a print before you commit filament to it.

You can ask for things like:

- "Slice gear.stl for my Kobra X with 20% gyroid and three walls, and show me layer 12."
- "Here's a photo of my new spool. Make a filament profile from the label."
- "This print came out stringy and the corners lifted. What should I change?"
- "This bracket gets bent from the side. Make it stronger and tell me what that costs in time."
- "How much filament does this two-colour print waste on colour changes?"
- "Here's a zip of the whole robot kit. Plan the plates, ask me what's unclear, then slice it."
- "My print just paused. What's wrong, and can it carry on?"
- "Send it to the printer. I've cleared the bed."

The server drives the slicer's own command line on your computer, so you check the preview before anything is printed. It can also send a print to your printer and watch it: directly over LAN mode, or through the slicer window when the printer stays on Anycubic Cloud. Anything that starts, pauses or stops a print waits for your yes in the chat.

## What it does

### Slice from a sentence

`slice_model` takes preset names (or the selection in the slicer window) and any setting override by name: infill, walls, supports, brim, layer height, temperatures. It handles rotation, scale, copies and multi-colour plates, and writes both a `.gcode` file and a printer-ready `.gcode.3mf`.

A real run on the example gear, with a Kobra X and 0.4 mm nozzle: **30m 48s, 9.66 g of PLA, 45 layers at 0.2 mm.**

### See the toolpaths before printing

| One layer, coloured by feature | Every layer, shaded by height | Shareable print card |
|---|---|---|
| <img src="https://raw.githubusercontent.com/pri-te-sh/anycubic-slicer-mcp/main/docs/assets/preview-layer-12.png" alt="Layer 12 of the gear with outer walls, inner walls and gyroid infill" width="260"> | <img src="https://raw.githubusercontent.com/pri-te-sh/anycubic-slicer-mcp/main/docs/assets/preview-all-layers.png" alt="All 45 layers of the gear shaded from dark blue at the bed to light blue at the top" width="260"> | <img src="https://raw.githubusercontent.com/pri-te-sh/anycubic-slicer-mcp/main/docs/assets/print-card.png" alt="Print card showing print time, filament, layers, infill, walls and printer" width="260"> |

`preview_gcode` also draws a side view for checking overhangs and supports. `animate_layers` saves a GIF of the print building up.

### Filament profile from a photo of the label

Your agent reads the spool label (brand, material, colour, temperature ranges, weight) and `create_filament_profile` turns it into a preset that inherits from the closest one your printer already has. It shows a preview first and saves only when you confirm. Spools can go into a small local inventory, so the agent can tell you which one has enough left for the next print.

### Print doctor

Send photos of a failed print. The agent matches what it sees to one of 13 defects (stringing, warping, layer adhesion, first layer, under and over extrusion, elephant foot, ringing, overhangs, bridging, top surface, layer shift and seams). `diagnose_print` then suggests setting changes based on the presets you used. When two fixes would push the same setting in opposite directions, it reports the conflict and leaves that setting alone.

### Stronger parts

Tell it how the part is loaded (tension, compression, bending, impact or torsion) and in which direction. `analyze_strength` looks for thin waists in the shape and recommends an orientation and settings. `find_best_orientation` ranks ways to lay the model on the bed for least support, speed, strength, bed adhesion or a balance of them.

### Multi-colour waste

On a single-nozzle printer every colour change flushes filament. In a test on a Kobra X with two 15 mm cubes, one black and one white, 8.31 g of a 9.99 g print went to colour changes. `optimize_multicolor` measures that waste for your model, tests settings that might reduce it, and recommends one only if every colour is kept and it saves filament. It also suggests layout changes.

### Whole projects, with questions first

Point the agent at a folder or a .zip of parts. `plan_project` finds every model and reads counts from names like `clip_x4.stl` and from a README. It lays each part in its best orientation and packs the parts onto plates. You can group for the fewest plates or by colour, cap each plate at a number of hours, and keep parts that need supports together.

It doesn't guess when the files are unclear. It returns questions for the agent to put to you, and the blocking ones must be answered before `slice_project` will run:

- two versions of the same part (`lid_v1`, `lid_v2`): which to print?
- a part only a few millimetres across: exported in inches or cm?
- a part bigger than the bed: scale it or skip it?
- parts with no count anywhere: one of each?
- files that look like test pieces: leave them out?
- broken meshes, colour groups, and whether supported parts get their own plates

Each plate is sliced as its own `.gcode.3mf`. If the slicer can't fit everything on a plate, the extras move to the next one. In a test with an 11-file kit, three questions settled it and the result was one plate of 14 pieces: 2h 32m 23s and 71.62 g.

### Send and watch prints

A Kobra X runs either in LAN mode or on Anycubic Cloud, not both: with LAN mode on, the cloud and the phone app's remote control stop. The server works with either.

**LAN mode** (printer screen: Settings > Network > LAN Mode). The server talks to the printer directly over your network, using the protocol the community has documented for the Kobra X, S1 and Kobra 3 family. No Anycubic account is involved.

- `printer_status` reports the state, the job's progress and time left, nozzle and bed temperatures against their targets, the filament in each slot, how the last print ended, and any error code with Anycubic's meaning and a link to the fix.
- `printer_camera_snapshot` takes a photo with the built-in camera so the agent can look at the bed.
- `send_print` uploads a sliced `.gcode.3mf` and starts it. First it shows what will happen: the file's time and weight, which slot each filament comes from, and whether the printer is idle and is the model the file was sliced for. It refuses a filament that doesn't match the slot's material.
- `control_print` pauses, resumes or stops the current print.

**Anycubic Cloud** (LAN mode off, so the phone app keeps working). Anycubic doesn't publish a cloud API, so the server goes through the slicer window, which is already signed in to your account. The server never sees your login.

- `cloud_printer_status` reads the window's Workbench screen: state, job, progress, layer, time left, temperatures, part fan, firmware and the loaded slots, plus a screenshot.
- `print_from_slicer` opens the window's Start Print dialog for the plate you sliced there and reads it back: task, time, weight, filament, printer and whether it can take the job. It presses Start Print only after you confirm, and only if the dialog still shows the same plate.

Starting, pausing, resuming and stopping always go in two steps: the tool previews what it will do, the agent asks you, and it acts only after you say yes in the chat.

Tested on a Kobra X with firmware 2.0.2.8 and Anycubic Slicer Next 2.0.0.3 on macOS:

| | Tested on the real printer | Not yet tested on the real printer |
|---|---|---|
| LAN mode | finding it, status, camera, the `send_print` preview, refusing PETG into a PLA slot, refusing to pause an idle printer | the actual upload and start; pause, resume and stop (tested against a simulated printer) |
| Anycubic Cloud | reading a live print from the Workbench, reading the Start Print dialog, refusing to start while the printer is busy | the actual start; pausing or ending from the Workbench |

### Drive the slicer window

Some things only the window does, so the agent can use it too (macOS for now):

- `restart_slicer` closes the window the normal way and reopens it with the presets you chose selected and a file open. The window only loads new presets when it starts. It never force-quits: if the window is asking whether to save a project, it tells the agent to ask you.
- `slicer_screenshot` returns a picture of just the slicer's window and the text in it.
- `slicer_click` clicks a button by its label, for example `Slice plate` or `Cancel`. Clicks only land inside the slicer window, and only while it's in front. Buttons that start, send, pause, stop, delete or discard something are refused unless you've said yes to that exact click.

Screenshots need Screen Recording permission and clicks need Accessibility permission for the app that runs the server (System Settings > Privacy & Security). Both are your call.

### Calibration prints

`make_calibration_print` generates and slices a temperature tower (it changes the nozzle temperature at each block for you), flow-ratio cubes, retraction towers, or five first-layer squares spread across the bed.

### Planning and cost

`compare_slices` runs up to eight variants side by side. `estimate_cost` adds electricity and any labour or markup. `check_bed_fit` says whether a model fits and suggests a 45° turn, scaling, laying it down or splitting it if it doesn't.

## Install

You need:

1. Anycubic Slicer Next, installed from Anycubic's website and opened once, with your printer selected.
2. [uv](https://docs.astral.sh/uv/getting-started/installation/).

Then install the server:

```bash
uv tool install --python 3.13 anycubic-slicer-mcp
```

That puts an `anycubic-slicer-mcp` command on your PATH (`uv tool dir --bin` prints where).

To try it without installing, any MCP client can also run it straight from [PyPI](https://pypi.org/project/anycubic-slicer-mcp/) with `uvx anycubic-slicer-mcp`. It's listed in the [official MCP Registry](https://registry.modelcontextprotocol.io/) as `io.github.pri-te-sh/anycubic-slicer-mcp`.

### Let your agent set it up

Copy this into Claude Code, Cursor, Codex, Antigravity or another coding agent. The same prompt is behind the **Copy prompt for your agent** button on the [website](https://pri-te-sh.github.io/anycubic-slicer-mcp/).

```text
Set up the Anycubic Slicer MCP server (https://github.com/pri-te-sh/anycubic-slicer-mcp) on this computer and connect it to the AI app you are running in.

1. Check that Anycubic Slicer Next is installed. On macOS look for /Applications/AnycubicSlicerNext.app; on Windows look for C:\Program Files\AnycubicSlicerNext\AnycubicSlicerNext.exe. If it is missing, stop and ask me to install it from Anycubic's website and open it once.
2. Check that uv is installed (run: uv --version). If it is not, show me the official install command from https://docs.astral.sh/uv/getting-started/installation/ and wait for me to run it.
3. Install the server:
   uv tool install --python 3.13 anycubic-slicer-mcp
4. Find the full path of the anycubic-slicer-mcp command (run: uv tool dir --bin).
5. Register it as a stdio MCP server named "anycubic-slicer" in the app you are running in. It needs no arguments or environment variables.
   - Claude Code: claude mcp add anycubic-slicer --scope user -- anycubic-slicer-mcp
   - Codex: codex mcp add anycubic-slicer -- anycubic-slicer-mcp
   - DeepSeek Harness: add an insert entry for the @deepseek-ai/dsh-mcp-client plugin (serverName anycubic-slicer, transport stdio, command anycubic-slicer-mcp) to ~/.dsh/profiles/<profile>/cordis.patch.yml.
   - Cursor, Claude Desktop, Antigravity and others: add {"mcpServers": {"anycubic-slicer": {"command": "<full path from step 4>"}}} to the app's MCP config, keeping any servers already there.
6. Tell me if the app needs a restart to load the server. Once it's loaded, call the slicer_status tool and tell me which printer, process and filament it found.

Don't change anything else on my system, and ask before running any command that needs administrator rights.
```

### Or add it yourself

**Claude Code**

```bash
claude mcp add anycubic-slicer --scope user -- anycubic-slicer-mcp
```

**Codex**

```bash
codex mcp add anycubic-slicer -- anycubic-slicer-mcp
```

**DeepSeek Harness**: put this in `~/.dsh/profiles/desktop/cordis.patch.yml` (or your profile's folder), replacing the `[]` that's there, then restart Harness. It uses Harness's built-in `@deepseek-ai/dsh-mcp-client` plugin.

```yaml
- insert:
    - id: mcp-anycubic-slicer
      name: '@deepseek-ai/dsh-mcp-client'
      config:
        serverName: anycubic-slicer
        transport: stdio
        command: anycubic-slicer-mcp
```

**Cursor** (`~/.cursor/mcp.json`), **Claude Desktop** (`claude_desktop_config.json`), **Antigravity** and most other clients:

```json
{
  "mcpServers": {
    "anycubic-slicer": { "command": "anycubic-slicer-mcp" }
  }
}
```

Desktop apps often don't inherit your shell's PATH. If the server doesn't start, use the full path from `uv tool dir --bin`, for example `/Users/you/.local/bin/anycubic-slicer-mcp` or `C:\Users\you\.local\bin\anycubic-slicer-mcp.exe`.

**VS Code** (`.vscode/mcp.json`):

```json
{
  "servers": {
    "anycubic-slicer": { "type": "stdio", "command": "anycubic-slicer-mcp" }
  }
}
```

Then ask your agent to call `slicer_status`. It should report the printer you selected in the slicer.

### Update or remove

```bash
uv tool upgrade anycubic-slicer-mcp
uv tool uninstall anycubic-slicer-mcp
```

## Tools

| Group | Tool | What it does |
|---|---|---|
| Slice | `slicer_status` | Finds the slicer and reports the printer, process and filament selected in it |
| | `list_presets` | Printer, process and filament presets, filtered to your printer |
| | `get_preset` | A preset's settings with inheritance resolved, or a search for setting names |
| | `save_user_preset` | Saves your own preset so it shows up in the slicer app |
| | `model_info` | Size, volume, triangles, pieces, watertight check and build-volume fit |
| | `slice_model` | G-code and `.gcode.3mf` with overrides, rotation, scale, copies and multi-colour |
| | `open_in_slicer` | Opens a file in the slicer window when you ask |
| Look | `gcode_summary` | Time, filament, cost, layers, first-layer time, colour changes, key settings |
| | `preview_gcode` | Top view of one layer or all layers, or a side view |
| | `animate_layers` | GIF of the print building up |
| | `print_card` | 1200×630 summary image |
| Plan | `compare_slices` | Up to eight variants compared on time, filament and cost |
| | `find_best_orientation` | Ranks orientations by goal |
| | `analyze_strength` | Orientation and settings for how the part is loaded |
| | `check_bed_fit` | Fit check with suggestions |
| | `estimate_cost` | Filament, electricity and extras |
| Filament | `create_filament_profile` | Filament preset from a spool label |
| | `add_spool` / `list_spools` / `update_spool` | Local spool inventory |
| Whole projects | `plan_project` | Plates for every part in a folder or .zip, plus the questions to ask you first |
| | `slice_project` | Slices an approved plan, one `.gcode.3mf` per plate |
| Fix and tune | `diagnose_print` | Causes and setting changes for print defects |
| | `make_calibration_print` | Temperature tower, flow, retraction or first-layer test, sliced |
| | `optimize_multicolor` | Measures and reduces colour-change waste |
| Printer (LAN mode) | `find_printers` | Finds Anycubic printers on your network and whether LAN mode is on |
| | `printer_status` | State, job, temperatures, errors explained, loaded filament and ACE slots |
| | `printer_camera_snapshot` | One photo from the printer's camera (needs ffmpeg) |
| | `send_print` | Uploads a sliced file and starts it, after you confirm |
| | `control_print` | Pause, resume or stop the current print, after you confirm |
| Printer (Anycubic Cloud) | `cloud_printer_status` | The printer's state and job, read from the slicer window's Workbench |
| | `print_from_slicer` | Starts the plate open in the slicer window through its Start Print dialog, after you confirm |
| Slicer window (macOS) | `restart_slicer` | Reopens the window with chosen presets selected and a file open |
| | `slicer_screenshot` | A picture of the slicer window and the text in it |
| | `slicer_click` | Clicks a button by its label; print, stop and delete buttons need your yes |

It also ships seven prompts that walk the agent through common jobs: `setup_check`, `filament_from_label`, `diagnose_from_photos`, `make_it_stronger`, `multicolor_waste`, `print_this_project` and `check_my_printer`.

## Safety

- Nothing starts, pauses, resumes or stops a print without your yes in the chat. Each of those tools previews first, and the agent is told never to act on its own.
- The server never connects to Anycubic Cloud itself and never reads your account login. Cloud printing goes through the slicer window, which you're signed in to.
- LAN printer tools only talk to a printer you point them at, on your own network (public addresses are refused). The printer's address is remembered; its LAN credentials are kept in memory only.
- Window clicks only land inside the slicer's window while it's in front, never in its title bar, and buttons that print, stop, delete or discard need your yes.
- 3MF project files that contain post-processing scripts are refused, because those scripts can run programs on your computer.
- Settings that hold custom G-code templates can't be overridden unless you set `ANYCUBIC_MCP_ALLOW_GCODE_TEMPLATES=1`.
- Network paths (UNC on Windows) are blocked unless you set `ANYCUBIC_MCP_ALLOW_NETWORK_PATHS=1`.
- New filament profiles are previews until you confirm, and existing presets aren't overwritten unless you ask.

## Configuration

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

| Variable | Use |
|---|---|
| `ANYCUBIC_SLICER_EXE` | Path to the slicer program if it isn't in the default place |
| `ANYCUBIC_SLICER_DATA` | Path to the slicer's data folder |
| `ANYCUBIC_MCP_STATE_DIR` | Where the spool inventory, project plans and unpacked zips are kept |
| `ANYCUBIC_MCP_ALLOW_GCODE_TEMPLATES` | `1` allows overriding G-code template settings |
| `ANYCUBIC_MCP_ALLOW_NETWORK_PATHS` | `1` allows UNC network paths on Windows |
| `ANYCUBIC_PRINTER_HOST` | Your printer's IP address, so the printer tools don't need it each time |
| `ANYCUBIC_MCP_FFMPEG` | Path to ffmpeg for camera snapshots, if it isn't on your PATH |

## FAQ

**Which printers work?**
Any printer with a preset in Anycubic Slicer Next, since the server reads the slicer's own presets. That includes the Anycubic Kobra X, Kobra S1 and S1 Max, Kobra 4, Kobra 3 (V2, Max, Max V2), Kobra 2 (Neo, Plus, Pro, Max) and Kobra 1 (Plus, Max). It has been tested end to end on a Kobra X with a 0.4 mm nozzle. If you try another model, please send a [printer report](https://github.com/pri-te-sh/anycubic-slicer-mcp/issues/new?template=printer_report.yml).

**Does it work with OrcaSlicer or Bambu Studio?**
Not yet. It drives Anycubic Slicer Next, which is built on OrcaSlicer. Support for other OrcaSlicer-based slicers would be a welcome contribution.

**Does the slicer window need to be open?**
Not for slicing. The server runs the slicer in the background, using the printer, process and filament you last picked in the app, so open the app once to choose them. The cloud printer tools and the window tools do need it open.

**Does it send anything to my printer?**
Only when you say so. `send_print` (LAN mode) and `print_from_slicer` (Anycubic Cloud) start a print, and `control_print` pauses, resumes or stops one. Each shows you what it will do first and acts only after you confirm in the chat. Everything else reads.

**Does it work with Anycubic Cloud and the phone app?**
Yes, through the slicer window: keep LAN mode off, stay signed in to the slicer, and use `cloud_printer_status` and `print_from_slicer`. That part works on macOS for now. The LAN tools are faster and don't need the window, but LAN mode switches the cloud and the phone app's remote control off.

**Does it work on Linux?**
Not yet. Windows and macOS are supported. Linux pull requests are welcome.

**Is this an Anycubic product?**
No. It's an independent project under the MIT licence and isn't affiliated with or endorsed by Anycubic. Anycubic and Kobra are trademarks of their owner.

## Contributing

The most useful thing you can do right now is try it on a printer other than the Kobra X and [report what happened](https://github.com/pri-te-sh/anycubic-slicer-mcp/issues/new?template=printer_report.yml). Bug fixes, new print defects for the doctor, calibration ideas and Linux support are all welcome. See [CONTRIBUTING.md](https://github.com/pri-te-sh/anycubic-slicer-mcp/blob/main/CONTRIBUTING.md) to get set up; the test suite runs without the slicer installed.

## Licence

[MIT](https://github.com/pri-te-sh/anycubic-slicer-mcp/blob/main/LICENSE)
