bambu-printer-mcp 1.1.6 → 1.1.8

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.
@@ -0,0 +1,26 @@
1
+ # Contributors
2
+
3
+ Thank you to everyone who builds, tests, reports problems, and shares real printer evidence. This release is stronger because of your work!
4
+
5
+ ## This release
6
+
7
+ | Contributor | Contribution |
8
+ | --- | --- |
9
+ | [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). |
10
+ | [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). |
11
+ | [var-poro](https://github.com/var-poro) | Supplies P2S firmware/MQTT evidence and regression tests in [#15](https://github.com/DMontgomery40/bambu-printer-mcp/pull/15), plus profile-template resolution and inheritance tests in [#16](https://github.com/DMontgomery40/bambu-printer-mcp/pull/16). |
12
+ | [John Randall (johntrandall)](https://github.com/johntrandall) | Captures A1 job manifests and contributes the SD-root/project-file fix in [#14](https://github.com/DMontgomery40/bambu-printer-mcp/pull/14). |
13
+ | [Kyle Taylor (kyletaylored)](https://github.com/kyletaylored) | Contributes Claude Desktop extension packaging, prompted setup, and the writable-temp-directory fix in [#11](https://github.com/DMontgomery40/bambu-printer-mcp/pull/11). |
14
+ | [Quinn (quinnpertuit)](https://github.com/quinnpertuit) | Investigates P2S transfer routing and contributes model-capability and serial-prefix analysis in [#9](https://github.com/DMontgomery40/bambu-printer-mcp/pull/9). The release uses the alternative P2S implementation from #15. |
15
+ | [Vail (VailElla)](https://github.com/VailElla) | Contributes the native X2D transport, local eMMC investigation, and hardware evidence in [#10](https://github.com/DMontgomery40/bambu-printer-mcp/pull/10). That integration remains under review and is not enabled in this release. |
16
+
17
+ ## Project contributors
18
+
19
+ Thank you also to the existing contributors whose work this release builds on:
20
+
21
+ - [David Montgomery (DMontgomery40)](https://github.com/DMontgomery40) — project maintainer.
22
+ - [rowbotik](https://github.com/rowbotik) — printer, AMS, slicing, and operational work across the existing release history.
23
+ - [len-foss](https://github.com/len-foss) — project code contribution.
24
+ - [thebitrock](https://github.com/thebitrock) — project code contribution.
25
+
26
+ See the [full contribution history](https://github.com/DMontgomery40/bambu-printer-mcp/graphs/contributors) for commit authorship. Credit here includes bug reports and reviewed proposals as well as merged code.
package/README.md CHANGED
@@ -9,9 +9,9 @@
9
9
 
10
10
  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.
11
11
 
12
- 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.
12
+ Built with help from our [contributors](./CONTRIBUTORS.md). Huge thanks to everyone sharing fixes, careful bug reports, and real printer testing!
13
13
 
14
- Local handoff note: see [REMOTE-DEPLOYMENT.md](./REMOTE-DEPLOYMENT.md) for the custom H2D/H2S/H2C patches, per-printer MCP split, and remote deployment plan used in this clone.
14
+ 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.
15
15
 
16
16
  ---
17
17
 
@@ -19,6 +19,14 @@ Local handoff note: see [REMOTE-DEPLOYMENT.md](./REMOTE-DEPLOYMENT.md) for the c
19
19
 
20
20
  This fork adds a substantial set of printer control tools beyond the upstream `mcp-3D-printer-server`. Everything listed below is unique to this package.
21
21
 
22
+ ### v1.1.8 — reliable installs, printer fixes, and Blender MCP
23
+
24
+ - Fix delayed H2 status crashes and preserve machine-specific G-code when resolving Bambu profiles.
25
+ - Correct P2S and full-size A1 print routing while preserving other models' existing behavior.
26
+ - Install a Claude Desktop extension with prompted settings; keep local credentials and models out of packaged artifacts.
27
+ - Connect to standard Blender MCP servers, discover and call their tools, and verify STL edit/export results.
28
+ - Preserve filament-slot order and isolate temporary files between concurrent jobs and server instances.
29
+
22
30
  ### v1.1.0 — AMS auto-match, camera snapshot, pause/resume, skip objects
23
31
 
24
32
  - **AMS auto-match by RFID** (`auto_match_ams` on `print_3mf`) — resolves sliced 3MF filament requirements against live AMS inventory. Handles same-SKU different-color filaments. Dry-run with `resolve_3mf_ams_slots`.
@@ -30,10 +38,10 @@ This fork adds a substantial set of printer control tools beyond the upstream `m
30
38
  - **HMS diagnostics** (`printer://{host}/hms` MCP resource) — read-only error summary with automatic settle retry.
31
39
  - **Utility controls** — `set_print_speed` (silent/standard/sport/ludicrous), `clear_hms_errors`, `reread_ams_rfid`, `set_airduct_mode` (cooling/heating for H2/P2).
32
40
  - **H2-family-safe print path** — correct `project_file` format with `ams_mapping2` parallel array, H2 firmware quirks handled.
33
- - **BambuStudio CLI auto-flatten** (`BAMBU_CLI_FLATTEN=true`) — works around upstream profile inheritance bugs.
41
+ - **BambuStudio CLI auto-flatten** (automatic for BBL profiles) — works around upstream profile inheritance bugs.
34
42
  - **Print collar charm** (`print_collar_charm`) — specialized two-color wrapper with fixed tray policy.
35
43
 
36
- ### v1.1.1 — AMS dryer control (current)
44
+ ### v1.1.1 — AMS dryer control
37
45
 
38
46
  - **AMS dryer start/stop** (`set_ams_drying`) — sends `print.ams_control` MQTT command. Works on heated AMS units (AMS Pro / AMS-HT). Action: `start` or `stop`, target by AMS index 0–3.
39
47
  - Same-SKU different-color fix for `auto_match_ams`.
@@ -100,7 +108,7 @@ This fork adds a substantial set of printer control tools beyond the upstream `m
100
108
  - List, upload, and delete files on the printer's SD card via FTPS
101
109
  - 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 (RTSP via ffmpeg). Requires ffmpeg in PATH for the RTSP path.
102
110
  - Upload and print pre-sliced `.gcode.3mf` files with full plate selection and calibration flag control (recommended path — see [docs/SLICING.md](./docs/SLICING.md))
103
- - Optional single-color auto-slice path via BambuStudio CLI. Set `BAMBU_CLI_FLATTEN=true` to enable a workaround that flattens BBL profile inheritance before invoking the CLI — works around upstream bugs in BambuStudio CLI mode ([#9636](https://github.com/bambulab/BambuStudio/issues/9636), [#9968](https://github.com/bambulab/BambuStudio/issues/9968)). Single-color smoke is verified on H2S/H2D/X1C/P1S; H2C requires Bambu Studio 2.4.0 or newer and should use `BAMBU_MODEL=h2c`, not an H2D fallback. H2D two-color CLI slicing is blocked upstream ([#10408](https://github.com/bambulab/BambuStudio/issues/10408)); use a GUI-sliced `.gcode.3mf` for that workflow. Default off; Path A (GUI-slice) remains the recommended workflow for non-BBL profiles, multi-color H2 jobs, or first-time prints. See [docs/SLICING.md](./docs/SLICING.md).
111
+ - Optional single-color auto-slice path via BambuStudio CLI. BBL profile inheritance and include templates resolve automatically before slicing; missing dependencies stop the slice. Standalone custom configurations remain supported. H2C requires a compatible installed Bambu Studio profile tree and `BAMBU_MODEL=h2c`. The previously documented H2D multi-color CLI limitation remains; use a GUI-sliced `.gcode.3mf` for that workflow. See [docs/SLICING.md](./docs/SLICING.md).
104
112
  - 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
105
113
  - **Auto-match AMS slots by RFID** (`auto_match_ams` flag on `print_3mf`). Resolves required `tray_info_idx` from the sliced 3MF against live AMS inventory. Handles same-SKU different-color filaments by matching on `(tray_info_idx, tray_color)` and tracking already-claimed slots. Dry-run with `resolve_3mf_ams_slots` before printing.
106
114
  - Cancel, pause, and resume in-progress print jobs via MQTT
@@ -138,7 +146,7 @@ This fork adds a substantial set of printer control tools beyond the upstream `m
138
146
  The fastest way to get started. No global install required:
139
147
 
140
148
  ```bash
141
- npx @rowbotik/bambu-printer-mcp
149
+ npx bambu-printer-mcp
142
150
  ```
143
151
 
144
152
  Set environment variables inline or via a `.env` file in your working directory (see [Configuration](#configuration)).
@@ -146,7 +154,7 @@ Set environment variables inline or via a `.env` file in your working directory
146
154
  ### Install globally from npm
147
155
 
148
156
  ```bash
149
- npm install -g @rowbotik/bambu-printer-mcp
157
+ npm install -g bambu-printer-mcp
150
158
  ```
151
159
 
152
160
  After installation, the `bambu-printer-mcp` command is available in your PATH.
@@ -154,7 +162,7 @@ After installation, the `bambu-printer-mcp` command is available in your PATH.
154
162
  ### Install from source
155
163
 
156
164
  ```bash
157
- git clone https://github.com/rowbotik/bambu-printer-mcp.git
165
+ git clone https://github.com/DMontgomery40/bambu-printer-mcp.git
158
166
  cd bambu-printer-mcp
159
167
  npm install
160
168
  npm run build
@@ -204,8 +212,12 @@ MCP_HTTP_STATEFUL=true
204
212
  MCP_HTTP_JSON_RESPONSE=true
205
213
  MCP_HTTP_ALLOWED_ORIGINS=http://localhost
206
214
 
207
- # --- Optional Blender MCP bridge ---
208
- BLENDER_MCP_BRIDGE_COMMAND= # Shell command to invoke your Blender MCP bridge executable
215
+ # --- Optional standard Blender MCP server ---
216
+ BLENDER_MCP_COMMAND=uvx # Executable or full path; no shell command string
217
+ BLENDER_MCP_ARGS='["blender-mcp"]'
218
+ BLENDER_MCP_TIMEOUT_MS=120000
219
+ # Start the matching MCP addon inside Blender.
220
+ # Legacy custom executable bridge (optional): BLENDER_MCP_BRIDGE_COMMAND=
209
221
  ```
210
222
 
211
223
  ### Environment variables reference
@@ -221,7 +233,7 @@ BLENDER_MCP_BRIDGE_COMMAND= # Shell command to invoke your Blender MCP bri
221
233
  | `SLICER_TYPE` | `bambustudio` | No | Slicer to use for slicing operations |
222
234
  | `SLICER_PATH` | BambuStudio macOS path | No | Full path to the slicer executable. Alias: `BAMBU_STUDIO_PATH` |
223
235
  | `SLICER_PROFILE` | | No | Path to a slicer profile or config file |
224
- | `TEMP_DIR` | `./temp` | No | Directory for intermediate files |
236
+ | `TEMP_DIR` | private folder under the system temporary directory | No | Intermediate files; each server instance gets its own folder unless explicitly configured |
225
237
  | `MCP_TRANSPORT` | `stdio` | No | Transport mode: `stdio` or `streamable-http` |
226
238
  | `MCP_HTTP_HOST` | `127.0.0.1` | No | HTTP bind address (HTTP transport only) |
227
239
  | `MCP_HTTP_PORT` | `3000` | No | HTTP port (HTTP transport only) |
@@ -229,8 +241,11 @@ BLENDER_MCP_BRIDGE_COMMAND= # Shell command to invoke your Blender MCP bri
229
241
  | `MCP_HTTP_STATEFUL` | `true` | No | Enable stateful HTTP sessions |
230
242
  | `MCP_HTTP_JSON_RESPONSE` | `true` | No | Return structured JSON alongside text responses |
231
243
  | `MCP_HTTP_ALLOWED_ORIGINS` | | No | Comma-separated list of allowed CORS origins |
232
- | `BLENDER_MCP_BRIDGE_COMMAND` | | No | Command to invoke Blender MCP bridge |
233
- | `BAMBU_CLI_FLATTEN` | `false` | No | When `true`, the MCP flattens BBL profile inheritance before invoking the BambuStudio CLI. Workaround for upstream issues [#9636](https://github.com/bambulab/BambuStudio/issues/9636) / [#9968](https://github.com/bambulab/BambuStudio/issues/9968). BBL printers only. Single-color smoke verified on H2S/H2D/X1C/P1S; H2C requires Bambu Studio 2.4.0 or newer. H2D two-color CLI slicing remains blocked by [#10408](https://github.com/bambulab/BambuStudio/issues/10408). See [docs/SLICING.md](./docs/SLICING.md). |
244
+ | `BLENDER_MCP_COMMAND` | | No | Trusted executable for a standard stdio Blender MCP server, e.g. full path to `uvx` |
245
+ | `BLENDER_MCP_ARGS` | `[]` | No | JSON array of server arguments, e.g. `["blender-mcp"]`; no shell parsing |
246
+ | `BLENDER_MCP_TIMEOUT_MS` | `120000` | No | Connection/discovery/call deadline, 100–300000 ms; interrupted edits are never retried automatically |
247
+ | `BLENDER_MCP_BRIDGE_COMMAND` | | No | Legacy custom executable receiving `MCP_BLENDER_PAYLOAD`; separate from the standard MCP integration |
248
+ | `BAMBU_CLI_FLATTEN` | automatic | No | Legacy setting; BBL profile resolution now always runs when profiles contain inheritance or includes. A false/unset value cannot bypass required machine G-code. Standalone custom files without dependencies pass through. See [docs/SLICING.md](./docs/SLICING.md). |
234
249
  | `BAMBU_PROFILES_ROOT` | derived from `SLICER_PATH` | No | Override path to the BambuStudio `Resources/profiles` directory used by the CLI flattener. Useful for non-standard installs or dev environments. |
235
250
 
236
251
  SuperTack can be passed for pre-sliced print jobs, but BambuStudio CLI slicing currently fails fast for `supertack_plate` because the accepted CLI bed identifier is not verified. Use a pre-sliced 3MF for SuperTack until this is confirmed.
@@ -246,7 +261,7 @@ Add this server to your MCP client's config (Claude Desktop, Claude Code, Cursor
246
261
  "mcpServers": {
247
262
  "bambu-printer": {
248
263
  "command": "npx",
249
- "args": ["-y", "@rowbotik/bambu-printer-mcp"],
264
+ "args": ["-y", "bambu-printer-mcp"],
250
265
  "env": {
251
266
  "PRINTER_HOST": "192.168.1.100",
252
267
  "BAMBU_SERIAL": "01P00A123456789",
@@ -273,6 +288,25 @@ Where this config lives depends on your client:
273
288
 
274
289
  Restart your client after editing the config.
275
290
 
291
+ ### Alternative: Claude Desktop extension (.mcpb)
292
+
293
+ You can install this server into Claude Desktop without editing JSON by using the `.mcpb` extension bundle. Download `bambu-printer-mcp.mcpb` from the [latest release](https://github.com/DMontgomery40/bambu-printer-mcp/releases), double-click it, and Claude Desktop's extension wizard will register the server. You'll be prompted for your printer IP, serial number, LAN access code, and printer model -- the same values as the `mcpServers` config above.
294
+
295
+ If your org has disabled Claude Desktop extension installs, install unpacked instead:
296
+
297
+ 1. Clone the repo and run `npm ci && npm run build`.
298
+ 2. Open Claude Desktop -> **Settings** -> **Extensions** -> **Advanced Settings** -> **Extension Developer** -> **Install Unpacked**.
299
+ 3. Select the repo's root directory (the one containing `manifest.json`).
300
+
301
+ To build the bundle yourself instead of downloading a release asset:
302
+
303
+ ```bash
304
+ npm ci
305
+ npm run package:mcpb
306
+ ```
307
+
308
+ This produces `bambu-printer-mcp.mcpb` in the repo root using a pinned packaging tool. Packaging installs production dependencies in a temporary directory, retains licenses and source, excludes local credentials and models, and leaves your development dependencies intact.
309
+
276
310
  ### Recommended: use with codemode-mcp
277
311
 
278
312
  For any MCP server with a large tool surface, wrapping it behind [codemode-mcp](https://github.com/jx-codes/codemode-mcp) dramatically reduces token usage. Instead of exposing every tool definition to the model (which can consume tens of thousands of tokens per turn), codemode lets the agent write code against a two-tool interface (`search()` and `execute()`), loading only the tools it needs on demand.
@@ -1251,31 +1285,70 @@ These defaults keep you safe when printing downloaded models. When calling `slic
1251
1285
 
1252
1286
  ### Advanced Tools
1253
1287
 
1254
- #### blender_mcp_edit_model
1255
-
1256
- Send a set of named edit operations (remesh, boolean, decimate, etc.) to a Blender MCP bridge command for advanced mesh work that goes beyond what the built-in STL tools support.
1288
+ #### Blender MCP
1257
1289
 
1258
- When `execute` is `false` (the default), the tool returns the payload that would be sent without running anything -- useful for previewing what would be dispatched.
1290
+ Use a standard stdio Blender MCP server with `BLENDER_MCP_COMMAND` and
1291
+ `BLENDER_MCP_ARGS`. For the common Blender MCP server, install `uv` and its
1292
+ matching Blender addon, enable the addon, and start its connection inside
1293
+ Blender. Set the command to your full `uvx` path and the argument array to
1294
+ `["blender-mcp"]`. The Claude Desktop extension also offers these two optional
1295
+ settings. Printer tools work without Blender configured.
1259
1296
 
1260
- When `execute` is `true`, the server invokes the configured bridge command with the payload as a JSON-encoded environment variable (`MCP_BLENDER_PAYLOAD`). Configure it with `BLENDER_MCP_BRIDGE_COMMAND`; per-call `bridge_command` overrides require `MCP_ALLOW_EXECUTABLE_ARG=1`.
1297
+ 1. Call `blender_mcp_status` with `{"connect": true}` to initialize the server
1298
+ and discover its tools and input schemas. A connected MCP server does not
1299
+ by itself prove that the Blender addon is running.
1300
+ 2. Call `blender_mcp_call` with a discovered tool name and its arguments. The
1301
+ full MCP result, including images and errors, is returned. For example:
1261
1302
 
1262
1303
  ```json
1263
1304
  {
1264
- "stl_path": "/path/to/model.stl",
1265
- "operations": ["remesh", "decimate:0.5", "boolean_union:/path/to/other.stl"],
1266
- "execute": false
1305
+ "tool_name": "get_scene_info",
1306
+ "arguments": {"user_prompt": "Inspect the scene before preparing a print."}
1267
1307
  }
1268
1308
  ```
1269
1309
 
1310
+ For advanced Blender operations, forward `execute_blender_code` with `code`
1311
+ and the user's original `user_prompt`. These calls may edit the active scene.
1312
+ Use the discovered schema rather than assuming a tool exists.
1313
+
1314
+ #### blender_mcp_edit_model
1315
+
1316
+ The standard MCP edit helper imports an STL, applies ordered edits, and exports
1317
+ an STL without replacing the input or an existing output. Supported operations
1318
+ are `decimate:<ratio>` (greater than 0 through 1), `remesh:<voxel size>` (positive,
1319
+ in STL coordinate units), and `boolean_union:<STL path>`. Other operations can
1320
+ use `blender_mcp_call`. Both processes must have access to the same file paths.
1321
+ When `BLENDER_MCP_COMMAND` selects standard MCP, the advertised tool schema
1322
+ requires an explicit `output_path` for both preview and execution. Legacy-only
1323
+ bridge configurations keep `output_path` optional for compatibility.
1324
+
1270
1325
  ```json
1271
1326
  {
1272
1327
  "stl_path": "/path/to/model.stl",
1273
- "operations": ["remesh"],
1274
- "bridge_command": "/usr/local/bin/blender-mcp-bridge",
1275
- "execute": true
1328
+ "output_path": "/path/to/model-edited.stl",
1329
+ "operations": ["decimate:0.5"],
1330
+ "user_prompt": "Reduce the triangle count of this model for printing.",
1331
+ "execute": false
1276
1332
  }
1277
1333
  ```
1278
1334
 
1335
+ The default preview returns the plan and generated Python without launching
1336
+ Blender. Set `execute` to `true` to run it. A successful standard edit returns
1337
+ `output_verified: true`, `output_path`, byte count, and triangle count after
1338
+ checking the matching export receipt and a valid finite mesh. The helper
1339
+ preserves existing scene objects and requires Object Mode. Inspect the result
1340
+ before slicing; a valid STL is not a guarantee of printability.
1341
+
1342
+ The bridge enforces request deadlines, closes child connections, and never
1343
+ replays interrupted editing requests. After a timeout, inspect Blender before
1344
+ trying the edit again because execution may already have started.
1345
+
1346
+ Existing custom executables still work through `BLENDER_MCP_BRIDGE_COMMAND`.
1347
+ They receive `MCP_BLENDER_PAYLOAD` with the requested file and operations;
1348
+ their results explicitly report `output_verified: false`. A missing executable
1349
+ configuration is an error when execution is requested. Per-call legacy
1350
+ `bridge_command` overrides remain disabled unless `MCP_ALLOW_EXECUTABLE_ARG=1`.
1351
+
1279
1352
  </details>
1280
1353
 
1281
1354
  ---
@@ -0,0 +1,10 @@
1
+ import { type CallToolResult } from "@modelcontextprotocol/sdk/types.js";
2
+ type Arguments = Record<string, unknown>;
3
+ export declare class BlenderMcpBridge {
4
+ private session;
5
+ private invoke;
6
+ status(args: Arguments, signal?: AbortSignal): Promise<unknown>;
7
+ call(args: Arguments, signal?: AbortSignal): Promise<CallToolResult>;
8
+ edit(args: Arguments, legacyCommand?: string, signal?: AbortSignal): Promise<unknown>;
9
+ }
10
+ export {};