Skip to main content
Glama
Slicewise

Slicewise

by gjlmotea

Slicewise — pre-print decision and audit MCP server for Bambu Studio

English | 繁體中文

Slicewise: pre-print checks for Bambu Studio

https://github.com/user-attachments/assets/76e04c37-36cf-41d4-abff-4d0e62fe6b4f

Slicewise lets Claude Code, Codex, Gemini CLI or any other Model Context Protocol client work with Bambu Studio's presets, slicer and model checks: find out whether a model will fail before you print it, decide which settings to change and why, then audit the sliced result to see which settings actually took effect.

It does not control printers. No MQTT, no uploads, no starting prints.

  • CLI slicing that matches the GUI. Bambu Studio's command line ignores preset inherits, so slicing a stock preset from the CLI silently falls back to built-in defaults. Slicewise flattens the inheritance chain (and the per-printer G-code templates) first, then reads the sliced 3MF back and reports, override by override, whether each one was honoured.

  • Printability before slicing. STL, 3MF and OBJ (Tinkercad exports included): out-of-bed size, floating parts that never reach the bed, non-manifold meshes, steep overhangs, small footprints, tall thin parts, thin features and warping risk.

  • Clearance between parts. Minimum gaps for print-in-place mechanisms, so you know before printing whether a hinge will fuse.

  • A parameter knowledge layer. What a setting does, its unit, a sensible range and the cost of raising or lowering it; goal-based plans (safe, fast, strong, surface, economical) and symptom-based diagnosis (warping, stringing, elephant foot, nozzle collisions…).

  • Non-destructive part edits. Builds Bambu project 3MF files with negative parts, modifiers and support blockers/enforcers, exactly the way Bambu Studio stores them, with no geometry engine involved.

  • User presets that show up in the GUI. Writes to the user profile folder only; system presets are never touched.

Unofficial. Not affiliated with, endorsed or sponsored by Bambu Lab. Tool descriptions and messages are in English. bambu_diagnose and bambu_plan_settings also match symptoms and goals written in Chinese (e.g. 翹邊, 省時).

Contents

Related MCP server: CAD to Print MCP

Quick start

Requires Node.js 22 or newer. Slicing needs Bambu Studio installed locally; the parameter and model tools work without it.

Claude Code:

claude mcp add slicewise \
  -e BAMBU_MODEL_DIR="$HOME/Desktop/bambu-work" \
  -e BAMBU_OUTPUT_DIR="$HOME/Desktop/bambu-work/out" \
  -- npx -y @gjlmotea/slicewise-mcp

Other clients (Codex, Gemini CLI, Cursor, Claude Desktop…):

{
  "mcpServers": {
    "slicewise": {
      "command": "npx",
      "args": ["-y", "@gjlmotea/slicewise-mcp"],
      "env": {
        "BAMBU_MODEL_DIR": "/Users/you/Desktop/bambu-work",
        "BAMBU_OUTPUT_DIR": "/Users/you/Desktop/bambu-work/out"
      }
    }
  }
}

Then ask the agent to call bambu_get_status: it shows the Bambu Studio data folder, whether the slicer was found, preset counts, the printer and filament currently selected in Studio, and the folders the model tools may read.

macOS privacy note. macOS restricts access to ~/Desktop, ~/Documents and ~/Downloads. If a model tool returns EPERM, grant the MCP host (the actual executable, e.g. the claude CLI rather than the Claude desktop app) access in System Settings and restart it, or point BAMBU_MODEL_DIR at an unrestricted folder.

Tools

16 tools, all prefixed bambu_.

Area

Tool

What it does

Parameters

bambu_plan_settings

Before printing: state a goal (safe, fast, strong, surface, economical) and get settings grouped by the failure they prevent, adjusted for the model's geometry when one is given

bambu_optimize_print_in_place

Creates a conservative user process preset for print-in-place parts (slow first layer, capped outer-wall speed, overhang slowdown, no auto brim unless asked)

bambu_describe_parameters

Meaning, unit, range, cost of raising or lowering, related settings

bambu_diagnose

After printing: from a symptom to an ordered list of fixes, one change at a time

bambu_resolve_preset

Flattens a preset and shows which layer each value came from

bambu_compare_presets

Differences between two flattened presets

bambu_list_presets

Selectable presets (abstract parents and G-code template entries filtered out)

bambu_save_user_preset

Writes a user preset that appears in Studio after a restart

Slicing

bambu_slice

Flatten, slice, report layers, time and filament (per colour for multi-colour), and audit every override

Models

bambu_inspect_model

STL, 3MF or OBJ geometry: triangles, bounds, volume, area, closed mesh, parts

bambu_check_printability

Size, floating parts, non-manifold, overhangs, footprint, aspect ratio, thin features, warping

bambu_measure_clearance

Minimum gap between parts of a 3MF or OBJ, with compensation advice

bambu_compose_model

Builds a Bambu project 3MF with negative, modifier and support-control parts

bambu_inspect_project

Reads back the objects and parts of any Bambu project 3MF

Search

bambu_search_models

Thingiverse through its official API; MakerWorld and Printables as search links only

Status

bambu_get_status

Data folder, slicer, presets, current selection, allowed folders

Why flattening matters

Bambu Lab's stock presets are four-level inheritance chains. The leaf declares a few dozen keys and inherits the rest:

0.20mm Standard @BBL X1C  <-  fdm_process_single_0.20  <-  fdm_process_single_common  <-  fdm_process_common

When a leaf preset is passed to the CLI with --load-settings, inherits is not resolved. Only the leaf's own keys apply; everything else falls back to the executable's built-in defaults, which are not Bambu Lab's stock values. Measured on an X1 Carbon 0.4 nozzle, 0.20mm Standard, Bambu PLA Basic, 20 mm cube:

Setting

Raw preset

Flattened

sparse_infill_density

20% (built-in default)

15% (stock preset)

top_shell_layers

4

5

elefant_foot_compensation

0

0.15

enable_arc_fitting

0

1

brim_width

0

5

Print time

10m 11s

8m 45s

This is the cause of bambulab/BambuStudio#1704 (CLI and GUI slicing differ).

Two more traps are handled:

  • Printer G-code lives outside the preset. Since Studio 02.07, start, filament-change, layer-change and end G-code are registered separately in system/BBL.json as <preset> template <key> entries. Following inherits alone ends at a generic start sequence that matches no Bambu printer. Slicewise applies the templates layer by layer; on a P2S 0.4 the resulting G-code is byte-identical to the GUI's.

  • The CLI can turn the prime tower off. When every loaded filament preset has the same name (five slots of Generic PLA in different colours), the CLI decides they are one spool and disables the prime tower. Slicewise passes the project's own filament colours in that case. On a four-colour P2S plate, flattening alone gave 40.10 g / 2h 6m with no prime tower and generic G-code; with the templates and colours applied the result was 43.68 g / 2h 18m, matching the GUI exactly.

Floating-part detection

A real case: a birthday-cake topper built from boxes in Tinkercad. The legs ended at z = 50 mm and the body started at z = 51 mm. Bambu Studio reports "Levitating objects cannot be printed without supports", but enabling supports is the wrong fix: the support fills the 1 mm gap and the legs snap off when it is removed. Bounding boxes and overhang angles look fine; what matters is connectivity.

bambu_check_printability therefore:

  1. Splits the geometry into shells by shared vertices (works on STL soups too); negative parts, modifiers and support blockers/enforcers are not solid.

  2. Merges shells whose surfaces touch or interpenetrate into bodies.

  3. Merges bodies fully enclosed by another shell, using a per-shell ray-parity test (counting crossings over a whole body of overlapping shells gives odd + odd = even and a false "outside").

  4. Reports each body that does not reach the bed: its lift, the body it should probably join (grounded bodies first) and the gap.

Gaps of 2 mm or less are flagged as a likely modelling seam: fix the model with some overlap instead of adding supports. This is a rule of thumb, not a certainty: intentional print-in-place clearances (captive balls, hinges) land in the same range, so the report asks you to confirm the design intent. Wider gaps are real overhangs that need support.

Non-destructive part edits

Bambu Studio's negative parts, modifiers and support controls are not mesh edits. They are extra parts with a subtype label in the 3MF:

<part id="2" subtype="negative_part">
  <metadata key="name" value="hole"/>
</part>

So bambu_compose_model needs no boolean engine and no GUI automation. It accepts exactly five subtypes, taken from ModelVolume::type_to_string() in Bambu Studio's source: normal_part, negative_part, modifier_part, support_blocker, support_enforcer. The list is closed on purpose. Studio's reader silently treats an unknown string as a solid part, so a one-letter typo turns "cut this away" into "add this as solid" with no error. Measured on a 20 mm cube with the same body on top: no part, 20.00 mm tall; negative_part, 15.00 mm; normal_part, 25.00 mm.

Configuration

Variable

Default

Meaning

BAMBU_MODEL_DIR

unset

Folders the model tools may read, joined with the platform path delimiter. Model tools refuse every path when unset

BAMBU_OUTPUT_DIR

unset

Where sliced and composed 3MF files go (also readable). Slicing and composing refuse to run when unset

BAMBU_STUDIO_PATH

per platform

Bambu Studio executable

BAMBU_DATA_DIR

per platform

Bambu Studio data folder (system and user presets)

BAMBU_SLICE_TIMEOUT_MS

300000

Timeout for one slice

THINGIVERSE_TOKEN

unset

Thingiverse app token; without it, search returns links only

Platform

Data folder

Executable

macOS

~/Library/Application Support/BambuStudio

/Applications/BambuStudio.app/Contents/MacOS/BambuStudio

Windows

%APPDATA%\BambuStudio

%ProgramFiles%\Bambu Studio\bambu-studio.exe

Linux

~/.config/BambuStudio

~/.local/bin/bambu-studio

Boundaries

  • No printer control. Physical machines are irreversible and can be dangerous, so it is deliberately out of scope. Use a printer-control MCP alongside this one if you need that.

  • Reads only allowed folders. Paths outside BAMBU_MODEL_DIR (and the output folder) are refused, including .. traversal and same-prefix neighbours (/models-evil does not pass a check for /models).

  • Writes only the user profile folder and the output folder. System presets are never written; an existing user preset with the same name is never silently overwritten.

  • No browser automation dressed up as an API. MakerWorld and Printables have no official public API, so they get search links, not scraped results.

  • No guessing. bambu_diagnose says so when a symptom is unknown and lists the ones it knows, because a wrong guess can make things worse.

  • No destructive geometry. Boolean results are left to the slicer; computing new meshes (merges, cuts, embossed text) belongs in Blender or OpenSCAD.

  • Clearance needs part boundaries. bambu_measure_clearance reads 3MF and OBJ; an STL is one undivided soup of triangles, and the tool says so instead of returning an empty report.

  • Existing projects are read, not rewritten. bambu_inspect_project reads any Bambu project 3MF; bambu_compose_model always writes a new file.

Support matrix

Status

macOS + Bambu Studio 02.07

Verified on real hardware, including GUI comparison and end-to-end slicing

Stock presets

Tested with X1C, P1S and P2S 0.4 nozzle presets

Windows, Linux

Default paths implemented, not yet verified on a real install

Multi-nozzle printers (H2D…)

Not verified; per-nozzle settings are arrays, so check them with bambu_resolve_preset before overriding

Bug reports with your OS, Studio version and printer are welcome.

Development

pnpm install
pnpm verify   # typecheck, 226 tests, build, stdio smoke test

The smoke test uses a fixture data folder, so it runs without Bambu Studio (including in CI). node scripts/verify-real-slicer.mjs runs the real slicer end to end and is deliberately not part of verify.

src/
  domain/        pure logic: preset flattening, parameter knowledge, slicing audit, model geometry, 3MF
  ports/         PresetStore, Slicer, ModelCatalog
  adapters/      Bambu Studio CLI, preset store, Thingiverse, hand-off catalogs
  application/   BambuService
  server/        tool registration and schemas

The ZIP reader and writer, STL and OBJ parsers and 3MF builder are hand-written; the only runtime dependencies are the MCP SDK and zod.

Updating the key baseline

src/domain/parameters/known-keys.ts is generated: the 568 setting keys of a flattened Bambu Studio configuration, used to catch typos in overrides (Bambu Studio silently ignores unknown keys). Regenerate it when a Bambu Studio release adds parameters:

node scripts/verify-real-slicer.mjs   # writes a .gcode.3mf
# take the key list from Metadata/project_settings.config in that file and overwrite known-keys.ts

It is not every key of every printer: multi-nozzle and other models may have extra keys, so an unknown key is reported as a warning, not an error.

License and trademarks

MIT. Bambu Lab, Bambu Studio and MakerWorld are trademarks of Bambu Lab. Thingiverse and Printables are trademarks of their respective owners. This project is not affiliated with or endorsed by any of them. It runs Bambu Studio's command-line interface as a separate process and contains no Bambu Studio (AGPL-3.0) code.

Available Tools

16 tools
bambu_check_printabilityCheck printabilityA
Read-onlyIdempotent

Finds problems visible before slicing: exceeding the build volume, floating bodies that do not touch the plate, an unclosed mesh, the share of steep overhangs, too small a base area, too high an aspect ratio, features that are too thin, and warping risk on large bottom surfaces. Each finding lists the related parameters. Floating detection splits the mesh into shells, merges shells that touch or intersect into bodies, merges shells fully enclosed by another body into it, then checks whether each body reaches the plate and measures the gap to the nearest body: a narrow gap means the parts were not joined in the model (turning on support would make them print as separate pieces); only a wide gap really needs support. Accepts STL, 3MF and OBJ. This is geometric analysis, not a slicing simulation; thin walls inside the model only show up when actually sliced. No side effects.

Inputs: modelPath (required), buildVolume, lineWidthMm, overhangThresholdDegrees. Returns: findings, inspection, buildVolume, floatingBodies, +2 more

bambu_compare_presetsCompare two presetsA
Read-onlyIdempotent

Flattens two presets of the same kind and lists the settings that differ. Use it to answer questions like "what exactly is the difference between 0.20 Standard and 0.20 Strength" without reading four levels of JSON by hand. No side effects.

Inputs: kind (required), left (required), right (required), limit. Returns: left, right, differences, differenceCount

bambu_compose_modelCompose a 3MF with negative / modifier partsA
Idempotent

Builds a Bambu project 3MF from a base body STL plus extra parts. A negative part (negative_part) cuts away where it overlaps, a modifier (modifier_part) applies different settings to its region, and support_blocker / support_enforcer control support. In a Bambu model each of these is just one more part with a label, so no geometry (boolean) engine is needed. The output can be read back item by item with bambu_inspect_project, or passed straight to bambu_slice. Writes a file to the output directory.

Inputs: name (required), parts (required), basePath (required), baseName, +1 more. Returns: parts, nextStep, warnings, byteLength, +1 more

bambu_describe_parametersExplain parameters and their trade-offsA
Read-onlyIdempotent

Explains what a parameter does, its unit, its typical range, the cost of raising or lowering it, and related parameters. Call this before changing any parameter, instead of tuning by what merely sounds reasonable. No side effects.

Inputs: keys, group. Returns: specs, unknown

bambu_diagnoseDiagnose a print failure from its symptomA
Read-onlyIdempotent

Takes an observed symptom (warping, stringing, layer separation, elephant's foot, holes in the top surface, ...) and returns an ordered list of remedies, each with its mechanism, a suggested value and its cost. Use it when the user describes what went wrong rather than which parameter to change; apply one remedy at a time. If no known symptom matches, it says so instead of guessing. It also points out problems that no parameter can fix. No side effects.

Inputs: symptom, material, symptomId. Returns: note, matched, available

bambu_get_statusGet Bambu Studio companion statusA
Read-onlyIdempotent

Reports the BambuStudio data directory, whether the slicer executable is available, preset counts, the machine and filaments currently selected in Studio, the allowed model directories, and the integration level of each model platform. Use it first to see what this server can do on this machine. No side effects.

Inputs: no named parameters. Returns: dataDir, version, catalogs, profileId, +7 more

bambu_inspect_modelInspect model geometryA
Read-onlyIdempotent

Parses an STL (binary or ASCII), 3MF or OBJ and reports triangle count, bounding box, volume, surface area, and whether the mesh is closed. The format is detected from the file content, not the extension. For 3MF and OBJ it also reports the part count and part list (3MF coordinates have the placement transform applied; OBJ is split into parts by o / g, and Tinkercad's colour export is OBJ). Reads only files inside the allowed directories. No side effects.

Inputs: modelPath (required). Returns: parts, closed, format, openEdges, +6 more

bambu_inspect_projectRead back the part structure of a 3MFA
Read-onlyIdempotent

Reads the objects and parts from a Bambu project 3MF, including each part's subtype and per-part settings. Use it to verify that what was written is really in the file; this is the key advantage of working with files over the GUI: you can compare item by item instead of only looking at the screen. It also flags subtypes that BambuStudio does not recognise. No side effects.

Inputs: projectPath (required). Returns: objects

bambu_list_presetsList presetsA
Read-onlyIdempotent

Lists machine, process or filament presets. By default only presets selectable in the UI are returned; intermediate presets that exist only to be inherited from (e.g. fdm_process_common) are filtered out. Names listed here do not show real setting values; use bambu_resolve_preset for that. No side effects.

Inputs: kind (required), limit, search, includeAbstract. Returns: kind, total, entries, returned

bambu_measure_clearanceMeasure clearance between partsA
Read-onlyIdempotent

Measures the smallest clearance between the parts in a 3MF or OBJ, to judge whether a print-in-place mechanism will fuse when printed. Parts that touch each other are first merged into rigid bodies before comparing, because Bambu also stores the colour-change segments of a single solid as separate parts; without merging, one piece would be reported as "clearance 0". When the clearance is too small it suggests compensation, distinguishing outer contours from holes (the enclosed side is a hole to the slicer and is controlled by a different parameter). STL has no part boundaries, so it cannot be measured. No side effects.

Inputs: modelPath (required), samplingMm, reportThresholdMm, minimumClearanceMm. Returns: pairs, bodies, format, findings, +4 more

bambu_optimize_print_in_placeCreate a stabilised print-in-place presetA
Destructive

Creates an auto-stabilised copy of the given (or currently selected) process preset that can be used directly in Bambu Studio. Use it when small print-in-place parts detach from the bed or get dragged off by the nozzle. It applies exactly: first-layer outer wall 20 mm/s, first-layer infill 30 mm/s, outer wall capped at 60 mm/s, slowdown for overhangs, avoid crossing printed walls, Monotonic line, and ironing and Fuzzy Skin turned off. If the source is an existing user preset, its leaf-level calibrations (dimensions, elephant's foot, etc.) are kept, but the new file still inherits directly from the system preset. By default Auto Brim is explicitly turned off so the brim does not fuse gear clearances; Brim Ears can be requested explicitly, and you will still be reminded to check the first layer. It does not change filament temperature, cooling or flow, because regular PLA and Silk PLA must be calibrated separately. Writes a file to the user profile directory; takes effect after Bambu Studio is restarted.

Inputs: name, overwrite, processPreset, includeBrimEars. Returns: name, path, changes, created, +8 more

bambu_plan_settingsPlan settings for a goalA
Read-onlyIdempotent

Given what you want (safe and failure-free / fast / strong under load / good surface / economical), returns ordered parameter adjustments grouped by what they counter: adhesion and warping, nozzle collisions, surface quality, structural strength, time, filament. Each move includes its mechanism, a suggested value, its cost, and the actual value in the current preset and its shape (per-extruder parameters must be overridden with an array; a scalar is silently not applied). If modelPath is given, a printability analysis runs first and conditional adjustments are added based on the geometry. This is for planning before a print; to work back from a print that already failed, use bambu_diagnose. It only returns a plan and changes nothing. No side effects.

Inputs: goal, goalId, material, modelPath, +2 more. Returns: goal, note, moves, available, +1 more

bambu_resolve_presetFlatten a preset inheritance chainA
Read-onlyIdempotent

Flattens a preset's inherits chain into the complete settings and records which level each value comes from. A BambuStudio leaf preset usually declares only a few dozen keys and inherits everything else from its parents, so to know the real value of any parameter you must look at the flattened result, not the leaf preset file. Use this whenever you need an actual setting value. No side effects.

Inputs: kind (required), name (required), keys. Returns: kind, name, origin, settings, +3 more

bambu_save_user_presetSave a user preset to Bambu StudioA

Creates a custom preset that inherits from a system preset, in the BambuStudio user profile directory; it appears in the dropdown after Bambu Studio is restarted. BambuStudio has no plugin API (see bambulab/BambuStudio#9614), so this is the only way to get parameters tuned by an AI into the GUI. Writes a file; an existing preset with the same name is never silently overwritten.

Inputs: kind (required), name (required), inherits (required), overrides (required), +1 more. Returns: path, created, nextStep, warnings, +1 more

bambu_search_modelsSearch for 3D modelsA
Read-onlyIdempotent

Searches for models across platforms. Thingiverse uses its official API (requires THINGIVERSE_TOKEN). MakerWorld and Printables have no official public API, so for them only a search link is returned for a person to open; this is a deliberate downgrade: no scraping or private endpoints pretending to be an API. Do not claim to have searched or downloaded models from those platforms. Does not download any model. Accesses the internet.

Inputs: query (required), limit, sources. Returns: query, results

bambu_sliceSlice (after flattening the inheritance chain)A
Idempotent

Slices with the BambuStudio CLI and reports real statistics: layer count, print time, filament weight. Presets are flattened before they are passed to the CLI; feeding the raw presets to the CLI makes every inherited parameter fall back to the built-in default (BambuStudio#1704), so do not call the CLI directly. After slicing, it reads the settings that actually took effect back from the output and audits each override you requested; an overrideAudit entry with honoured = false was not applied. Starts a child process and writes a .gcode.3mf to the configured output directory. It does not send anything to a printer or start a print.

Inputs: modelPath (required), plate, overrides, placement, +4 more. Returns: ok, stats, reason, warnings, +4 more

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 16 tools

    Disambiguation5/5

    Every tool targets a distinct operation: status, preset listing/flattening/diffing, parameter explanation, symptom diagnosis, goal planning, preset creation, slicing, mesh inspection, printability checking, clearance measuring, 3MF composition, project inspection, and online model search. The potentially overlapping pairs (diagnose vs plan_settings, inspect_model vs check_printability, optimize_print_in_place vs save_user_preset) are explicitly differentiated in their descriptions, e.g. 'forward planning' vs 'work back from a failed print'.

    Naming Consistency4/5

    All tools use the same bambu_ prefix and snake_case, and almost all follow a verb_noun pattern (get_status, list_presets, resolve_preset, compare_presets, inspect_model, check_printability, etc.). Minor deviations are the bare verbs bambu_diagnose and bambu_slice, which lack an object noun, but they remain clear in context.

    Tool Count4/5

    At 16 tools the set is slightly above the typical 3-15 sweet spot, but each tool covers a genuinely distinct capability across preset management, diagnosis/planning, slicing, geometry analysis, and model search. No tool appears redundant, so the count is justified by the breadth of the slicer-assistant domain rather than bloat.

    Completeness4/5

    Coverage is strong: environment introspection, full preset lifecycle (list, flatten, compare, describe, create, specialised print-in-place copy), diagnostics, planning, slicing, mesh/project inspection, printability and clearance analysis, and model search. Gaps remain in editing/deleting existing user presets (only creation is supported) and in downloading models from MakerWorld/Printables (deliberately link-only), but these are minor and workable around.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for pre-print QA of Bambu Studio projects, providing tools to inspect models and 3MF files, validate risky settings, create support variants, and open files in Bambu Studio.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables MCP clients to inspect FreeCAD documents and export named solids to STL, find and derive OrcaSlicer presets, preview and run slices with recorded manifests, and then read G-code metadata, query a Moonraker printer, upload G-code, and start an uploaded print as a separate confirmed step.
      15
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables LLM clients to slice, paint, and verify 3D prints through the installed slicer's command line for any installed Bambu printer, nozzle, and filament, with settings per object type. It never sends jobs to a printer.
      11
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      MCP server for BambuStudio slicer: inspect geometry, configure saved projects, and compare slices with Claude Code or Codex.
      19
      2
      AGPL 3.0