Slicewise — pre-print decision and audit MCP server for Bambu Studio
English | 繁體中文
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
Quick start
Requires Node.js 22 or newer. Slicing needs Bambu Studio installed locally; the parameter and model tools work without it.
Claude Code:
Other clients (Codex, Gemini CLI, Cursor, Claude Desktop…):
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_.
Why flattening matters
Bambu Lab's stock presets are four-level inheritance chains. The leaf declares a few dozen keys and inherits the rest:
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:
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:
- Splits the geometry into shells by shared vertices (works on STL soups too); negative parts, modifiers and support blockers/enforcers are not solid.
- Merges shells whose surfaces touch or interpenetrate into bodies.
- 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").
- 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:
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
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
Bug reports with your OS, Studio version and printer are welcome.
Development
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.
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:
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.