Slicewise

io.github.gjlmotea由 GitHub 帳號 gjlmotea 發布v0.1.0更新於 Nov 8, 2026

Pre-print checks for Bambu Studio: GUI-faithful CLI slicing, override audit, printability.

已驗證STDIO僅桌面檔案與儲存開發者工具

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助手在列印前依 Bambu Studio 預設集檢查、切片並稽核 3D 模型。

可以做什麼
  • 檢查模型:幾何統計、可列印性風險、懸空部件、部件間隙,以及讀取 Bambu 專案檔
  • 切片與稽核:展開預設集繼承鏈、呼叫 Bambu Studio 命令列切片、回報層數/時間/耗材,並核對每項覆寫是否生效
  • 預設集操作:列出、展開、比較並儲存使用者預設集,說明參數意義
  • 規劃與診斷:依目標提出設定方案、列印一體件調校,以及從症狀到修正的診斷
  • 產生含負零件、修改器與支撐阻擋/強化的專案 3MF 檔
  • 搜尋 Thingiverse 模型並檢視伺服器狀態
適用情境
當你想在耗用耗材前判斷模型能否列印,或想釐清切片結果為何與圖形介面不一致時使用。適合已在本機安裝 Bambu Studio、需要預設集相關建議與稽核而非印表機控制的使用者。
執行需求
需要 Node.js 22 或更新版本,透過 npx 在本機執行。切片需要本機安裝 Bambu Studio;參數與模型工具不需它即可使用。需設定 BAMBU_MODEL_DIR 才能讀取模型,設定 BAMBU_OUTPUT_DIR 才能切片與產生檔案,否則相關工具會拒絕執行。選用:BAMBU_DATA_DIR、BAMBU_STUDIO_PATH、BAMBU_SLICE_TIMEOUT_MS,以及供 Thingiverse 搜尋使用的 THINGIVERSE_TOKEN。
安裝前請注意
它會寫入檔案:使用者設定資料夾中的使用者預設集,以及輸出資料夾中的切片或產生 3MF;系統預設集不會被更動,同名使用者預設集不會被默默覆寫。THINGIVERSE_TOKEN 是密鑰。它不控制印表機、不上傳也不啟動列印。在 macOS 上可能需要為宿主程式授予資料夾存取權限。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Slicewise,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

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:

bash
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…):

json
{  "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_.

AreaToolWhat it does
Parametersbambu_plan_settingsBefore 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_placeCreates 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_parametersMeaning, unit, range, cost of raising or lowering, related settings
bambu_diagnoseAfter printing: from a symptom to an ordered list of fixes, one change at a time
bambu_resolve_presetFlattens a preset and shows which layer each value came from
bambu_compare_presetsDifferences between two flattened presets
bambu_list_presetsSelectable presets (abstract parents and G-code template entries filtered out)
bambu_save_user_presetWrites a user preset that appears in Studio after a restart
Slicingbambu_sliceFlatten, slice, report layers, time and filament (per colour for multi-colour), and audit every override
Modelsbambu_inspect_modelSTL, 3MF or OBJ geometry: triangles, bounds, volume, area, closed mesh, parts
bambu_check_printabilitySize, floating parts, non-manifold, overhangs, footprint, aspect ratio, thin features, warping
bambu_measure_clearanceMinimum gap between parts of a 3MF or OBJ, with compensation advice
bambu_compose_modelBuilds a Bambu project 3MF with negative, modifier and support-control parts
bambu_inspect_projectReads back the objects and parts of any Bambu project 3MF
Searchbambu_search_modelsThingiverse through its official API; MakerWorld and Printables as search links only
Statusbambu_get_statusData 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:

SettingRaw presetFlattened
sparse_infill_density20% (built-in default)15% (stock preset)
top_shell_layers45
elefant_foot_compensation00.15
enable_arc_fitting01
brim_width05
Print time10m 11s8m 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:

xml
<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

VariableDefaultMeaning
BAMBU_MODEL_DIRunsetFolders the model tools may read, joined with the platform path delimiter. Model tools refuse every path when unset
BAMBU_OUTPUT_DIRunsetWhere sliced and composed 3MF files go (also readable). Slicing and composing refuse to run when unset
BAMBU_STUDIO_PATHper platformBambu Studio executable
BAMBU_DATA_DIRper platformBambu Studio data folder (system and user presets)
BAMBU_SLICE_TIMEOUT_MS300000Timeout for one slice
THINGIVERSE_TOKENunsetThingiverse app token; without it, search returns links only
PlatformData folderExecutable
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.07Verified on real hardware, including GUI comparison and end-to-end slicing
Stock presetsTested with X1C, P1S and P2S 0.4 nozzle presets
Windows, LinuxDefault 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

bash
pnpm installpnpm 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:

bash
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.

來源:README.md,提交 b324cf3

工具

16

bambu_get_status

Get Bambu Studio companion status

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.

無需輸入參數。

bambu_list_presets

List presets

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.

輸入參數kind必填limitsearchincludeAbstract

bambu_resolve_preset

Flatten a preset inheritance chain

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.

輸入參數keyskind必填name必填

bambu_compare_presets

Compare two presets

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.

輸入參數kind必填left必填limitright必填

bambu_describe_parameters

Explain parameters and their trade-offs

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.

輸入參數keysgroup

bambu_diagnose

Diagnose a print failure from its symptom

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.

輸入參數symptommaterialsymptomId

bambu_plan_settings

Plan settings for a goal

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.

輸入參數goalgoalIdmaterialmodelPathprocessPresetfilamentPreset

bambu_optimize_print_in_place

Create a stabilised print-in-place preset

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.

輸入參數nameoverwriteprocessPresetincludeBrimEars

bambu_save_user_preset

Save a user preset to Bambu Studio

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.

輸入參數kind必填name必填inherits必填overrides必填overwrite

bambu_slice

Slice (after flattening the inheritance chain)

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.

輸入參數platemodelPath必填overridesplacementmachinePresetprocessPresetreportSettingsfilamentPresets

bambu_inspect_model

Inspect model geometry

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.

輸入參數modelPath必填

bambu_check_printability

Check printability

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.

輸入參數modelPath必填buildVolumelineWidthMmoverhangThresholdDegrees

bambu_measure_clearance

Measure clearance between parts

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.

輸入參數modelPath必填samplingMmreportThresholdMmminimumClearanceMm

bambu_compose_model

Compose a 3MF with negative / modifier parts

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.

輸入參數name必填parts必填baseNamebasePath必填plateCentre

bambu_inspect_project

Read back the part structure of a 3MF

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.

輸入參數projectPath必填

bambu_search_models

Search for 3D models

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.

輸入參數limitquery必填sources

版本歷史

1
  1. v0.1.0最新Nov 8, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分