bambu-printer-mcp 1.1.95 → 1.1.96
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 +1 -0
- package/README.md +13 -2
- package/dist/fusion-mcp-bridge.d.ts +13 -0
- package/dist/fusion-mcp-bridge.js +35 -4
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/fusion-mcp-bridge.ts +34 -4
- package/src/index.ts +2 -2
package/CONTRIBUTORS.md
CHANGED
|
@@ -6,6 +6,7 @@ Thank you to everyone who builds, tests, reports problems, and shares real print
|
|
|
6
6
|
|
|
7
7
|
| Contributor | Contribution |
|
|
8
8
|
| --- | --- |
|
|
9
|
+
| [David Montgomery](https://github.com/DMontgomery40) | Reports a Fusion session whose read path answers while design commands hang in [#167](https://github.com/DMontgomery40/bambu-printer-mcp/issues/167), motivating the bounded command-readiness probe and structured startup state. Validation uses isolated MCP fixtures, not a live Fusion design. |
|
|
9
10
|
| [ianhyzy](https://github.com/ianhyzy) | Contributes the one-way P1S-file/P1P-printer compatibility change in [#140](https://github.com/DMontgomery40/bambu-printer-mcp/pull/140), with P1P enclosure-kit hardware, firmware and Bambu Studio inspection evidence. Integration adds mocked route and live-identity regressions; those tests do not establish a physical MCP print. |
|
|
10
11
|
| [geooff](https://github.com/geooff) | Contributes X1C firmware 01.12 external-slot normalization and the opt-in native print/upload route in [#128](https://github.com/DMontgomery40/bambu-printer-mcp/pull/128), with one reported physical macOS X1C print to an SD card using an AMS 2 Pro slot. Linux, other X1C firmware and X1E hardware remain unverified. Integration adds fresh storage-capability and mocked dispatch/resume regressions; these do not independently verify physical printing. |
|
|
11
12
|
| [Rowan McMahon (RowanMcMahon)](https://github.com/RowanMcMahon) | Reports A1 firmware 01.08.01.00 retaining `FAILED` after a stopped job and contributes the narrow terminal-state fix and regression tests in [#133](https://github.com/DMontgomery40/bambu-printer-mcp/pull/133). Supplies fresh MQTT evidence and reports a subsequent job reaching `FINISH`; this is contributor-reported status, not inspected physical-part verification. |
|
package/README.md
CHANGED
|
@@ -1489,12 +1489,23 @@ FUSION_MCP_PORT=<port>`. To start Fusion yourself, run the same command. If Fusi
|
|
|
1489
1489
|
is already open on the default port, quit it first, because `--env` takes effect
|
|
1490
1490
|
only when the app starts.
|
|
1491
1491
|
|
|
1492
|
-
1. `fusion_mcp_status` returns `{configured, connected, addinReachable, fusionRunning, tools[]}`,
|
|
1492
|
+
1. `fusion_mcp_status` returns `{configured, connected, responsive, state, reason, addinReachable, fusionRunning, tools[]}`,
|
|
1493
1493
|
plus `launched`, `pin`, the server's `server` info and any `error`.
|
|
1494
1494
|
`addinReachable` is true only when the `Fusion360MCP` add-in answers its own
|
|
1495
1495
|
`ping` on `FUSION_MCP_HOST:FUSION_MCP_PORT`; Blender's MCP add-on, which also
|
|
1496
1496
|
defaults to port 9876, doesn't count, so it can't hide a stopped Fusion.
|
|
1497
|
-
|
|
1497
|
+
After ping and the design read, a fresh no-op `execute_code` probe traverses the
|
|
1498
|
+
pinned add-in's mutation snapshots and command handler without editing or opening a
|
|
1499
|
+
document. `responsive: true` and `state: ready` require its fresh receipt;
|
|
1500
|
+
`state: starting` comes from Fusion's own `Application.isStartupComplete` flag.
|
|
1501
|
+
A sign-in or update dialog that prevents the probe from answering cannot be
|
|
1502
|
+
distinguished from a hang; readiness stays unverified.
|
|
1503
|
+
A timeout or failed probe reports `unresponsive`, `connected: false` and a plain
|
|
1504
|
+
`reason`. No open design is reported separately as `activeDesign: false` with a
|
|
1505
|
+
reason to open one. The probe is capped at five seconds, including MCP connection
|
|
1506
|
+
and discovery; the initial port check and optional launch wait are separate.
|
|
1507
|
+
This checks the command path, not whether every future design operation will succeed.
|
|
1508
|
+
With
|
|
1498
1509
|
`{"launch": true}`, it starts Fusion on macOS (`open -a "Autodesk Fusion" --env FUSION_MCP_PORT=<port>`)
|
|
1499
1510
|
when it is not running and waits up to 90 seconds for the add-in.
|
|
1500
1511
|
2. `fusion_mcp_call` takes `{tool_name, arguments?, timeout_ms?}` and passes the
|
|
@@ -45,6 +45,19 @@ export declare const FUSION_STATUS_OUTPUT_SCHEMA: {
|
|
|
45
45
|
type: string;
|
|
46
46
|
description: string;
|
|
47
47
|
};
|
|
48
|
+
responsive: {
|
|
49
|
+
type: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
state: {
|
|
53
|
+
type: string;
|
|
54
|
+
enum: string[];
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
reason: {
|
|
58
|
+
type: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
48
61
|
addinReachable: {
|
|
49
62
|
type: string;
|
|
50
63
|
description: string;
|
|
@@ -36,6 +36,7 @@ export const FUSION_MCP_DEFAULT_ARGS = Object.freeze([
|
|
|
36
36
|
]);
|
|
37
37
|
const DEFAULT_TIMEOUT_MS = 180000;
|
|
38
38
|
const MAX_TIMEOUT_MS = 600000;
|
|
39
|
+
const STATUS_PROBE_TIMEOUT_MS = 5000;
|
|
39
40
|
const LAUNCH_WAIT_MS = 90000;
|
|
40
41
|
const ADDIN_PING_MS = 2000;
|
|
41
42
|
const EXPORT_NAME = /^[A-Za-z0-9][A-Za-z0-9._ -]{0,99}$/;
|
|
@@ -229,7 +230,10 @@ export const FUSION_STATUS_OUTPUT_SCHEMA = {
|
|
|
229
230
|
type: "object",
|
|
230
231
|
properties: {
|
|
231
232
|
configured: { type: "boolean", description: "FUSION_MCP_COMMAND is set." },
|
|
232
|
-
connected: { type: "boolean", description: "The
|
|
233
|
+
connected: { type: "boolean", description: "The add-in answers and its command probe has not failed. Check state/ responsive for design readiness and activeDesign for an open document." },
|
|
234
|
+
responsive: { type: "boolean", description: "A fresh no-op through execute_code completed and Fusion reports startup complete; this does not guarantee a later design operation succeeds." },
|
|
235
|
+
state: { type: "string", enum: ["starting", "ready", "unresponsive"], description: "starting comes from Fusion's own isStartupComplete flag, ready requires the command probe, unresponsive means readiness could not be verified. See reason." },
|
|
236
|
+
reason: { type: "string", description: "Plain explanation and next step, provided by the MCP rather than inferred by clients." },
|
|
233
237
|
addinReachable: { type: "boolean", description: "The Fusion360MCP add-in answered a ping on FUSION_MCP_HOST:FUSION_MCP_PORT (default localhost:9877) within 2 s. Another program on that port, such as Blender's MCP add-on, does not count." },
|
|
234
238
|
fusionRunning: { type: "boolean" },
|
|
235
239
|
activeDesign: { type: "boolean", description: "When connected: whether Fusion has a design open, from the add-in's read-only get_design_type (false is its NO_ACTIVE_DESIGN). The pinned add-in refuses every design command, fusion_mcp_new_design included, without one (faust issue #12). Absent when unknown." },
|
|
@@ -240,7 +244,7 @@ export const FUSION_STATUS_OUTPUT_SCHEMA = {
|
|
|
240
244
|
server: { type: "object" },
|
|
241
245
|
error: { type: "string" },
|
|
242
246
|
},
|
|
243
|
-
required: ["configured", "connected", "addinReachable", "fusionRunning", "tools"],
|
|
247
|
+
required: ["configured", "connected", "responsive", "state", "reason", "addinReachable", "fusionRunning", "tools"],
|
|
244
248
|
};
|
|
245
249
|
export const FUSION_NEW_DESIGN_OUTPUT_SCHEMA = {
|
|
246
250
|
type: "object",
|
|
@@ -417,7 +421,7 @@ export class FusionMcpBridge {
|
|
|
417
421
|
allowedArguments(args, ["launch", "timeout_ms"]);
|
|
418
422
|
if (args.launch !== undefined && typeof args.launch !== "boolean")
|
|
419
423
|
throw new FusionError("launch must be a boolean.");
|
|
420
|
-
const timeout = timeoutMilliseconds(args.timeout_ms);
|
|
424
|
+
const timeout = Math.min(timeoutMilliseconds(args.timeout_ms), STATUS_PROBE_TIMEOUT_MS);
|
|
421
425
|
const { host, port } = addinAddress();
|
|
422
426
|
const configured = Boolean(process.env.FUSION_MCP_COMMAND?.trim());
|
|
423
427
|
let addinReachable = await this.system.addinAnswers(host, port, ADDIN_PING_MS);
|
|
@@ -442,7 +446,8 @@ export class FusionMcpBridge {
|
|
|
442
446
|
addinReachable = await this.system.addinAnswers(host, port, ADDIN_PING_MS);
|
|
443
447
|
}
|
|
444
448
|
}
|
|
445
|
-
const result = { configured, connected: false,
|
|
449
|
+
const result = { configured, connected: false, responsive: false, state: "unresponsive",
|
|
450
|
+
reason: configured ? "Fusion isn't responding on your Mac. Restart Fusion, then Try Again." : "Set up the Fusion MCP connection first.", addinReachable, fusionRunning, tools: [], launched, transport: "stdio", pin: FUSION_MCP_PIN };
|
|
446
451
|
if (!configured)
|
|
447
452
|
return result;
|
|
448
453
|
try {
|
|
@@ -473,9 +478,35 @@ export class FusionMcpBridge {
|
|
|
473
478
|
else if (errorKind(read, "get_design_type") === "NO_ACTIVE_DESIGN")
|
|
474
479
|
result.activeDesign = false;
|
|
475
480
|
}
|
|
481
|
+
if (result.connected === true) {
|
|
482
|
+
// At the pinned add-in execute_code traverses _MUTATION_COMMANDS snapshots and the same
|
|
483
|
+
// handler as design commands. A no-op tests that path without editing or opening a document.
|
|
484
|
+
// A late probe is harmless. Require this call's nonce; neither ping nor a design read proves readiness.
|
|
485
|
+
const nonce = randomUUID();
|
|
486
|
+
const code = `# BAMBU_FUSION status_probe
|
|
487
|
+
import json
|
|
488
|
+
json.dumps({"nonce": "${nonce}", "startupComplete": app.isStartupComplete})`;
|
|
489
|
+
const probe = await this.invoke(live, options, dispatched, "execute_code", { code });
|
|
490
|
+
if (errorKind(probe, "execute_code") === "NO_ACTIVE_DESIGN") {
|
|
491
|
+
result.activeDesign = false;
|
|
492
|
+
result.reason = "Open a design in Fusion, then Try Again.";
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
if (failed(probe, "execute_code"))
|
|
496
|
+
throw new FusionError("Fusion's command readiness probe failed.");
|
|
497
|
+
const receipt = argumentObject(codeJson(probe), "Fusion readiness receipt");
|
|
498
|
+
if (receipt.nonce !== nonce || typeof receipt.startupComplete !== "boolean") {
|
|
499
|
+
throw new FusionError("Fusion did not return this command readiness probe's receipt.");
|
|
500
|
+
}
|
|
501
|
+
result.responsive = receipt.startupComplete;
|
|
502
|
+
result.connected = receipt.startupComplete;
|
|
503
|
+
result.state = receipt.startupComplete ? "ready" : "starting";
|
|
504
|
+
result.reason = receipt.startupComplete ? "Fusion's command path is responding." : "Fusion is still starting. Finish any sign-in or update dialog, then Try Again.";
|
|
505
|
+
}
|
|
476
506
|
});
|
|
477
507
|
}
|
|
478
508
|
catch (error) {
|
|
509
|
+
result.connected = false;
|
|
479
510
|
result.error = error instanceof Error ? error.message : String(error);
|
|
480
511
|
}
|
|
481
512
|
return result;
|
package/dist/index.js
CHANGED
|
@@ -3200,12 +3200,12 @@ class BambuPrinterMCPServer {
|
|
|
3200
3200
|
},
|
|
3201
3201
|
{
|
|
3202
3202
|
name: "fusion_mcp_status",
|
|
3203
|
-
description: `Check Autodesk Fusion through the configured Fusion MCP server (fusion360-mcp-server, faust-machines or the pinned fork with document binding): whether it is configured, Fusion is running, the Fusion360MCP add-in answers on its port, and the server's tools and schemas.
|
|
3203
|
+
description: `Check Autodesk Fusion through the configured Fusion MCP server (fusion360-mcp-server, faust-machines or the pinned fork with document binding): whether it is configured, Fusion is running, the Fusion360MCP add-in answers on its port, and the server's tools and schemas. Reports state (starting, ready, unresponsive), responsive and reason from a fresh no-op execute_code command probe, capped at 5 s; a ping or design read alone is not readiness. The probe never edits or opens a document. With launch: true, starts Fusion on macOS when it is not running and waits up to 90 s for the add-in. Configure FUSION_MCP_COMMAND (uvx) and FUSION_MCP_ARGS (${JSON.stringify(FUSION_MCP_DEFAULT_ARGS)}), or run fusion_mcp_setup.`,
|
|
3204
3204
|
inputSchema: {
|
|
3205
3205
|
type: "object",
|
|
3206
3206
|
properties: {
|
|
3207
3207
|
launch: { type: "boolean", description: "Start Autodesk Fusion (open -a \"Autodesk Fusion\") when it is not running, then wait up to 90 s for the add-in." },
|
|
3208
|
-
timeout_ms: { type: "integer", minimum: 100, maximum: 600000, description: "Connection and
|
|
3208
|
+
timeout_ms: { type: "integer", minimum: 100, maximum: 600000, description: "Connection, discovery and command-probe deadline, capped at 5000 ms even if a larger value is requested. Launch waiting is separate." }
|
|
3209
3209
|
},
|
|
3210
3210
|
additionalProperties: false
|
|
3211
3211
|
},
|
package/package.json
CHANGED
package/src/fusion-mcp-bridge.ts
CHANGED
|
@@ -38,6 +38,7 @@ export const FUSION_MCP_DEFAULT_ARGS = Object.freeze([
|
|
|
38
38
|
]);
|
|
39
39
|
const DEFAULT_TIMEOUT_MS = 180_000;
|
|
40
40
|
const MAX_TIMEOUT_MS = 600_000;
|
|
41
|
+
const STATUS_PROBE_TIMEOUT_MS = 5_000;
|
|
41
42
|
const LAUNCH_WAIT_MS = 90_000;
|
|
42
43
|
const ADDIN_PING_MS = 2_000;
|
|
43
44
|
const EXPORT_NAME = /^[A-Za-z0-9][A-Za-z0-9._ -]{0,99}$/;
|
|
@@ -244,7 +245,10 @@ export const FUSION_STATUS_OUTPUT_SCHEMA = {
|
|
|
244
245
|
type: "object" as const,
|
|
245
246
|
properties: {
|
|
246
247
|
configured: { type: "boolean", description: "FUSION_MCP_COMMAND is set." },
|
|
247
|
-
connected: { type: "boolean", description: "The
|
|
248
|
+
connected: { type: "boolean", description: "The add-in answers and its command probe has not failed. Check state/ responsive for design readiness and activeDesign for an open document." },
|
|
249
|
+
responsive: { type: "boolean", description: "A fresh no-op through execute_code completed and Fusion reports startup complete; this does not guarantee a later design operation succeeds." },
|
|
250
|
+
state: { type: "string", enum: ["starting", "ready", "unresponsive"], description: "starting comes from Fusion's own isStartupComplete flag, ready requires the command probe, unresponsive means readiness could not be verified. See reason." },
|
|
251
|
+
reason: { type: "string", description: "Plain explanation and next step, provided by the MCP rather than inferred by clients." },
|
|
248
252
|
addinReachable: { type: "boolean", description: "The Fusion360MCP add-in answered a ping on FUSION_MCP_HOST:FUSION_MCP_PORT (default localhost:9877) within 2 s. Another program on that port, such as Blender's MCP add-on, does not count." },
|
|
249
253
|
fusionRunning: { type: "boolean" },
|
|
250
254
|
activeDesign: { type: "boolean", description: "When connected: whether Fusion has a design open, from the add-in's read-only get_design_type (false is its NO_ACTIVE_DESIGN). The pinned add-in refuses every design command, fusion_mcp_new_design included, without one (faust issue #12). Absent when unknown." },
|
|
@@ -255,7 +259,7 @@ export const FUSION_STATUS_OUTPUT_SCHEMA = {
|
|
|
255
259
|
server: { type: "object" },
|
|
256
260
|
error: { type: "string" },
|
|
257
261
|
},
|
|
258
|
-
required: ["configured", "connected", "addinReachable", "fusionRunning", "tools"],
|
|
262
|
+
required: ["configured", "connected", "responsive", "state", "reason", "addinReachable", "fusionRunning", "tools"],
|
|
259
263
|
};
|
|
260
264
|
|
|
261
265
|
|
|
@@ -425,7 +429,7 @@ export class FusionMcpBridge {
|
|
|
425
429
|
async status(args: Arguments, signal?: AbortSignal): Promise<Record<string, unknown>> {
|
|
426
430
|
allowedArguments(args, ["launch", "timeout_ms"]);
|
|
427
431
|
if (args.launch !== undefined && typeof args.launch !== "boolean") throw new FusionError("launch must be a boolean.");
|
|
428
|
-
const timeout = timeoutMilliseconds(args.timeout_ms);
|
|
432
|
+
const timeout = Math.min(timeoutMilliseconds(args.timeout_ms), STATUS_PROBE_TIMEOUT_MS);
|
|
429
433
|
const { host, port } = addinAddress();
|
|
430
434
|
const configured = Boolean(process.env.FUSION_MCP_COMMAND?.trim());
|
|
431
435
|
let addinReachable = await this.system.addinAnswers(host, port, ADDIN_PING_MS);
|
|
@@ -444,7 +448,8 @@ export class FusionMcpBridge {
|
|
|
444
448
|
addinReachable = await this.system.addinAnswers(host, port, ADDIN_PING_MS);
|
|
445
449
|
}
|
|
446
450
|
}
|
|
447
|
-
const result: Record<string, unknown> = { configured, connected: false,
|
|
451
|
+
const result: Record<string, unknown> = { configured, connected: false, responsive: false, state: "unresponsive",
|
|
452
|
+
reason: configured ? "Fusion isn't responding on your Mac. Restart Fusion, then Try Again." : "Set up the Fusion MCP connection first.", addinReachable, fusionRunning, tools: [], launched, transport: "stdio", pin: FUSION_MCP_PIN };
|
|
448
453
|
if (!configured) return result;
|
|
449
454
|
try {
|
|
450
455
|
await this.request({ timeout, signal }, async (live, options, dispatched) => {
|
|
@@ -467,8 +472,33 @@ export class FusionMcpBridge {
|
|
|
467
472
|
if (!failed(read, "get_design_type")) result.activeDesign = true;
|
|
468
473
|
else if (errorKind(read, "get_design_type") === "NO_ACTIVE_DESIGN") result.activeDesign = false;
|
|
469
474
|
}
|
|
475
|
+
if (result.connected === true) {
|
|
476
|
+
// At the pinned add-in execute_code traverses _MUTATION_COMMANDS snapshots and the same
|
|
477
|
+
// handler as design commands. A no-op tests that path without editing or opening a document.
|
|
478
|
+
// A late probe is harmless. Require this call's nonce; neither ping nor a design read proves readiness.
|
|
479
|
+
const nonce = randomUUID();
|
|
480
|
+
const code = `# BAMBU_FUSION status_probe
|
|
481
|
+
import json
|
|
482
|
+
json.dumps({"nonce": "${nonce}", "startupComplete": app.isStartupComplete})`;
|
|
483
|
+
const probe = await this.invoke(live, options, dispatched, "execute_code", { code });
|
|
484
|
+
if (errorKind(probe, "execute_code") === "NO_ACTIVE_DESIGN") {
|
|
485
|
+
result.activeDesign = false;
|
|
486
|
+
result.reason = "Open a design in Fusion, then Try Again.";
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
if (failed(probe, "execute_code")) throw new FusionError("Fusion's command readiness probe failed.");
|
|
490
|
+
const receipt = argumentObject(codeJson(probe), "Fusion readiness receipt");
|
|
491
|
+
if (receipt.nonce !== nonce || typeof receipt.startupComplete !== "boolean") {
|
|
492
|
+
throw new FusionError("Fusion did not return this command readiness probe's receipt.");
|
|
493
|
+
}
|
|
494
|
+
result.responsive = receipt.startupComplete;
|
|
495
|
+
result.connected = receipt.startupComplete;
|
|
496
|
+
result.state = receipt.startupComplete ? "ready" : "starting";
|
|
497
|
+
result.reason = receipt.startupComplete ? "Fusion's command path is responding." : "Fusion is still starting. Finish any sign-in or update dialog, then Try Again.";
|
|
498
|
+
}
|
|
470
499
|
});
|
|
471
500
|
} catch (error) {
|
|
501
|
+
result.connected = false;
|
|
472
502
|
result.error = error instanceof Error ? error.message : String(error);
|
|
473
503
|
}
|
|
474
504
|
return result;
|
package/src/index.ts
CHANGED
|
@@ -3709,12 +3709,12 @@ class BambuPrinterMCPServer {
|
|
|
3709
3709
|
},
|
|
3710
3710
|
{
|
|
3711
3711
|
name: "fusion_mcp_status",
|
|
3712
|
-
description: `Check Autodesk Fusion through the configured Fusion MCP server (fusion360-mcp-server, faust-machines or the pinned fork with document binding): whether it is configured, Fusion is running, the Fusion360MCP add-in answers on its port, and the server's tools and schemas.
|
|
3712
|
+
description: `Check Autodesk Fusion through the configured Fusion MCP server (fusion360-mcp-server, faust-machines or the pinned fork with document binding): whether it is configured, Fusion is running, the Fusion360MCP add-in answers on its port, and the server's tools and schemas. Reports state (starting, ready, unresponsive), responsive and reason from a fresh no-op execute_code command probe, capped at 5 s; a ping or design read alone is not readiness. The probe never edits or opens a document. With launch: true, starts Fusion on macOS when it is not running and waits up to 90 s for the add-in. Configure FUSION_MCP_COMMAND (uvx) and FUSION_MCP_ARGS (${JSON.stringify(FUSION_MCP_DEFAULT_ARGS)}), or run fusion_mcp_setup.`,
|
|
3713
3713
|
inputSchema: {
|
|
3714
3714
|
type: "object",
|
|
3715
3715
|
properties: {
|
|
3716
3716
|
launch: { type: "boolean", description: "Start Autodesk Fusion (open -a \"Autodesk Fusion\") when it is not running, then wait up to 90 s for the add-in." },
|
|
3717
|
-
timeout_ms: { type: "integer", minimum: 100, maximum: 600000, description: "Connection and
|
|
3717
|
+
timeout_ms: { type: "integer", minimum: 100, maximum: 600000, description: "Connection, discovery and command-probe deadline, capped at 5000 ms even if a larger value is requested. Launch waiting is separate." }
|
|
3718
3718
|
},
|
|
3719
3719
|
additionalProperties: false
|
|
3720
3720
|
},
|