bambu-printer-mcp 1.1.54 → 1.1.55

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.
@@ -193,10 +193,16 @@ export declare class BambuNetworkBridge {
193
193
  * Shares the LAN session queue: one reader of the plug-in's events at a time.
194
194
  */
195
195
  withCloudSession<T>(devId: string, options: BambuNetworkBridgeOptions, assertActive: () => void, timing: Readonly<CloudTiming>, run: (session: CloudSession) => Promise<T>): Promise<T>;
196
- /** A cloud print method (start_print) in a cloud session, so the plug-in has the printer's state. */
197
- startCloudPrint(devId: string, method: string, payload: JsonObject, options?: BambuNetworkBridgeOptions, assertActive?: () => void, timing?: Readonly<CloudTiming>): Promise<{
196
+ /**
197
+ * A cloud print in a cloud session, so the plug-in has the printer's state. With a fallback this is
198
+ * Bambu Studio's order for a cloud-bound printer it can also reach on the LAN (PrintJob.cpp,
199
+ * SendAttemptRoute::LanWithRecord, then ::Cloud): start_local_print_with_record, then start_print
200
+ * when the first failed before its print command was sent. `firstFailure` is the first method's result.
201
+ */
202
+ startCloudPrint(devId: string, method: string, payload: JsonObject, options?: BambuNetworkBridgeOptions, assertActive?: () => void, timing?: Readonly<CloudTiming>, fallbackMethod?: string): Promise<{
198
203
  result: unknown;
199
204
  jobUpdates: BridgeJobUpdate[];
205
+ firstFailure?: number;
200
206
  }>;
201
207
  /**
202
208
  * A print control over Bambu Cloud: how Bambu Studio and FULU's slicer control a printer
@@ -16,8 +16,16 @@ const DEFAULT_REQUEST_TIMEOUT_MS = 120000;
16
16
  const LOCAL_CONNECT_STATUS = ["ok", "failed", "lost"];
17
17
  // bambu_networking.hpp BAMBU_NETWORK_ERR_PRINT_LP_PUBLISH_MSG_FAILED.
18
18
  const LOCAL_PRINT_PUBLISH_FAILED = -4030;
19
+ // A with-record send falls back to start_print only on its own preparation failures (the plug-in's
20
+ // PRINT_WR_* results, -2010 to -2140: project, upload, task record, FTPS), which come before the print
21
+ // command, so the printer has no job. Any other result may have reached the printer and is never
22
+ // replayed. Of those, Studio also stops on a file missing or too large (should_stop_without_fallback).
23
+ const WITH_RECORD_PREPARATION_FAILURE = (value) => value <= -2010 && value >= -2140 && value !== -2040 && value !== -2100;
19
24
  // bambu_networking.hpp print errors that name a recoverable cause.
20
25
  const BAMBU_NETWORK_PRINT_ERRORS = {
26
+ [-2120]: "Bambu Cloud refused to create the print task",
27
+ [-2130]: "FTPS upload to the printer failed",
28
+ [-3120]: "Bambu Cloud refused to create the print task",
21
29
  [-4010]: "the file exceeds the 1 GB upload limit",
22
30
  [-4020]: "FTPS upload to the printer failed",
23
31
  [LOCAL_PRINT_PUBLISH_FAILED]: "the networking plug-in could not send the print command to the printer over MQTT",
@@ -706,9 +714,23 @@ export class BambuNetworkBridge {
706
714
  release();
707
715
  }
708
716
  }
709
- /** A cloud print method (start_print) in a cloud session, so the plug-in has the printer's state. */
710
- async startCloudPrint(devId, method, payload, options = {}, assertActive = () => { }, timing = CLOUD_PRINT_TIMING) {
711
- return await this.withCloudSession(devId, options, assertActive, timing, async (session) => ({ result: await this.callWithAgent(method, payload, options), jobUpdates: session.jobUpdates }));
717
+ /**
718
+ * A cloud print in a cloud session, so the plug-in has the printer's state. With a fallback this is
719
+ * Bambu Studio's order for a cloud-bound printer it can also reach on the LAN (PrintJob.cpp,
720
+ * SendAttemptRoute::LanWithRecord, then ::Cloud): start_local_print_with_record, then start_print
721
+ * when the first failed before its print command was sent. `firstFailure` is the first method's result.
722
+ */
723
+ async startCloudPrint(devId, method, payload, options = {}, assertActive = () => { }, timing = CLOUD_PRINT_TIMING, fallbackMethod) {
724
+ return await this.withCloudSession(devId, options, assertActive, timing, async (session) => {
725
+ const result = await this.callWithAgent(method, payload, options);
726
+ const value = bridgeNumericResult(result);
727
+ if (!fallbackMethod || value === undefined || !WITH_RECORD_PREPARATION_FAILURE(value))
728
+ return { result, jobUpdates: session.jobUpdates };
729
+ options.trace?.({ step: "fallback", from: method, to: fallbackMethod, result: value });
730
+ const params = payload.params;
731
+ const fallbackPayload = params ? { ...payload, params: { ...params, comments: `failed(${value})` } } : payload;
732
+ return { result: await this.callWithAgent(fallbackMethod, fallbackPayload, options), jobUpdates: session.jobUpdates, firstFailure: value };
733
+ });
712
734
  }
713
735
  /**
714
736
  * A print control over Bambu Cloud: how Bambu Studio and FULU's slicer control a printer
package/dist/index.js CHANGED
@@ -1247,9 +1247,15 @@ class BambuPrinterMCPServer {
1247
1247
  throw new Error("plate_index must be a non-negative integer.");
1248
1248
  }
1249
1249
  const connectionType = resolveConnection(args).type;
1250
- const bridgePrintMethod = resolveBambuNetworkPrintMethod(args?.bambu_network_method !== undefined ? String(args.bambu_network_method) : undefined, connectionType);
1251
- const bridgeMethod = toBridgeMethod(bridgePrintMethod);
1250
+ // With no method given, a cloud print follows Bambu Studio's order for a cloud-bound printer it can
1251
+ // reach on the LAN (PrintJob.cpp): start_local_print_with_record in the cloud session, then start_print.
1252
+ // This server always has the printer's IP and access code, which Studio needs for the first.
1253
+ const studioCloudRoute = connectionType === "cloud" && args?.bambu_network_method === undefined;
1254
+ const bridgePrintMethod = studioCloudRoute ? "start_local_print_with_record" : resolveBambuNetworkPrintMethod(args?.bambu_network_method !== undefined ? String(args.bambu_network_method) : undefined, connectionType);
1255
+ let bridgeMethod = toBridgeMethod(bridgePrintMethod);
1252
1256
  const isLocalBridgePrint = bridgePrintMethod !== "start_print";
1257
+ const inCloudSession = studioCloudRoute || !isLocalBridgePrint;
1258
+ let cloudFallbackMethod = studioCloudRoute ? toBridgeMethod("start_print") : undefined;
1253
1259
  const devId = String(args?.dev_id || bambuSerial || DEFAULT_BAMBU_DEV_ID).trim();
1254
1260
  if (!devId) {
1255
1261
  throw new Error("dev_id is required for FULU BambuNetwork printing. Pass dev_id or set BAMBU_DEV_ID/BAMBU_SERIAL.");
@@ -1313,6 +1319,11 @@ class BambuPrinterMCPServer {
1313
1319
  const amsMapping = stringifyBridgeJson(mapping?.map(value => bridgeAmsMappingValue(value, isDualNozzleModel(printModel))));
1314
1320
  const remoteFileName = uniquePrintName(threeMFPath);
1315
1321
  const checkedName = remoteFileName.replace(/(?:\.gcode)?\.3mf$/i, "");
1322
+ if (cloudFallbackMethod && externalStorageState(confirmedStatus.raw) !== "normal") {
1323
+ // Studio sends straight through the cloud when the printer has no storage for the LAN upload.
1324
+ bridgeMethod = cloudFallbackMethod;
1325
+ cloudFallbackMethod = undefined;
1326
+ }
1316
1327
  const params = {
1317
1328
  dev_id: devId,
1318
1329
  // Firmware can report the task name instead of the uploaded filename.
@@ -1407,26 +1418,31 @@ class BambuPrinterMCPServer {
1407
1418
  const bridgeOptions = {
1408
1419
  ...this.bridgeOptionsFromArgs(args, "print_3mf_bambu_network"),
1409
1420
  beforeDispatch: async (method) => {
1410
- if (method !== bridgeMethod)
1421
+ if (method !== bridgeMethod && method !== cloudFallbackMethod)
1411
1422
  return;
1412
1423
  assertActive();
1413
1424
  const dispatchStatus = await this.bambu.getSafetyStatus(devIp, devId, password || bambuToken);
1414
1425
  validatePrinterState(dispatchStatus, requirements);
1415
1426
  this.bambu.assertPrintPreflight(dispatchStatus, preflight);
1416
1427
  },
1417
- assertDispatchAllowed: method => { if (method === bridgeMethod)
1428
+ assertDispatchAllowed: method => { if (method === bridgeMethod || method === cloudFallbackMethod)
1418
1429
  assertActive(); },
1419
- onDispatched: method => { if (method === bridgeMethod)
1430
+ onDispatched: method => { if (method === bridgeMethod || method === cloudFallbackMethod)
1420
1431
  retainForDispatchedUpload(); },
1421
1432
  };
1422
1433
  let jobUpdates = [];
1423
1434
  let bridgeResult;
1424
- if (isLocalBridgePrint) {
1435
+ let firstFailure;
1436
+ if (!inCloudSession) {
1425
1437
  ({ result: bridgeResult, jobUpdates } = await this.bambuNetwork.startLocalPrint({ devId, devIp, username: String(params.username), password, useSsl: params.use_ssl_for_mqtt }, bridgeMethod, { client_job_id: clientJobId, params }, bridgeOptions, assertActive));
1426
1438
  }
1427
1439
  else {
1428
- ({ result: bridgeResult, jobUpdates } = await this.bambuNetwork.startCloudPrint(devId, bridgeMethod, { client_job_id: clientJobId, params }, bridgeOptions, assertActive));
1440
+ ({ result: bridgeResult, jobUpdates, firstFailure } = await this.bambuNetwork.startCloudPrint(devId, bridgeMethod, { client_job_id: clientJobId, params }, bridgeOptions, assertActive, undefined, cloudFallbackMethod));
1441
+ if (firstFailure !== undefined)
1442
+ bridgeMethod = cloudFallbackMethod;
1429
1443
  }
1444
+ const firstAttempt = firstFailure !== undefined
1445
+ ? ` It first tried net.start_local_print_with_record, as Bambu Studio does, which returned ${firstFailure}${describeBambuNetworkPrintError(firstFailure)}.` : "";
1430
1446
  if (typeof bridgeResult === "object" && bridgeResult !== null && bridgeResult.ok === false) {
1431
1447
  throw new Error(`FULU BambuNetwork bridge method ${bridgeMethod} failed: ${String(bridgeResult.error || "unknown bridge error")}`);
1432
1448
  }
@@ -1438,13 +1454,13 @@ class BambuPrinterMCPServer {
1438
1454
  const reported = jobUpdates.filter(update => update.code !== 0 || update.msg).slice(-3)
1439
1455
  .map(update => `status ${update.status}, code ${update.code}${update.msg ? `: ${update.msg}` : ""}`).join("; ");
1440
1456
  throw new Error(`FULU BambuNetwork bridge method ${bridgeMethod} returned non-zero result ${value}${describeBambuNetworkPrintError(value)}.` +
1441
- (reported ? ` Plug-in reported: ${reported}.` : ""));
1457
+ (reported ? ` Plug-in reported: ${reported}.` : "") + firstAttempt);
1442
1458
  }
1443
1459
  assertActive();
1444
1460
  this.bambu.recordCheckedJob(devIp, devId, remoteFileName, requirements, resumeFile, false);
1445
1461
  return {
1446
1462
  status: "success",
1447
- message: `FULU BambuNetwork ${bridgePrintMethod} command for ${threeMfFilename} sent successfully.`,
1463
+ message: `FULU BambuNetwork ${bridgeMethod.replace(/^net\./, "")} command for ${threeMfFilename} sent successfully.${firstAttempt}`,
1448
1464
  bridgeMethod,
1449
1465
  bridgeResult,
1450
1466
  clientJobId,
@@ -2200,7 +2216,7 @@ class BambuPrinterMCPServer {
2200
2216
  description: "REQUIRED: Bambu Lab printer model. Ask the user if not known. Using the wrong model can damage the printer."
2201
2217
  },
2202
2218
  connection_type: { type: "string", enum: ["cloud", "lan"], description: "BambuNetwork connection type to put in FULU PrintParams; cloud uses restored internet printing, lan uses local bridge printing." },
2203
- bambu_network_method: { type: "string", enum: BAMBU_NETWORK_PRINT_METHODS, description: "FULU print method to invoke; defaults to start_print for cloud and start_local_print for lan." },
2219
+ bambu_network_method: { type: "string", enum: BAMBU_NETWORK_PRINT_METHODS, description: "FULU print method to invoke; defaults to start_local_print for lan, and for cloud to Bambu Studio's order: start_local_print_with_record, then start_print if that fails." },
2204
2220
  dev_id: { type: "string", description: "Bambu device id used by BambuNetwork; defaults to BAMBU_DEV_ID or BAMBU_SERIAL." },
2205
2221
  dev_ip: { type: "string", description: "Printer IP address for LAN/local bridge methods; defaults to host when provided." },
2206
2222
  host: { type: "string", description: "Printer host or IP address, used as dev_ip for LAN/local bridge methods." },
@@ -2629,7 +2645,7 @@ class BambuPrinterMCPServer {
2629
2645
  },
2630
2646
  try_emmc_print: { type: "boolean", description: "X2D native printing: true stores the job on internal storage (eMMC), false on the SD card or USB stick (refused unless the printer reports one ready). Omit to use the card when ready, else eMMC; BAMBU_NATIVE_TRY_EMMC_PRINT sets a server default." },
2631
2647
  connection_type: { type: "string", enum: ["cloud", "lan"], description: "BambuNetwork connection type when connection_mode is bambu_network; cloud uses restored internet printing, lan uses local bridge printing." },
2632
- bambu_network_method: { type: "string", enum: BAMBU_NETWORK_PRINT_METHODS, description: "FULU print method when connection_mode is bambu_network; defaults to start_print for cloud and start_local_print for lan." },
2648
+ bambu_network_method: { type: "string", enum: BAMBU_NETWORK_PRINT_METHODS, description: "FULU print method when connection_mode is bambu_network; defaults to start_local_print for lan, and for cloud to Bambu Studio's order: start_local_print_with_record, then start_print if that fails." },
2633
2649
  dev_id: { type: "string", description: "Bambu device id for FULU BambuNetwork printing; defaults to BAMBU_DEV_ID or BAMBU_SERIAL." },
2634
2650
  dev_ip: { type: "string", description: "Printer IP address for FULU BambuNetwork LAN/local print methods; defaults to host when provided." },
2635
2651
  bridge_command: { type: "string", description: "Override command for the FULU bridge host or macOS/WSL wrapper; defaults to BAMBU_NETWORK_BRIDGE_COMMAND. Per-call overrides require MCP_ALLOW_EXECUTABLE_ARG=1." },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bambu-printer-mcp",
3
- "version": "1.1.54",
3
+ "version": "1.1.55",
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": {
@@ -17,8 +17,16 @@ const DEFAULT_REQUEST_TIMEOUT_MS = 120_000;
17
17
  const LOCAL_CONNECT_STATUS = ["ok", "failed", "lost"];
18
18
  // bambu_networking.hpp BAMBU_NETWORK_ERR_PRINT_LP_PUBLISH_MSG_FAILED.
19
19
  const LOCAL_PRINT_PUBLISH_FAILED = -4030;
20
+ // A with-record send falls back to start_print only on its own preparation failures (the plug-in's
21
+ // PRINT_WR_* results, -2010 to -2140: project, upload, task record, FTPS), which come before the print
22
+ // command, so the printer has no job. Any other result may have reached the printer and is never
23
+ // replayed. Of those, Studio also stops on a file missing or too large (should_stop_without_fallback).
24
+ const WITH_RECORD_PREPARATION_FAILURE = (value: number) => value <= -2010 && value >= -2140 && value !== -2040 && value !== -2100;
20
25
  // bambu_networking.hpp print errors that name a recoverable cause.
21
26
  const BAMBU_NETWORK_PRINT_ERRORS: Record<number, string> = {
27
+ [-2120]: "Bambu Cloud refused to create the print task",
28
+ [-2130]: "FTPS upload to the printer failed",
29
+ [-3120]: "Bambu Cloud refused to create the print task",
22
30
  [-4010]: "the file exceeds the 1 GB upload limit",
23
31
  [-4020]: "FTPS upload to the printer failed",
24
32
  [LOCAL_PRINT_PUBLISH_FAILED]: "the networking plug-in could not send the print command to the printer over MQTT",
@@ -852,10 +860,24 @@ export class BambuNetworkBridge {
852
860
  }
853
861
  }
854
862
 
855
- /** A cloud print method (start_print) in a cloud session, so the plug-in has the printer's state. */
863
+ /**
864
+ * A cloud print in a cloud session, so the plug-in has the printer's state. With a fallback this is
865
+ * Bambu Studio's order for a cloud-bound printer it can also reach on the LAN (PrintJob.cpp,
866
+ * SendAttemptRoute::LanWithRecord, then ::Cloud): start_local_print_with_record, then start_print
867
+ * when the first failed before its print command was sent. `firstFailure` is the first method's result.
868
+ */
856
869
  async startCloudPrint(devId: string, method: string, payload: JsonObject, options: BambuNetworkBridgeOptions = {},
857
- assertActive: () => void = () => {}, timing: Readonly<CloudTiming> = CLOUD_PRINT_TIMING): Promise<{ result: unknown; jobUpdates: BridgeJobUpdate[] }> {
858
- return await this.withCloudSession(devId, options, assertActive, timing, async session => ({ result: await this.callWithAgent(method, payload, options), jobUpdates: session.jobUpdates }));
870
+ assertActive: () => void = () => {}, timing: Readonly<CloudTiming> = CLOUD_PRINT_TIMING, fallbackMethod?: string
871
+ ): Promise<{ result: unknown; jobUpdates: BridgeJobUpdate[]; firstFailure?: number }> {
872
+ return await this.withCloudSession(devId, options, assertActive, timing, async session => {
873
+ const result = await this.callWithAgent(method, payload, options);
874
+ const value = bridgeNumericResult(result);
875
+ if (!fallbackMethod || value === undefined || !WITH_RECORD_PREPARATION_FAILURE(value)) return { result, jobUpdates: session.jobUpdates };
876
+ options.trace?.({ step: "fallback", from: method, to: fallbackMethod, result: value });
877
+ const params = (payload as { params?: JsonObject }).params;
878
+ const fallbackPayload = params ? { ...payload, params: { ...params, comments: `failed(${value})` } } : payload;
879
+ return { result: await this.callWithAgent(fallbackMethod, fallbackPayload, options), jobUpdates: session.jobUpdates, firstFailure: value };
880
+ });
859
881
  }
860
882
 
861
883
  /**
package/src/index.ts CHANGED
@@ -1645,12 +1645,18 @@ class BambuPrinterMCPServer {
1645
1645
 
1646
1646
  const connectionType = resolveConnection(args).type;
1647
1647
 
1648
- const bridgePrintMethod = resolveBambuNetworkPrintMethod(
1648
+ // With no method given, a cloud print follows Bambu Studio's order for a cloud-bound printer it can
1649
+ // reach on the LAN (PrintJob.cpp): start_local_print_with_record in the cloud session, then start_print.
1650
+ // This server always has the printer's IP and access code, which Studio needs for the first.
1651
+ const studioCloudRoute = connectionType === "cloud" && args?.bambu_network_method === undefined;
1652
+ const bridgePrintMethod = studioCloudRoute ? "start_local_print_with_record" : resolveBambuNetworkPrintMethod(
1649
1653
  args?.bambu_network_method !== undefined ? String(args.bambu_network_method) : undefined,
1650
1654
  connectionType
1651
1655
  );
1652
- const bridgeMethod = toBridgeMethod(bridgePrintMethod);
1656
+ let bridgeMethod = toBridgeMethod(bridgePrintMethod);
1653
1657
  const isLocalBridgePrint = bridgePrintMethod !== "start_print";
1658
+ const inCloudSession = studioCloudRoute || !isLocalBridgePrint;
1659
+ let cloudFallbackMethod = studioCloudRoute ? toBridgeMethod("start_print") : undefined;
1654
1660
 
1655
1661
  const devId = String(args?.dev_id || bambuSerial || DEFAULT_BAMBU_DEV_ID).trim();
1656
1662
  if (!devId) {
@@ -1730,6 +1736,11 @@ class BambuPrinterMCPServer {
1730
1736
  const amsMapping = stringifyBridgeJson(mapping?.map(value => bridgeAmsMappingValue(value, isDualNozzleModel(printModel))));
1731
1737
  const remoteFileName = uniquePrintName(threeMFPath);
1732
1738
  const checkedName = remoteFileName.replace(/(?:\.gcode)?\.3mf$/i, "");
1739
+ if (cloudFallbackMethod && externalStorageState(confirmedStatus.raw) !== "normal") {
1740
+ // Studio sends straight through the cloud when the printer has no storage for the LAN upload.
1741
+ bridgeMethod = cloudFallbackMethod;
1742
+ cloudFallbackMethod = undefined;
1743
+ }
1733
1744
  const params: Record<string, unknown> = {
1734
1745
  dev_id: devId,
1735
1746
  // Firmware can report the task name instead of the uploaded filename.
@@ -1825,18 +1836,19 @@ class BambuPrinterMCPServer {
1825
1836
  const bridgeOptions: BambuNetworkBridgeOptions = {
1826
1837
  ...this.bridgeOptionsFromArgs(args, "print_3mf_bambu_network"),
1827
1838
  beforeDispatch: async method => {
1828
- if (method !== bridgeMethod) return;
1839
+ if (method !== bridgeMethod && method !== cloudFallbackMethod) return;
1829
1840
  assertActive();
1830
1841
  const dispatchStatus = await this.bambu.getSafetyStatus(devIp, devId, password || bambuToken);
1831
1842
  validatePrinterState(dispatchStatus, requirements);
1832
1843
  this.bambu.assertPrintPreflight(dispatchStatus, preflight);
1833
1844
  },
1834
- assertDispatchAllowed: method => { if (method === bridgeMethod) assertActive(); },
1835
- onDispatched: method => { if (method === bridgeMethod) retainForDispatchedUpload(); },
1845
+ assertDispatchAllowed: method => { if (method === bridgeMethod || method === cloudFallbackMethod) assertActive(); },
1846
+ onDispatched: method => { if (method === bridgeMethod || method === cloudFallbackMethod) retainForDispatchedUpload(); },
1836
1847
  };
1837
1848
  let jobUpdates: BridgeJobUpdate[] = [];
1838
1849
  let bridgeResult: unknown;
1839
- if (isLocalBridgePrint) {
1850
+ let firstFailure: number | undefined;
1851
+ if (!inCloudSession) {
1840
1852
  ({ result: bridgeResult, jobUpdates } = await this.bambuNetwork.startLocalPrint(
1841
1853
  { devId, devIp, username: String(params.username), password, useSsl: params.use_ssl_for_mqtt as boolean },
1842
1854
  bridgeMethod,
@@ -1845,8 +1857,11 @@ class BambuPrinterMCPServer {
1845
1857
  assertActive
1846
1858
  ));
1847
1859
  } else {
1848
- ({ result: bridgeResult, jobUpdates } = await this.bambuNetwork.startCloudPrint(devId, bridgeMethod, { client_job_id: clientJobId, params }, bridgeOptions, assertActive));
1860
+ ({ result: bridgeResult, jobUpdates, firstFailure } = await this.bambuNetwork.startCloudPrint(devId, bridgeMethod, { client_job_id: clientJobId, params }, bridgeOptions, assertActive, undefined, cloudFallbackMethod));
1861
+ if (firstFailure !== undefined) bridgeMethod = cloudFallbackMethod!;
1849
1862
  }
1863
+ const firstAttempt = firstFailure !== undefined
1864
+ ? ` It first tried net.start_local_print_with_record, as Bambu Studio does, which returned ${firstFailure}${describeBambuNetworkPrintError(firstFailure)}.` : "";
1850
1865
 
1851
1866
  if (typeof bridgeResult === "object" && bridgeResult !== null && (bridgeResult as { ok?: unknown }).ok === false) {
1852
1867
  throw new Error(`FULU BambuNetwork bridge method ${bridgeMethod} failed: ${String((bridgeResult as { error?: unknown }).error || "unknown bridge error")}`);
@@ -1861,7 +1876,7 @@ class BambuPrinterMCPServer {
1861
1876
  const reported = jobUpdates.filter(update => update.code !== 0 || update.msg).slice(-3)
1862
1877
  .map(update => `status ${update.status}, code ${update.code}${update.msg ? `: ${update.msg}` : ""}`).join("; ");
1863
1878
  throw new Error(`FULU BambuNetwork bridge method ${bridgeMethod} returned non-zero result ${value}${describeBambuNetworkPrintError(value)}.` +
1864
- (reported ? ` Plug-in reported: ${reported}.` : ""));
1879
+ (reported ? ` Plug-in reported: ${reported}.` : "") + firstAttempt);
1865
1880
  }
1866
1881
 
1867
1882
  assertActive();
@@ -1869,7 +1884,7 @@ class BambuPrinterMCPServer {
1869
1884
 
1870
1885
  return {
1871
1886
  status: "success",
1872
- message: `FULU BambuNetwork ${bridgePrintMethod} command for ${threeMfFilename} sent successfully.`,
1887
+ message: `FULU BambuNetwork ${bridgeMethod.replace(/^net\./, "")} command for ${threeMfFilename} sent successfully.${firstAttempt}`,
1873
1888
  bridgeMethod,
1874
1889
  bridgeResult,
1875
1890
  clientJobId,
@@ -2733,7 +2748,7 @@ class BambuPrinterMCPServer {
2733
2748
  description: "REQUIRED: Bambu Lab printer model. Ask the user if not known. Using the wrong model can damage the printer."
2734
2749
  },
2735
2750
  connection_type: { type: "string", enum: ["cloud", "lan"], description: "BambuNetwork connection type to put in FULU PrintParams; cloud uses restored internet printing, lan uses local bridge printing." },
2736
- bambu_network_method: { type: "string", enum: BAMBU_NETWORK_PRINT_METHODS, description: "FULU print method to invoke; defaults to start_print for cloud and start_local_print for lan." },
2751
+ bambu_network_method: { type: "string", enum: BAMBU_NETWORK_PRINT_METHODS, description: "FULU print method to invoke; defaults to start_local_print for lan, and for cloud to Bambu Studio's order: start_local_print_with_record, then start_print if that fails." },
2737
2752
  dev_id: { type: "string", description: "Bambu device id used by BambuNetwork; defaults to BAMBU_DEV_ID or BAMBU_SERIAL." },
2738
2753
  dev_ip: { type: "string", description: "Printer IP address for LAN/local bridge methods; defaults to host when provided." },
2739
2754
  host: { type: "string", description: "Printer host or IP address, used as dev_ip for LAN/local bridge methods." },
@@ -3162,7 +3177,7 @@ class BambuPrinterMCPServer {
3162
3177
  },
3163
3178
  try_emmc_print: { type: "boolean", description: "X2D native printing: true stores the job on internal storage (eMMC), false on the SD card or USB stick (refused unless the printer reports one ready). Omit to use the card when ready, else eMMC; BAMBU_NATIVE_TRY_EMMC_PRINT sets a server default." },
3164
3179
  connection_type: { type: "string", enum: ["cloud", "lan"], description: "BambuNetwork connection type when connection_mode is bambu_network; cloud uses restored internet printing, lan uses local bridge printing." },
3165
- bambu_network_method: { type: "string", enum: BAMBU_NETWORK_PRINT_METHODS, description: "FULU print method when connection_mode is bambu_network; defaults to start_print for cloud and start_local_print for lan." },
3180
+ bambu_network_method: { type: "string", enum: BAMBU_NETWORK_PRINT_METHODS, description: "FULU print method when connection_mode is bambu_network; defaults to start_local_print for lan, and for cloud to Bambu Studio's order: start_local_print_with_record, then start_print if that fails." },
3166
3181
  dev_id: { type: "string", description: "Bambu device id for FULU BambuNetwork printing; defaults to BAMBU_DEV_ID or BAMBU_SERIAL." },
3167
3182
  dev_ip: { type: "string", description: "Printer IP address for FULU BambuNetwork LAN/local print methods; defaults to host when provided." },
3168
3183
  bridge_command: { type: "string", description: "Override command for the FULU bridge host or macOS/WSL wrapper; defaults to BAMBU_NETWORK_BRIDGE_COMMAND. Per-call overrides require MCP_ALLOW_EXECUTABLE_ARG=1." },