bambu-printer-mcp 1.1.11 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CONTRIBUTORS.md CHANGED
@@ -6,6 +6,8 @@ Thank you to everyone who builds, tests, reports problems, and shares real print
6
6
 
7
7
  | Contributor | Contribution |
8
8
  | --- | --- |
9
+ | [Boardy (@boardyai)](https://x.com/boardyai) | Raises the nozzle-verification question that informs the added printer safety checks. |
10
+ | Fable red-team review, shared by David Montgomery | Supplies archive-ambiguity reproductions and hardware-safety review findings used for plate binding, upload checks, temperature policy, and human preflight. Network/security suggestions remain outside this hardware-safety release. |
9
11
  | [Sebastian (sebas1986)](https://github.com/sebas1986) | Isolates the multi-filament CLI crash with real BambuStudio bisection, contributes per-slot colours and multi-nozzle prime-tower placement, and verifies X2D identification, status, and slicing in [#18](https://github.com/DMontgomery40/bambu-printer-mcp/pull/18). Direct X2D printing remains deferred pending the native transport. |
10
12
  | [Stenslaen](https://github.com/Stenslaen) | Traces the delayed H2 crash to OTA model detection, documents a multi-day workaround, and reports unexpected state-transition crashes in [#7](https://github.com/DMontgomery40/bambu-printer-mcp/issues/7). |
11
13
  | [Alejandro Oñate (alexol91)](https://github.com/alexol91) | Reports the missing machine-template G-code and multi-filament override problems in [#12](https://github.com/DMontgomery40/bambu-printer-mcp/issues/12), with measured output and a proposed fix in [#13](https://github.com/DMontgomery40/bambu-printer-mcp/pull/13). |
@@ -19,7 +21,7 @@ Thank you to everyone who builds, tests, reports problems, and shares real print
19
21
 
20
22
  Thank you also to the existing contributors whose work the project builds on:
21
23
 
22
- - [David Montgomery (DMontgomery40)](https://github.com/DMontgomery40) — project maintainer; flags the FULU/Orca missing-machine-preset safety gap during article review, prompting the 1.1.11 fix.
24
+ - [David Montgomery (DMontgomery40)](https://github.com/DMontgomery40) — project maintainer; contributes the printer-profile, temperature, and hardware-safety reports informing the shared slicing and print checks.
23
25
  - [rowbotik](https://github.com/rowbotik) — printer, AMS, slicing, and operational work across the existing release history.
24
26
  - [len-foss](https://github.com/len-foss) — project code contribution.
25
27
  - [thebitrock](https://github.com/thebitrock) — project code contribution.
package/README.md CHANGED
@@ -13,6 +13,8 @@
13
13
 
14
14
  A Bambu Lab-focused MCP server for controlling Bambu printers, manipulating STL files, and managing end-to-end 3MF print workflows from Claude Desktop, Claude Code, or any MCP-compatible client.
15
15
 
16
+ **[Browse the documentation site](https://dmontgomery40.github.io/bambu-printer-mcp/)** for searchable setup guides, slicing and AMS guidance, and the full tool reference. It is generated from this README and the docs folder.
17
+
16
18
  Built with help from our [contributors](./CONTRIBUTORS.md). Huge thanks to everyone sharing fixes, careful bug reports, and real printer testing!
17
19
 
18
20
  This is a stripped-down, Bambu-only fork of [mcp-3D-printer-server](https://github.com/DMontgomery40/mcp-3D-printer-server). All OctoPrint, Klipper, Duet, Repetier, Prusa Connect, and Creality Cloud support has been removed. What remains is a focused, lean implementation for Bambu Lab hardware.
@@ -60,6 +62,43 @@ worked and whether I need to restart or reload the harness.
60
62
 
61
63
  [Setup reference](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SETUP.md) · [FULU guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md) · [Optional code mode](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SETUP.md#optional-code-mode)
62
64
 
65
+ ## What to ask your agent
66
+
67
+ Ask for the result you want, not the steps. Current models plan across tools: they search the web, read photos, look up exact dimensions, edit models, slice, and print. Expect a question or two when a choice matters, such as which filament to use or whether to start the print.
68
+
69
+ This server provides the printer, slicing, AMS, and mesh tools. Web search, photos, and Blender edits come from your agent and its other connections, such as a [Blender MCP server](#blender-mcp). Printing a model your agent edited uses CLI slicing with your installed slicer presets; see the [slicing guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md).
70
+
71
+ ### Start from anything
72
+
73
+ - **"Here's a phone stand on MakerWorld. Make it fit the new iPhone and print it in black."**\
74
+ Your agent looks up Apple's published dimensions, adjusts the stand in Blender, slices it for your printer, and finds the AMS tray with black filament.
75
+ - **"I want one of these."** *(with a photo of a planter you saw at a café)*\
76
+ It works out the shape and size from the photo, finds or models a matching design, and asks about anything the photo can't show.
77
+ - **"Can you print a replacement?"** *(with a photo of a snapped dishwasher rack clip)*\
78
+ It asks for a measurement or two where the fit matters, models the part, and prints it in a loaded material that suits the job.
79
+
80
+ ### From anywhere, while it prints
81
+
82
+ If your agent is always on, such as OpenClaw or Hermes Agent running on a computer at home, message it from Telegram or any other chat app. For direct LAN printing, the server runs on the printer's local network; you don't have to.
83
+
84
+ - **"How's the print going? Send me a picture."**\
85
+ It reports progress and time remaining, and sends a snapshot from the chamber camera.
86
+ - **"The corner is lifting. Pause it."**\
87
+ It pauses the job so you can decide whether to resume or cancel.
88
+ - **"One of the parts came loose. Skip it and keep printing the rest."**\
89
+ It finds that object on the plate and skips only that one.
90
+ - **"Start drying the PETG so it's ready when I get home."**\
91
+ On a heated AMS, it starts the drying cycle for the unit holding that spool.
92
+
93
+ ### Before you print
94
+
95
+ - **"Take a picture and make sure the bed is clear, then start the bracket I sliced last night."**\
96
+ It checks the camera image before it sends the job.
97
+ - **"What's loaded in the AMS? Print this in whatever black I have."**\
98
+ It reads the live AMS inventory and matches the file's filaments to your trays.
99
+ - **"Are there any errors on the printer?"**\
100
+ It reads the printer's HMS diagnostics and explains them.
101
+
63
102
  <details>
64
103
  <summary><strong>Start here</strong></summary>
65
104
 
@@ -69,6 +108,7 @@ worked and whether I need to restart or reload the harness.
69
108
  |---|---|
70
109
  | Use open-source slicing and a cloud-free print workflow | [FULU setup: slicer, LAN, and optional bridge](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md) |
71
110
  | Connect this MCP to my agent | [Copy the setup request](#set-up-with-your-agent) |
111
+ | See what my agent can do with it | [What to ask your agent](#what-to-ask-your-agent) |
72
112
  | Troubleshoot setup or configure it manually | [Installation, environment variables, and LAN reference](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SETUP.md) |
73
113
  | Prepare a printable file or troubleshoot slicing | [Slicing guide and model routing](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md) |
74
114
  | Choose filament trays or inspect a printer | [AMS setup](#ams-automatic-material-system-setup) and [printer tools](#printer-control-tools) |
@@ -96,6 +136,7 @@ See the [changelog](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main
96
136
  - [FULU and open-source printing](#fulu-and-open-source-printing)
97
137
  - [Features](#features)
98
138
  - [Set up with your agent](#set-up-with-your-agent)
139
+ - [What to ask your agent](#what-to-ask-your-agent)
99
140
  - [AMS (Automatic Material System) Setup](#ams-automatic-material-system-setup)
100
141
  - [Bambu Communication Notes (MQTT and FTP)](#bambu-communication-notes-mqtt-and-ftp)
101
142
  - [What this fork fixes](#what-this-fork-fixes)
@@ -106,7 +147,6 @@ See the [changelog](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main
106
147
  - [Slicing Tools](#slicing-tools)
107
148
  - [Advanced Tools](#advanced-tools)
108
149
  - [Available Resources](#available-resources)
109
- - [Example Commands for Claude](#example-commands-for-claude)
110
150
  - [Bambu Lab Printer Limitations](#bambu-lab-printer-limitations)
111
151
  - [General Limitations and Considerations](#general-limitations-and-considerations)
112
152
  - [Memory usage](#memory-usage)
@@ -154,7 +194,7 @@ The optional FULU **BambuNetwork bridge** exposes `bambu_network_bridge_status`,
154
194
  - Query live AMS inventory with resolved Bambu/Orca filament profile paths via `get_printer_filaments`. Includes per-tray display names, match confidence (`high`/`medium`/`low`/`none`), resolution tier (`exact-model-nozzle`/`model`/`generic`/`unresolved`), and a summary with recommended auto-slice filament. Retries automatically when AMS data hasn't arrived yet (common on first MQTT push from idle printers).
155
195
  - List, upload, and delete files on the printer's SD card via FTPS
156
196
  - Capture a JPEG snapshot from the chamber camera. Supports A1, A1 mini, P1S, P1P (TCP-on-6000), and X1, X1C, X1E, P2S, H2, H2S, H2D, H2C, H2D Pro, X2D (RTSP via ffmpeg). Requires ffmpeg in PATH for the RTSP path.
157
- - Upload and print pre-sliced `.gcode.3mf` files with full plate selection and calibration flag control (recommended path — see [slicing guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md))
197
+ - Upload and print pre-sliced `.3mf` projects with checked plate selection and calibration flags. Legacy `.gcode.3mf` routes require a single external-spool-only plate; see the [slicing guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md).
158
198
  - Slice through BambuStudio CLI with automatic BBL inheritance/include resolution, per-slot filament colours, and fallback prime-tower placement for multi-nozzle printers. Missing dependencies stop the slice; custom settings and saved project tower positions are preserved. Multi-colour slicing is verified by the contributor on BambuStudio 02.08.02.60 for Windows; older CLI versions have separate limitations. See [slicing guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md).
159
199
  - Recognize X2D status and slice with its own installed BambuStudio preset (`BAMBU_MODEL=x2d`). **Direct X2D printing is not supported yet**: the internal eMMC transport is pending. These print requests stop before slicing, uploading, or issuing printer commands. Print exported projects through a supported slicer instead.
160
200
  - Parse AMS mapping from the 3MF's embedded slicer metadata (`Metadata/plate_<n>.json` + gcode filament header) and send it correctly formatted per the OpenBambuAPI spec, with correct H2S/H2D/H2C `ams_mapping2` parallel array format
@@ -164,6 +204,7 @@ The optional FULU **BambuNetwork bridge** exposes `bambu_network_bridge_status`,
164
204
  - Set print speed mode (`silent`/`standard`/`sport`/`ludicrous`), clear HMS/print errors, trigger AMS RFID re-read, and control H2/P2 airduct mode (`cooling`/`heating`) via MQTT
165
205
  - **Start/stop AMS filament drying** (`set_ams_drying`) on heated AMS units (AMS Pro / AMS-HT). Sends `print.ams_control` MQTT command.
166
206
  - Set nozzle and bed temperature via G-code dispatch over MQTT
207
+ - Confirm print starts and positive manual heating through a human preflight prompt. Finished-bed clearance and hardware-error clearing require explicit human acknowledgment; see [hardware safety and headless configuration](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md).
167
208
  - Set fan speed (part, auxiliary, chamber) and chamber light mode (on/off/flashing) via MQTT
168
209
  - Read HMS (Health Management System) diagnostics as an MCP resource at `printer://{host}/hms` — read-only error summary from the printer, with automatic settle retry
169
210
  - Start G-code files already stored on the printer
@@ -752,12 +793,17 @@ Trigger a Bambu AMS RFID re-read for one AMS slot. This can move AMS filament; u
752
793
 
753
794
  #### set_temperature
754
795
 
755
- Set the target temperature for the bed or nozzle. Dispatches an M140 (bed) or M104 (nozzle) G-code command via MQTT. Valid range is 0 to 300 degrees Celsius. Accepted values for `component` are `bed`, `nozzle`, `extruder`, `tool`, and `tool0`.
796
+ Set a checked target temperature for the bed or nozzle through MQTT. Positive targets require the printer model and fresh matching printer telemetry; nozzle heating also requires the declared loaded `material` and matching `nozzle_diameter` (default 0.4). Independent model/component and material ceilings apply. A target of zero turns the heater off without requiring material or nozzle metadata. Accepted `component` values are `bed`, `nozzle`, `extruder`, `tool`, and `tool0`.
797
+
798
+ Manual nozzle heating checks the reported currently loaded AMS tray or external spool. It refuses ambiguous active-nozzle/material selection on multi-nozzle printers; use a checked sliced job or the printer's own controls there. Stop and heater-off commands cancel pending server print/heating operations. Resuming through MCP requires the same paused job inspected and started by this server instance, with fresh matching telemetry; other paused jobs remain controllable at the printer.
756
799
 
757
800
  ```json
758
801
  {
759
802
  "component": "nozzle",
760
803
  "temperature": 220,
804
+ "bambu_model": "p1s",
805
+ "material": "PLA",
806
+ "nozzle_diameter": 0.4,
761
807
  "host": "192.168.1.100",
762
808
  "bambu_serial": "01P00A123456789",
763
809
  "bambu_token": "your_access_token"
@@ -872,11 +918,11 @@ Inspect the configured FULU bridge without starting it using `{}`. Use `{"connec
872
918
 
873
919
  #### bambu_network_call
874
920
 
875
- Call a runtime method such as `{"method": "net.is_user_login", "payload": {}}`. The default injects the initialized agent; use `with_agent: false` for `bridge.handshake`. Raw methods can mutate runtime or printer state; use the method contract from your installed FULU build.
921
+ Call an allowed read-only probe such as `{"method": "net.is_user_login", "payload": {}}`. The default injects the initialized agent; use `with_agent: false` for `bridge.handshake`. Raw printer mutations and unknown methods are refused; use the dedicated checked print or printer tools.
876
922
 
877
923
  #### print_3mf_bambu_network
878
924
 
879
- Submit a sliced project through FULU's separately configured networking runtime. `connection_type` defaults to `cloud`; LAN bridge jobs also require a printer IP and access code. `bambu_model` and a device ID are required. See [print examples and AMS requirements](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md#print-through-the-bridge). A zero bridge return code confirms submission, not a physical print or direct X2D support.
925
+ Submit a sliced project through FULU's separately configured networking runtime. `connection_type` defaults to `cloud`. Both cloud and LAN bridge jobs require a printer IP, LAN access code, matching serial/device ID, and fresh MQTT safety telemetry. File, raw AMS/nozzle mapping, and extra-option overrides cannot replace checked parameters. See [print examples and AMS requirements](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md#print-through-the-bridge). A zero bridge return code confirms submission, not a physical print or direct X2D support.
880
926
 
881
927
  #### resolve_3mf_ams_slots
882
928
 
@@ -1165,62 +1211,6 @@ Resources follow the MCP resource protocol and can be read by calling `ReadResou
1165
1211
 
1166
1212
  </details>
1167
1213
 
1168
- <details>
1169
- <summary><strong>Example Commands for Claude</strong></summary>
1170
-
1171
- ## Example Commands for Claude
1172
-
1173
- After connecting the MCP server in Claude Desktop or Claude Code, you can ask Claude to perform these operations directly in conversation.
1174
-
1175
- ### Printer status and control
1176
-
1177
- - "What is the current status of my Bambu printer?"
1178
- - "What temperature is the bed at right now?"
1179
- - "Show me the files on my printer's SD card."
1180
- - "Cancel the current print job."
1181
- - "Set the nozzle temperature to 220 degrees."
1182
- - "Set the bed to 65 degrees."
1183
- - "Turn the chamber light on."
1184
- - "Set the chamber fan to 40 percent."
1185
- - "List the object IDs in this sliced 3MF."
1186
- - "Skip object 6495 on the current print."
1187
- - "Start the AMS drying cycle on AMS 0."
1188
- - "Stop drying on AMS 1."
1189
- - "Match the AMS slots for this 3MF against my loaded filaments without printing."
1190
- - "Auto-match AMS slots and print this 3MF."
1191
- - "Take a camera snapshot of the print bed."
1192
- - "Show me the HMS error codes on the printer."
1193
- - "What speed mode is the printer in?"
1194
- - "Set the airduct to cooling mode."
1195
-
1196
- ### Printing 3MF files
1197
-
1198
- - "Print the file at ~/Downloads/bracket.3mf on my Bambu printer."
1199
- - "Upload bracket.3mf to the printer and start printing with AMS slots 0 and 1."
1200
- - "Print my_model.3mf with bed leveling enabled and vibration calibration off."
1201
- - "Upload this 3MF without printing it yet."
1202
- - "Use FULU OrcaSlicer-bambulab to prepare this model, then show me the sliced output before printing."
1203
- - "Probe the FULU BambuNetwork bridge without starting a print."
1204
-
1205
- ### STL manipulation
1206
-
1207
- - "What are the dimensions of this STL file?"
1208
- - "Scale model.stl to twice its current size."
1209
- - "Scale this model so it is 150% as wide but stays the same height."
1210
- - "Rotate this STL 90 degrees around the Z axis."
1211
- - "Extend the base of this model by 3mm so it sticks to the bed better."
1212
- - "Center this model at the origin."
1213
- - "Orient this model so its largest flat face is on the bottom."
1214
- - "Merge any near-duplicate vertices in this STL to clean it up."
1215
-
1216
- ### Combined workflows
1217
-
1218
- - "Rotate model.stl 45 degrees around Z, extend the base by 2mm, then print it on my Bambu P1S."
1219
- - "Take this unsliced 3MF, slice it with BambuStudio, and print the result."
1220
- - "Scale this part to 80% of its size, lay it flat, and start a print."
1221
-
1222
- </details>
1223
-
1224
1214
  <details>
1225
1215
  <summary><strong>Bambu Lab Printer Limitations</strong></summary>
1226
1216
 
@@ -5,6 +5,10 @@ export type BambuNetworkBridgeOptions = {
5
5
  countryCode?: string;
6
6
  userInfo?: string;
7
7
  timeoutMs?: number;
8
+ /** Trusted in-process preflight; never populated from tool arguments. */
9
+ beforeDispatch?: (method: string) => Promise<void>;
10
+ assertDispatchAllowed?: (method: string) => void;
11
+ onDispatched?: (method: string) => void;
8
12
  };
9
13
  export type BambuNetworkBridgeStatus = {
10
14
  configured: boolean;
@@ -161,6 +161,7 @@ export class BambuNetworkBridge {
161
161
  throw new Error("BambuNetwork bridge method is required.");
162
162
  }
163
163
  await this.ensureStarted(options.bridgeCommand);
164
+ await options.beforeDispatch?.(method);
164
165
  const id = this.nextRequestId++;
165
166
  const requestPayload = Buffer.from(JSON.stringify({ method, payload }), "utf8");
166
167
  const frame = Buffer.alloc(FRAME_HEADER_SIZE + requestPayload.length);
@@ -176,6 +177,7 @@ export class BambuNetworkBridge {
176
177
  }, options.timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS);
177
178
  this.pending.set(id, { method, resolve, reject, timer });
178
179
  try {
180
+ options.assertDispatchAllowed?.(method);
179
181
  this.child.stdin.write(frame, (error) => {
180
182
  if (error) {
181
183
  const pending = this.pending.get(id);
@@ -186,6 +188,7 @@ export class BambuNetworkBridge {
186
188
  }
187
189
  }
188
190
  });
191
+ options.onDispatched?.(method);
189
192
  }
190
193
  catch (error) {
191
194
  clearTimeout(timer);