Skip to main content
Glama
anycubic-slicer-mcp

anycubic-slicer-mcp

by EmreTekir

anycubic-slicer-mcp

tests M8ven Score

An MCP server that lets AI agents (Claude Code, Claude Desktop, Cursor, …) use Anycubic Slicer Next without its GUI: list presets, slice models, read print time and filament estimates, and look at a rendered preview of the toolpaths.

Unofficial community project. Not affiliated with or endorsed by Anycubic.

You:    Slice examples/calibration_cube.stl for my Kobra S1 with 15% infill.
Agent:  slice_model → 20m 53s, 3.56 g PLA, 100 layers, first layer 24s
        preview_gcode(layer=1) → [PNG of the first layer, colored by feature]

examples/calibration_cube.stl is a plain 20 mm cube (regenerate it with python examples/make_cube.py).

Requirements

  • Windows (the slicer's headless CLI and preset folders are used as installed by Anycubic)

  • Anycubic Slicer Next installed and opened at least once

  • Python 3.10+

Tested with Anycubic Slicer Next 2.0.0.3 on Kobra S1, S1 Max, Kobra 3 / 3 Max, Kobra 4, Kobra X, Kobra 2 Neo / 2 Pro and Kobra 1 presets. Presets are read from the slicer itself, so other Anycubic printers should work too.

Related MCP server: cura-mcp

Install

git clone https://github.com/EmreTekir/anycubic-slicer-mcp
cd anycubic-slicer-mcp
py -3 -m venv .venv
.venv\Scripts\python.exe -m pip install .

Register it with Claude Code (for all your projects):

claude mcp add --scope user anycubic-slicer -- "$PWD\.venv\Scripts\anycubic-slicer-mcp.exe"

Or in any MCP client config:

{
  "mcpServers": {
    "anycubic-slicer": {
      "command": "C:\\path\\to\\anycubic-slicer-mcp\\.venv\\Scripts\\anycubic-slicer-mcp.exe"
    }
  }
}

With uv you can skip the clone: uvx --from git+https://github.com/EmreTekir/anycubic-slicer-mcp anycubic-slicer-mcp

Environment variables

Variable

Default

ANYCUBIC_SLICER_EXE

C:\Program Files\AnycubicSlicerNext\AnycubicSlicerNext.exe

ANYCUBIC_SLICER_DATA

%APPDATA%\AnycubicSlicerNext

ANYCUBIC_MCP_ALLOW_GCODE_TEMPLATES

unset; 1 allows editing raw G-code templates (see Safety)

ANYCUBIC_MCP_ALLOW_NETWORK_PATHS

unset; 1 allows \\server\share paths (see Safety)

Tools

Tool

What it does

slicer_status

Install path, version, active preset folder, printer/process/filament selected in the GUI

list_presets

Machine / process / filament presets, filtered to those compatible with a printer

get_preset

Fully resolved preset (inheritance merged); search finds setting keys

model_info

Size, bounding box, volume, facet count, manifold check

slice_model

STL/3MF/OBJ/STEP → .gcode, .gcode.3mf and an editable _project.3mf, with time, grams, meters, layers and warnings; multi-colour via object_filaments

gcode_summary

The same estimates read from an existing .gcode

preview_gcode

Top-down PNG: all layers shaded by height, or one layer colored by feature

open_in_slicer

Open a file in the slicer GUI (only when you ask for it)

save_user_preset

Save a user preset that appears in the GUI

Settings are changed with overrides, e.g. {"sparse_infill_density": "20%", "enable_support": true, "brim_type": "outer_only", "nozzle_temperature": 215}. Each key is routed to the process, filament or machine config that owns it. Valid keys that no preset lists (such as ironing_inset) go to the process config. Keys the slicer doesn't know are rejected, and the result lists warnings for values the slicer clamped or ignored (for example a bed temperature key that doesn't match the selected plate type).

Multi-colour prints: give one model file per colour, the filaments, and which filament each model uses. Pass the colours of the loaded spools so the printer maps each filament to the right one:

{"models": ["body.stl", "logo.stl"], "filaments": ["Anycubic PLA", "Anycubic PLA Matte"],
 "object_filaments": [1, 2], "filament_colours": ["#FFFFFF", "#1E6FD9"]}

Each slice writes three files: <name>.gcode, <name>.gcode.3mf (G-code inside, for sending to the printer; the GUI shows it as a G-code preview) and <name>_project.3mf (no G-code, opens in the GUI as a project you can still edit). Overridden settings are recorded so the GUI keeps them instead of falling back to the preset values.

Notes:

  • Filament names can be given naturally: with a printer selected, "Anycubic PLA" means Anycubic PLA @<that printer>.

  • scale and rotate_z work on STL and OBJ files (the model is transformed before slicing).

  • arrange=false keeps the coordinates stored in the file, so a model at the origin may land off the bed.

  • Results are written next to the first model unless output_dir is given; existing files with the same name are replaced.

How it works

  • Presets live as JSON under %APPDATA%\AnycubicSlicerNext\system\Anycubic\… and user\<folder>\…. Each may inherits a parent; the server merges the chain into the flat config the CLI expects. The active user folder and the GUI's selection come from AnycubicSlicerNext.conf.

  • The CLI checks compatible_printers against the printer's system parent, so flattened user printers get that parent written back. Using a process or filament made for another printer works, and is reported as a warning.

  • Anycubic filaments carry per-nozzle variants (nozzle_temperature_HS, _BRASS) that win over the plain key; setting the plain key updates them too.

  • The slicer's own first-layer estimate is far too low, so first_layer_time is measured from the M73 progress marks when the G-code has them (first_layer_time_source says which was used).

  • The slicer's own --scale above 1 and --rotate crash it, so models are transformed in Python.

  • Tools run in worker threads: a long slice does not block other requests.

Safety

The server runs locally over stdio with your user's permissions. It is built so a confused or manipulated agent (for example one following instructions hidden in a downloaded file) cannot turn it into more than a slicer:

  • post_process (programs the slicer runs after slicing) can never be set through the tools. 3MF files are scanned before they are sliced, inspected or opened, and refused if any settings entry carries a post-processing script or cannot be checked reliably.

  • Raw G-code templates (machine_start_gcode, filament_end_gcode, …) are read-only unless you set ANYCUBIC_MCP_ALLOW_GCODE_TEMPLATES=1.

  • Setting values may not contain line breaks or control characters, so a value that a G-code template expands (a filament type, a note) cannot smuggle in extra G-code lines.

  • Network paths (\\server\share\…, mapped network drives) are refused before anything touches the filesystem, because merely opening one makes Windows send your credentials to that server.

  • File tools only accept existing files with model or .gcode extensions. slice_model writes only .gcode / .gcode.3mf files; save_user_preset writes only into the slicer's user preset folder and cannot change a preset's name, parent or compatibility fields.

  • Image size, timeout, copies, scale and plate number are bounded.

What it does not protect against:

  • Your own presets: a user preset that already contains a post_process script (set up in the GUI) is used as-is, exactly as the GUI would use it.

  • A 3MF sliced with use_project_settings brings its own start/end G-code, as it would in the GUI.

  • Temperatures and speeds are ordinary settings and are passed through. Check what the agent sliced before you print it.

Development

.venv\Scripts\python.exe -m pip install -e .[test]
.venv\Scripts\python.exe -m pytest

The tests need no slicer install. Changes that touch slicing should also be checked against a real slicer with examples/calibration_cube.stl.

License

MIT

Available Tools

9 tools
gcode_summaryB

Print-time / filament / layer estimates and key settings read from an existing .gcode file.

Inputs: path (required).

get_presetA

Fully resolved (inheritance-merged) preset values. Name may be a unique substring; printer narrows ambiguous process/filament names. Use search to filter keys by substring (e.g. 'infill', 'support', 'temp', 'speed') or keys for exact ones; with neither, long G-code template values are truncated.

Inputs: kind (required), name (required), keys, search, +1 more.

list_presetsB

List selectable presets. kind: machine | process | filament. For process/filament pass printer to keep only compatible ones (user presets listed first). search is a case-insensitive substring filter (e.g. 'S1', 'PLA', '0.16mm').

Inputs: kind (required), search, printer, include_incompatible.

model_infoC

Size (mm), bounding box, facet count, volume (mm3) and manifold check for a model file.

Inputs: path (required).

open_in_slicerA

Open a model/3MF/G-code in the Anycubic Slicer Next GUI. Only call this when the user asks to see it.

Inputs: path (required). Returns: result

preview_gcodeA

Top-down PNG render of a .gcode. layer=None: all layers shaded by height (footprint/placement check). layer=N (1-based): that layer colored by feature: outer wall orange, inner wall yellow, sparse infill dark red, solid infill magenta, top surface red, bottom surface blue, bridge light blue, overhang wall dark blue, support green, brim/skirt cyan, gap fill white. size: image edge in pixels (200-2000).

Inputs: path (required), size, layer.

save_user_presetB

Create/overwrite a user preset that shows up in the GUI (restart the slicer to see it). inherits: parent preset name; settings: only the keys that differ from the parent.

Inputs: kind (required), name (required), inherits (required), settings (required).

slice_modelA

Slice STL/3MF/OBJ/STEP files to G-code plus a .gcode.3mf project (openable in the GUI / sendable to the printer).

printer/process/filaments: preset names or unique substrings; omitted -> GUI selection for that printer. overrides: setting key -> value, routed automatically to process/filament/machine (per-nozzle variants like nozzle_temperature_HS/_BRASS follow the plain key). output_dir defaults to the first model's folder; existing files with the same name are replaced. plate: 0 = all plates. arrange/orient: auto-place and auto-orient (arrange=false keeps the file's coordinates). scale / rotate_z (degrees): STL and OBJ only. copies: total instances of each model. use_project_settings: slice a 3MF with the settings stored inside it (no presets/overrides). Returns gcode paths with print time, filament grams/meters, layer count, key settings and warnings.

Inputs: models (required), plate, scale, copies, +11 more.

slicer_statusC

Slicer install, version, active user preset folder and the GUI's current printer/process/filament.

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 9 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes: slicing, summarizing G-code, previewing, opening the GUI, inspecting models, and managing presets. The only potential overlap is between get_preset and list_presets, but their descriptions make the list-vs-resolve distinction clear.

    Naming Consistency4/5

    All names use consistent snake_case, which is readable and predictable. However, the set mixes verb_noun names (get_preset, slice_model, preview_gcode) with noun-style names (gcode_summary, slicer_status, model_info), a minor deviation rather than a serious inconsistency.

    Tool Count5/5

    Nine tools is well-scoped for an Anycubic slicer integration. Each tool covers a distinct workflow step, from model inspection through slicing, G-code review, and preset management, with no obvious padding.

    Completeness4/5

    The surface covers the core slicer lifecycle: inspect models, list/get/save presets, slice, summarize and preview G-code, open the GUI, and check slicer status. Minor gaps remain, such as deleting or renaming user presets, but agents can work around these for the main workflows.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables AI agents to slice 3D models (STL files) headlessly using UltiMaker Cura's CuraEngine, returning ready-to-print G-code and estimated print time.
      12
      AGPL 3.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to work with OrcaSlicer code and perform slicing operations, such as reading files, checking Git status, and slicing 3D models to get print time and filament usage.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Wraps the OrcaSlicer CLI to enable AI agents to slice 3D models, run parameter sweeps, and analyze G-code.
      107 PyPI
      1
      MIT