Skip to main content
Glama
JSCodesTech

snapmaker-u1-mcp

by JSCodesTech

snapmaker-u1-mcp

MCP server for Snapmaker U1 headless slicing on Ubuntu using Snapmaker Orca only.

It provides safe, reproducible primitives for AI agents:

  • discover U1 models and profiles

  • resolve Snapmaker Orca profile inheritance

  • slice STL/3MF to G-code

  • analyze generated G-code

  • apply controlled process overrides

  • compare slice variants

No GUI automation, no printer control, no automatic print start, and no fallback to upstream OrcaSlicer.

Acknowledgements

This project was planned in the context of Diterex/orcaslicer-mcp and keeps attribution to that project while implementing a smaller Snapmaker U1/Snapmaker Orca-only server.

Related MCP server: PrusaMCP

Status

Implemented through Phase 10:

  • u1_health

  • u1_list_models

  • u1_list_profiles

  • u1_slice

  • u1_analyze_gcode

  • u1_compare_slices

  • u1_inspect_model

  • u1_compare_orientations

  • u1_render_preview

  • u1_inject_thumbnail

Setup

export SNAPMAKER_ORCA_BIN=/path/to/snapmaker-orca/internal/orca-slicer
# or
export SNAPMAKER_ORCA_APPIMAGE=/path/to/Snapmaker-Orca.AppImage

export SNAPMAKER_PROFILE_DIR=/path/to/Snapmaker/Orca/profiles  # optional if auto-discovered
export U1_MODEL_DIR=$HOME/3D_Printing/models
export U1_OUTPUT_DIR=$HOME/3D_Printing/output

CLI examples

PYTHONPATH=src python3 -m snapmaker_u1_mcp.server health
PYTHONPATH=src python3 -m snapmaker_u1_mcp.server list-models
PYTHONPATH=src python3 -m snapmaker_u1_mcp.server list-profiles --nozzle 0.4 --material PLA
# add --details to include full profile metadata
PYTHONPATH=src python3 -m snapmaker_u1_mcp.server inspect-model hase.stl
PYTHONPATH=src python3 -m snapmaker_u1_mcp.server render-preview hase.stl --view summary
PYTHONPATH=src python3 -m snapmaker_u1_mcp.server inject-thumbnail RUN_ID/plate_1.gcode --model hase.stl

Slice:

PYTHONPATH=src python3 -m snapmaker_u1_mcp.server slice hase.stl \
  --process "0.20 Standard @Snapmaker U1 (0.4 nozzle)" \
  --filament "Snapmaker PLA Basic @U1"

Slice with controlled overrides:

PYTHONPATH=src python3 -m snapmaker_u1_mcp.server slice hase.stl \
  --process "0.20 Standard @Snapmaker U1 (0.4 nozzle)" \
  --filament "Snapmaker PLA Basic @U1" \
  --overrides '{"wall_loops":5,"sparse_infill_density":20}'

Compare variants:

PYTHONPATH=src python3 -m snapmaker_u1_mcp.server compare-slices hase.stl \
  --filament "Snapmaker PLA Basic @U1" \
  --variants '[{"name":"standard","process":"0.20 Standard @Snapmaker U1 (0.4 nozzle)","overrides":{}},{"name":"strong","process":"0.20 Standard @Snapmaker U1 (0.4 nozzle)","overrides":{"wall_loops":5,"sparse_infill_density":20}}]'

Compare orientations:

PYTHONPATH=src python3 -m snapmaker_u1_mcp.server compare-orientations hase.stl \
  --process "0.20 Standard @Snapmaker U1 (0.4 nozzle)" \
  --filament "Snapmaker PLA Basic @U1" \
  --orientations '[{"name":"flat"}]'

Note: Snapmaker Orca Linux CLI 01.10.01.50 has been observed to segfault on some non-zero CLI rotation transforms. Such failures are reported per variant and logs are preserved; no fallback slicer is used.

MCP usage

1. Create a virtual environment

cd /home/USER/snapmaker-u1-mcp
python3 -m venv .venv
.venv/bin/pip install -e .

2. Put models in the allowed model directory

mkdir -p /home/USER/3D_Printing/models
cp bracket.stl /home/USER/3D_Printing/models/
mkdir -p /home/USER/3D_Printing/output

The MCP server only accepts model paths relative to U1_MODEL_DIR.

3. Add the MCP server to your client config

A template is included at .pi/mcp.example.json.

Example MCP config:

{
  "mcpServers": {
    "snapmaker-u1": {
      "type": "stdio",
      "command": "/home/USER/snapmaker-u1-mcp/.venv/bin/python",
      "args": ["-m", "snapmaker_u1_mcp.server"],
      "env": {
        "SNAPMAKER_ORCA_APPIMAGE": "/home/USER/Applications/Snapmaker-Orca.AppImage",
        "U1_MODEL_DIR": "/home/USER/3D_Printing/models",
        "U1_OUTPUT_DIR": "/home/USER/3D_Printing/output"
      }
    }
  }
}

Use SNAPMAKER_ORCA_BIN instead of SNAPMAKER_ORCA_APPIMAGE if you have the internal Snapmaker Orca binary path.

4. Verify from your MCP client

Ask your MCP client/agent:

Check my Snapmaker U1 slicer health.

Expected tool call:

u1_health

Then ask:

List my available PLA profiles for a 0.4 mm Snapmaker U1 nozzle.

Expected tool call:

u1_list_profiles(nozzle=0.4, material="PLA")

5. Example MCP prompts

Slice a model:

Slice hase.stl for my Snapmaker U1 with the 0.20 Standard 0.4 nozzle process and Snapmaker PLA Basic filament.

Compare stronger settings:

Compare hase.stl baseline against 5 walls and 20% infill. Keep all generated G-code files.

Inspect and preview:

Inspect hase.stl and render a summary preview.

Compare orientations:

Compare flat, 90 degrees around X, and 90 degrees around Y for hase.stl.

Available MCP tools

  • u1_health

  • u1_list_models

  • u1_list_profiles

  • u1_slice

  • u1_analyze_gcode

  • u1_compare_slices

  • u1_inspect_model

  • u1_compare_orientations

  • u1_render_preview

  • u1_inject_thumbnail

  • u1_smoke_slice regression/helper

MCP response size

MCP tools return compact responses by default to avoid filling the agent context with logs and profile metadata.

Use these only when needed:

  • u1_list_profiles(..., details=true) for full profile metadata

  • u1_slice(..., verbose=true) for command and log tails

  • u1_compare_slices(..., verbose=true) for per-variant verbose slice data

  • u1_compare_orientations(..., verbose=true) for per-orientation verbose slice data

Full reproducibility artifacts are always written to the run directory even when MCP responses are compact.

Run artifacts

Each slice creates a unique run directory containing:

request.json
command.json
profiles/machine.json
profiles/process.json
profiles/filament.json
stdout.log
stderr.log
analysis.json
plate_1.gcode

Original Snapmaker profiles are never modified.

Tests

PYTHONPATH=src pytest -q
coverage run -m pytest -q
coverage report

Coverage threshold: 80%.

Notes

Snapmaker Orca Linux CLI 01.10.01.50 segfaults when a flattened U1 process profile includes wipe_tower_filament. V1 is single-material, so generated runtime profiles omit that multi-material field.

See docs/ for phase notes and architecture details.

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    An intelligent 3D printing assistant that enables users to analyze meshes, generate optimal print profiles, and automate PrusaSlicer operations through an MCP client. It provides a comprehensive suite of tools for geometric analysis, printability checks, filament recommendations, and post-print diagnostics.
    17
    8
    -
  • A
    license
    B
    quality
    B
    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
  • F
    license
    A
    quality
    C
    maintenance
    An MCP server that drives OrcaSlicer headlessly on a virtual display, enabling an agent to import 3D models, slice them, and export G-code without a physical screen or GUI automation.
    12
    2
    -