bambu-printer-mcp 1.1.81 → 1.1.82

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/README.md CHANGED
@@ -1097,7 +1097,7 @@ If the project does not match those assumptions, the tool fails fast with a stru
1097
1097
  - `activeFilament`: the loaded spool's `material` and `#RRGGBB` `color`. `slot` is the index `ams_slots` uses: `amsId × 4 + tray` for an AMS, the unit id (128 and up) for an AMS-HT, and `"ext"` for the external spool, or `"254"` (left) / `"255"` (right) on dual-nozzle H2D, H2C and X2D. On H2 and X2D it comes from the active extruder's report.
1098
1098
  - `problems`: a non-zero `print_error` as 8 hex digits, such as `07008011`, and each HMS entry as `AAAA_BBBB_CCCC_DDDD`, such as `0300_1800_0001_0003`. Severity follows Bambu's HMS level: fatal is `fatal`, serious `error`, common `warning` and info `info`. Each HMS problem links to Bambu's page for that code. Messages come from the English HMS tables bundled with the pinned Bambu Studio release; `scripts/generate-hms-messages.mjs` turns them into `src/safety/hms-messages.ts` and the stage words into `src/printers/bambu-stages.ts`. A model without its own table, such as the P1S, gets the text the other tables share. A code none of them has falls back to the user's own Bambu Studio download: `hms_en_<serial prefix>.json`, then `hms_en.json`, in the `hms` folder next to `BambuStudio.conf` (see `BAMBU_STUDIO_CONFIG`). Those files are read only, and Bambu's text is passed through unchanged. Codes that Bambu lists for a printer without text are reported as `info`.
1099
1099
  - **`counterpart_discover_printers`** listens for Bambu printers' own SSDP announcements on UDP 2021 for `duration_ms` (default 4000, 500–15000) and sends one M-SEARCH: `{contract, network, printers: [{kind: "bambu", source: "ssdp", name, host, serial, model?, firmware?}]}`. `model` is the `bambu_model` value the announced DevModel or the serial prefix names (none for the X1, which `bambu_model` doesn't take). An announcement counts only from a private IPv4 address that names itself as its `Location`. `network` is `unavailable` when another app (Bambu Studio) holds the port. It never connects to or authenticates with a printer.
1100
- - **`counterpart_setup_fields`** says what this server needs to drive a printer, so a client can offer setup without printer tables of its own: `{contract, server, kinds: [{kind: "bambu", label, env, fields}], model?}`. Each field names its form role (`host`, `serial`, `model`, `secret`), the `.env` variable to write (`PRINTER_HOST`, `BAMBU_SERIAL`, `BAMBU_MODEL`, `BAMBU_TOKEN`) and its older `aliases`, which this server reads first (a client writing the variable removes them), a label and hint, and whether it is required. The model field lists the `bambu_model` choices with Bambu's names and `fromSerial`, the model each three-character serial prefix names. Pass `serial` to get that model as `model`. `slicer` reports the slicer this server would run (type, path, whether it is there, and the Bambu profiles folder) with the `SLICER_TYPE`, `SLICER_PATH` (`input: "path"`) and `BAMBU_PROFILES_ROOT` fields, each required only when what it defaults to is missing. It sends nothing to a printer and returns no secret.
1100
+ - **`counterpart_setup_fields`** says what this server needs to drive a printer, so a client can offer setup without printer tables of its own: `{contract, server, kinds: [{kind: "bambu", label, env, cameraSnapshot, fields}], model?}`. `cameraSnapshot: true` says `camera_snapshot` reads the printer's camera with only the settings the fields write, so a client's setup check can ask for a picture as well as the status (RTSP models still need ffmpeg, as `camera_snapshot` always does); every kind declares it. Each field names its form role (`host`, `serial`, `model`, `secret`), the `.env` variable to write (`PRINTER_HOST`, `BAMBU_SERIAL`, `BAMBU_MODEL`, `BAMBU_TOKEN`) and its older `aliases`, which this server reads first (a client writing the variable removes them), a label and hint, and whether it is required. The model field lists the `bambu_model` choices with Bambu's names and `fromSerial`, the model each three-character serial prefix names. Pass `serial` to get that model as `model`. `slicer` reports the slicer this server would run (type, path, whether it is there, and the Bambu profiles folder) with the `SLICER_TYPE`, `SLICER_PATH` (`input: "path"`) and `BAMBU_PROFILES_ROOT` fields, each required only when what it defaults to is missing. It sends nothing to a printer and returns no secret.
1101
1101
  - **`counterpart_propose_filaments`** proposes which loaded AMS spool prints each of a model's colours, before slicing. Pass `filaments` (`index`, `name`, `colour` `#RRGGBB`, `material`), the `painted` slots no part names, `sliced: true` for an already-sliced file and, at print time, the person's `chosen` spools. It reads the live AMS once and returns:
1102
1102
  - `trays`: the spools to choose from, each with `label` (`A2`, as Bambu Studio labels trays), `name` (Bambu Studio's colour name and the product, "Sunflower Yellow PLA Basic", from the configured slicer's `filaments_color_codes.json`), `colour`, `material`, `filamentId`, `feed`, `sliceable` and, when one resolves, `profile` (the filament profile path `slice_stl` takes in `load_filaments`). An unsliced model lists only spools with a filament profile.
1103
1103
  - `proposal`: per filament, the nearest spool in OKLab colour with the asked-for material preferred, and a `verdict`: `same-colour` (within 0.08), `closest` (that colour isn't loaded; `note` says so, "White isn't loaded. Closest loaded: A2 Sunflower Yellow PLA Basic."), `no-colour` or `none`. A sliced file's material is a hard rule. One print feeds from one `feed`.
@@ -29,6 +29,12 @@ export type SetupKind = {
29
29
  label: string;
30
30
  /** Values this server needs for the kind whatever the person enters (MCP_TRANSPORT, PRINTER_TYPE). */
31
31
  env: Record<string, string>;
32
+ /**
33
+ * Whether camera_snapshot reads this kind's camera with only the settings these fields write, so a client's setup
34
+ * check can ask for a picture as well as the status. What else the computer needs (ffmpeg for RTSP models) is
35
+ * reported in camera_snapshot's own error. Every kind declares it; a client reads it missing as an older server.
36
+ */
37
+ cameraSnapshot: boolean;
32
38
  fields: SetupField[];
33
39
  };
34
40
  /** The slicer this server runs, as it resolves it now, and the settings that choose it (for every printer). */
@@ -119,6 +125,10 @@ export declare const SETUP_FIELDS_OUTPUT_SCHEMA: {
119
125
  type: string;
120
126
  };
121
127
  };
128
+ cameraSnapshot: {
129
+ type: string;
130
+ description: string;
131
+ };
122
132
  fields: {
123
133
  type: string;
124
134
  items: {
@@ -51,6 +51,8 @@ export function bambuSetupFields(options) {
51
51
  server: options.server,
52
52
  kinds: [{
53
53
  kind: "bambu", label: "Bambu Lab", env: { MCP_TRANSPORT: "stdio" },
54
+ // Every offered model has a built-in camera; the model field chooses its transport (camera-models.ts).
55
+ cameraSnapshot: true,
54
56
  fields: [
55
57
  { name: "host", env: "PRINTER_HOST", aliases: ["BAMBU_PRINTER_HOST"], label: "Address", hint: "The printer's IP address: on the printer, Settings → WLAN", required: true },
56
58
  { name: "serial", env: "BAMBU_SERIAL", aliases: ["BAMBU_PRINTER_SERIAL"], label: "Serial number", hint: "On the printer: Settings → Device", required: true, transform: "uppercase" },
@@ -79,8 +81,10 @@ export const SETUP_FIELDS_OUTPUT_SCHEMA = {
79
81
  server: { type: "object", properties: { name: { type: "string" }, version: { type: "string" } }, required: ["name", "version"] },
80
82
  kinds: { type: "array", items: { type: "object", properties: {
81
83
  kind: { type: "string", enum: [...PRINTER_KINDS] }, label: { type: "string" },
82
- env: { type: "object", additionalProperties: { type: "string" } }, fields: { type: "array", items: field },
83
- }, required: ["kind", "label", "env", "fields"] } },
84
+ env: { type: "object", additionalProperties: { type: "string" } },
85
+ cameraSnapshot: { type: "boolean", description: "Whether camera_snapshot reads this kind's camera with only the settings these fields write, so a setup check can ask for a picture too." },
86
+ fields: { type: "array", items: field },
87
+ }, required: ["kind", "label", "env", "cameraSnapshot", "fields"] } },
84
88
  model: { type: "string" },
85
89
  slicer: { type: "object", properties: {
86
90
  type: { type: "string" }, path: { type: "string" }, found: { type: "boolean" }, profilesRoot: { type: "string" }, profilesFound: { type: "boolean" },
package/dist/index.js CHANGED
@@ -3037,7 +3037,7 @@ class BambuPrinterMCPServer {
3037
3037
  },
3038
3038
  {
3039
3039
  name: "counterpart_setup_fields",
3040
- description: "Counterpart contract (counterpart/1): the printers this server drives and the settings it reads for each, by .env variable name (first canonical, then aliases): label, hint, whether required, the model choices and the model each serial-number prefix names. Pass serial to get the model it names. Sends nothing to a printer and returns no configured values.",
3040
+ description: "Counterpart contract (counterpart/1): the printers this server drives and the settings it reads for each, by .env variable name (first canonical, then aliases): label, hint, whether required, the model choices and the model each serial-number prefix names, and whether camera_snapshot reads the printer's camera with only those settings (cameraSnapshot). Pass serial to get the model it names. Sends nothing to a printer and returns no configured values.",
3041
3041
  inputSchema: {
3042
3042
  type: "object",
3043
3043
  properties: { serial: { type: "string", maxLength: 64, description: "A Bambu serial number: model is the one it names, when known." } },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bambu-printer-mcp",
3
- "version": "1.1.81",
3
+ "version": "1.1.82",
4
4
  "description": "MCP server for Bambu Lab 3D printers with STL manipulation, slicing, and print management",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -28,6 +28,12 @@ export type SetupKind = {
28
28
  kind: typeof PRINTER_KINDS[number]; label: string;
29
29
  /** Values this server needs for the kind whatever the person enters (MCP_TRANSPORT, PRINTER_TYPE). */
30
30
  env: Record<string, string>;
31
+ /**
32
+ * Whether camera_snapshot reads this kind's camera with only the settings these fields write, so a client's setup
33
+ * check can ask for a picture as well as the status. What else the computer needs (ffmpeg for RTSP models) is
34
+ * reported in camera_snapshot's own error. Every kind declares it; a client reads it missing as an older server.
35
+ */
36
+ cameraSnapshot: boolean;
31
37
  fields: SetupField[];
32
38
  };
33
39
  /** The slicer this server runs, as it resolves it now, and the settings that choose it (for every printer). */
@@ -86,6 +92,8 @@ export function bambuSetupFields(options: { server: { name: string; version: str
86
92
  server: options.server,
87
93
  kinds: [{
88
94
  kind: "bambu", label: "Bambu Lab", env: { MCP_TRANSPORT: "stdio" },
95
+ // Every offered model has a built-in camera; the model field chooses its transport (camera-models.ts).
96
+ cameraSnapshot: true,
89
97
  fields: [
90
98
  { name: "host", env: "PRINTER_HOST", aliases: ["BAMBU_PRINTER_HOST"], label: "Address", hint: "The printer's IP address: on the printer, Settings → WLAN", required: true },
91
99
  { name: "serial", env: "BAMBU_SERIAL", aliases: ["BAMBU_PRINTER_SERIAL"], label: "Serial number", hint: "On the printer: Settings → Device", required: true, transform: "uppercase" },
@@ -115,8 +123,10 @@ export const SETUP_FIELDS_OUTPUT_SCHEMA = {
115
123
  server: { type: "object", properties: { name: { type: "string" }, version: { type: "string" } }, required: ["name", "version"] },
116
124
  kinds: { type: "array", items: { type: "object", properties: {
117
125
  kind: { type: "string", enum: [...PRINTER_KINDS] }, label: { type: "string" },
118
- env: { type: "object", additionalProperties: { type: "string" } }, fields: { type: "array", items: field },
119
- }, required: ["kind", "label", "env", "fields"] } },
126
+ env: { type: "object", additionalProperties: { type: "string" } },
127
+ cameraSnapshot: { type: "boolean", description: "Whether camera_snapshot reads this kind's camera with only the settings these fields write, so a setup check can ask for a picture too." },
128
+ fields: { type: "array", items: field },
129
+ }, required: ["kind", "label", "env", "cameraSnapshot", "fields"] } },
120
130
  model: { type: "string" },
121
131
  slicer: { type: "object", properties: {
122
132
  type: { type: "string" }, path: { type: "string" }, found: { type: "boolean" }, profilesRoot: { type: "string" }, profilesFound: { type: "boolean" },
package/src/index.ts CHANGED
@@ -3546,7 +3546,7 @@ class BambuPrinterMCPServer {
3546
3546
  },
3547
3547
  {
3548
3548
  name: "counterpart_setup_fields",
3549
- description: "Counterpart contract (counterpart/1): the printers this server drives and the settings it reads for each, by .env variable name (first canonical, then aliases): label, hint, whether required, the model choices and the model each serial-number prefix names. Pass serial to get the model it names. Sends nothing to a printer and returns no configured values.",
3549
+ description: "Counterpart contract (counterpart/1): the printers this server drives and the settings it reads for each, by .env variable name (first canonical, then aliases): label, hint, whether required, the model choices and the model each serial-number prefix names, and whether camera_snapshot reads the printer's camera with only those settings (cameraSnapshot). Pass serial to get the model it names. Sends nothing to a printer and returns no configured values.",
3550
3550
  inputSchema: {
3551
3551
  type: "object",
3552
3552
  properties: { serial: { type: "string", maxLength: 64, description: "A Bambu serial number: model is the one it names, when known." } },