bambu-printer-mcp 1.1.66 → 1.1.68
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 +40 -5
- package/dist/bambu-network-bridge.d.ts +51 -1
- package/dist/bambu-network-bridge.js +230 -20
- package/dist/counterpart/remote.js +4 -0
- package/dist/counterpart/setup.d.ts +2 -2
- package/dist/design-app-setup.d.ts +384 -0
- package/dist/design-app-setup.js +654 -0
- package/dist/design-guidance.d.ts +14 -0
- package/dist/design-guidance.js +27 -1
- package/dist/fusion-mcp-bridge.d.ts +11 -2
- package/dist/fusion-mcp-bridge.js +9 -4
- package/dist/index.js +58 -6
- package/dist/safety/artifact.d.ts +5 -2
- package/dist/safety/artifact.js +6 -3
- package/dist/tool-annotations.js +4 -0
- package/package.json +1 -1
- package/src/bambu-network-bridge.ts +227 -24
- package/src/counterpart/remote.ts +4 -0
- package/src/design-app-setup.ts +640 -0
- package/src/design-guidance.ts +30 -1
- package/src/fusion-mcp-bridge.ts +9 -4
- package/src/index.ts +58 -6
- package/src/safety/artifact.ts +6 -3
- package/src/tool-annotations.ts +4 -0
|
@@ -23,4 +23,18 @@ export declare const FDM_CAPABILITY_RESOURCE: {
|
|
|
23
23
|
description: string;
|
|
24
24
|
};
|
|
25
25
|
export declare const DESIGN_PROMPTS: DesignPrompt[];
|
|
26
|
+
/**
|
|
27
|
+
* How this server's configured slicer orients, makes supports and checks a slice: the slicer-specific half of a
|
|
28
|
+
* design pass's print plan (the fdm_slicing prompt). `capabilities` is what slice_stl applies on that backend, as
|
|
29
|
+
* counterpart_printer_info reports it.
|
|
30
|
+
*/
|
|
31
|
+
export declare function slicingGuidance(slicerType: string, capabilities: {
|
|
32
|
+
supports: boolean;
|
|
33
|
+
orient: boolean;
|
|
34
|
+
}): string;
|
|
35
|
+
export declare const FDM_SLICING_PROMPT: {
|
|
36
|
+
name: string;
|
|
37
|
+
title: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
26
40
|
export declare const SERVER_INSTRUCTIONS: string;
|
package/dist/design-guidance.js
CHANGED
|
@@ -174,4 +174,30 @@ export const DESIGN_PROMPTS = [
|
|
|
174
174
|
{ name: "fdm_after_slice", title: "Review a slice", text: FDM_AFTER_SLICE,
|
|
175
175
|
description: "A separate review turn after a candidate has been sliced, before presenting the manufacturing recommendation: keep, revise, or validate one specific uncertainty." },
|
|
176
176
|
];
|
|
177
|
-
|
|
177
|
+
const SLICER_NAMES = {
|
|
178
|
+
bambustudio: "Bambu Studio", orcaslicer: "OrcaSlicer", "orcaslicer-bambulab": "FULU OrcaSlicer-bambulab",
|
|
179
|
+
"orca-slicer-api": "the remote OrcaSlicer service (orca-slicer-api)", prusaslicer: "PrusaSlicer", cura: "Cura", slic3r: "Slic3r",
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* How this server's configured slicer orients, makes supports and checks a slice: the slicer-specific half of a
|
|
183
|
+
* design pass's print plan (the fdm_slicing prompt). `capabilities` is what slice_stl applies on that backend, as
|
|
184
|
+
* counterpart_printer_info reports it.
|
|
185
|
+
*/
|
|
186
|
+
export function slicingGuidance(slicerType, capabilities) {
|
|
187
|
+
const slicer = SLICER_NAMES[slicerType] ?? slicerType;
|
|
188
|
+
const lines = [
|
|
189
|
+
`How this printer MCP slices. Its slicer is ${slicer}.`,
|
|
190
|
+
"- When they could change a decision, read the printer's loaded filaments with get_printer_filaments and its slicing settings with get_slice_settings.",
|
|
191
|
+
"- To check a consequential choice, slice a checkpoint with slice_stl and read its structured slicer_result (return code, error and each plate's warning), not only the file path. A checkpoint is only a check: the print slices the exported model again.",
|
|
192
|
+
capabilities.orient
|
|
193
|
+
? `- Orientation: slice_stl with orient true lets ${slicer}'s own auto-orient choose how an STL sits on the bed. It keeps overhang area low; it does not check cantilevers. To see what it chooses, slice the checkpoint with orient true. When a print is oriented this way, don't promise a particular orientation on the bed: the slicer chooses it.`
|
|
194
|
+
: `- Orientation: ${slicer} doesn't auto-orient here. An STL prints in the orientation it's exported in.`,
|
|
195
|
+
capabilities.supports
|
|
196
|
+
? "- Supports: set enable_support on every slice_stl call. With enable_support true it generates supports in the style support_type names (tree(auto) or normal(auto)); with false it generates none; left out, the process preset's own setting applies. Slice the checkpoint with enable_support set the way the print will be sliced. A print gets the supports it was sliced with: print the sliced file itself, or slice the print with slice_stl and the same enable_support and support_type. print_3mf's own slicing of a file that isn't sliced yet takes no support settings; it uses the process profile's."
|
|
197
|
+
: `- Supports: ${slicer} takes no support settings from slice_stl here: whether it generates supports is its configured profile's own setting. Slice a checkpoint to see what that profile does before modeling any support yourself.`,
|
|
198
|
+
];
|
|
199
|
+
return lines.join("\n");
|
|
200
|
+
}
|
|
201
|
+
export const FDM_SLICING_PROMPT = { name: "fdm_slicing", title: "How this MCP slices",
|
|
202
|
+
description: "Add to every design or model-editing task: how this server's slicer orients a model and generates supports, and how to check a choice with a checkpoint slice." };
|
|
203
|
+
export const SERVER_INSTRUCTIONS = "When designing or editing a model to print, apply the fdm_design prompt and the fdm_slicing prompt. Add fdm_multicolor when several colours or support materials share a print, fdm_assembly when a split or joint could help, and fdm_after_slice as a separate review turn after a candidate has been sliced, before presenting the manufacturing recommendation. Read " + FDM_CAPABILITY_URI + " when a bridge or overhang is consequential and there is no sufficiently specific measured capability available.";
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The server and add-in commit fusion_mcp_setup installs (FUSION_ADDIN_COMMIT): David Montgomery's fork of
|
|
4
|
+
* faust-machines/fusion360-mcp-server with document binding, which fusion_mcp_new_design's bind_document needs, while
|
|
5
|
+
* that change is reviewed upstream. Move it only after the Counterpart PRD §8.9 acceptance check passes.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FUSION_MCP_PIN: string;
|
|
4
8
|
/** PRD §8.9: Blender's MCP add-on holds the add-in's own default, 9876, so Counterpart's Fusion uses 9877. */
|
|
5
9
|
export declare const FUSION_ADDIN_DEFAULT_PORT = 9877;
|
|
6
10
|
export declare const FUSION_MCP_DEFAULT_ARGS: readonly string[];
|
|
@@ -25,6 +29,11 @@ export type FusionSystem = {
|
|
|
25
29
|
*/
|
|
26
30
|
export declare function fusionLaunchArguments(port: number): string[];
|
|
27
31
|
export declare const defaultFusionSystem: FusionSystem;
|
|
32
|
+
/** Where the add-in listens: faust reads FUSION_MCP_HOST and FUSION_MCP_PORT too. */
|
|
33
|
+
export declare function addinAddress(): {
|
|
34
|
+
host: string;
|
|
35
|
+
port: number;
|
|
36
|
+
};
|
|
28
37
|
export declare const FUSION_STATUS_OUTPUT_SCHEMA: {
|
|
29
38
|
type: "object";
|
|
30
39
|
properties: {
|
|
@@ -20,13 +20,18 @@ import net from "node:net";
|
|
|
20
20
|
import path from "node:path";
|
|
21
21
|
import { promisify } from "node:util";
|
|
22
22
|
import { stlMetadata } from "./blender-mcp-bridge.js";
|
|
23
|
+
import { FUSION_ADDIN_COMMIT, FUSION_ADDIN_REPOSITORY } from "./design-app-setup.js";
|
|
23
24
|
const execFileAsync = promisify(execFile);
|
|
24
|
-
/**
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* The server and add-in commit fusion_mcp_setup installs (FUSION_ADDIN_COMMIT): David Montgomery's fork of
|
|
27
|
+
* faust-machines/fusion360-mcp-server with document binding, which fusion_mcp_new_design's bind_document needs, while
|
|
28
|
+
* that change is reviewed upstream. Move it only after the Counterpart PRD §8.9 acceptance check passes.
|
|
29
|
+
*/
|
|
30
|
+
export const FUSION_MCP_PIN = FUSION_ADDIN_COMMIT.slice(0, 12);
|
|
26
31
|
/** PRD §8.9: Blender's MCP add-on holds the add-in's own default, 9876, so Counterpart's Fusion uses 9877. */
|
|
27
32
|
export const FUSION_ADDIN_DEFAULT_PORT = 9877;
|
|
28
33
|
export const FUSION_MCP_DEFAULT_ARGS = Object.freeze([
|
|
29
|
-
"--from", `git+https://github.com
|
|
34
|
+
"--from", `git+https://github.com/${FUSION_ADDIN_REPOSITORY}@${FUSION_MCP_PIN}`,
|
|
30
35
|
"fusion360-mcp-server", "--mode", "socket",
|
|
31
36
|
]);
|
|
32
37
|
const DEFAULT_TIMEOUT_MS = 180000;
|
|
@@ -149,7 +154,7 @@ function configuration() {
|
|
|
149
154
|
return { command, args };
|
|
150
155
|
}
|
|
151
156
|
/** Where the add-in listens: faust reads FUSION_MCP_HOST and FUSION_MCP_PORT too. */
|
|
152
|
-
function addinAddress() {
|
|
157
|
+
export function addinAddress() {
|
|
153
158
|
const host = process.env.FUSION_MCP_HOST?.trim() || "localhost";
|
|
154
159
|
const port = Number(process.env.FUSION_MCP_PORT?.trim() || FUSION_ADDIN_DEFAULT_PORT);
|
|
155
160
|
return { host, port: Number.isInteger(port) && port > 0 && port < 65536 ? port : FUSION_ADDIN_DEFAULT_PORT };
|
package/dist/index.js
CHANGED
|
@@ -23,11 +23,12 @@ import path from "path";
|
|
|
23
23
|
import { createServer as createHttpServer } from "node:http";
|
|
24
24
|
import { createHash, randomUUID } from "node:crypto";
|
|
25
25
|
import { STLManipulator, SLICER_TYPES, normalizeSlicerType, SlicerRunError, } from "./stl/stl-manipulator.js";
|
|
26
|
-
import { BambuNetworkBridge, describeBambuNetworkPrintError } from "./bambu-network-bridge.js";
|
|
26
|
+
import { BambuNetworkBridge, bridgeSnapshotRoot, describeBambuNetworkPrintError } from "./bambu-network-bridge.js";
|
|
27
27
|
import { assertBambuNativeAvailable, bambuNativeControlsAvailable, bambuNativeUnavailableReason, interruptNativeOperations, validateBambuNativeMetadata, buildBambuNativeFanCommand, buildBambuNativeTemperatureCommand, printWithBambuNative, sendCommandWithBambuNative, uploadWithBambuNative, } from "./bambu-native.js";
|
|
28
28
|
import { importFileViaBambuConnect } from "./bambu-connect.js";
|
|
29
29
|
import { BlenderMcpBridge } from "./blender-mcp-bridge.js";
|
|
30
|
-
import { FUSION_EXPORT_OUTPUT_SCHEMA, FUSION_MCP_DEFAULT_ARGS, FUSION_NEW_DESIGN_OUTPUT_SCHEMA, FUSION_STATUS_OUTPUT_SCHEMA, FusionMcpBridge } from "./fusion-mcp-bridge.js";
|
|
30
|
+
import { FUSION_EXPORT_OUTPUT_SCHEMA, FUSION_MCP_DEFAULT_ARGS, FUSION_MCP_PIN, FUSION_NEW_DESIGN_OUTPUT_SCHEMA, FUSION_STATUS_OUTPUT_SCHEMA, FusionMcpBridge, addinAddress } from "./fusion-mcp-bridge.js";
|
|
31
|
+
import { BLENDER_SETUP_OUTPUT_SCHEMA, BlenderAddonSetup, FUSION_ADDIN_REPOSITORY, FUSION_SETUP_OUTPUT_SCHEMA, FusionAddinSetup, defaultSetupSystem, parseAddonHandshake } from "./design-app-setup.js";
|
|
31
32
|
import { bridgeAmsMapping2Entry, bridgeAmsMappingValue, externalTrayForNozzle, hasAmsMappingInput, normalizeAmsMappingObject, normalizeBridgeAmsTrayValue, studioAmsMappingInfo, trayColour } from "./ams-mapping.js";
|
|
32
33
|
import { analyze3MFAmsRequirements, analyze3MFPlateObjects, analyzeCollarCharm3MF, extractBambuTemplateSettings, getCollarCharmRolePolicy, hasBambuProjectSettings, hasSlicerSettingsFile, parse3MF, withExtractedSettingsCleanup } from './3mf_parser.js';
|
|
33
34
|
import { BambuImplementation, assertDirectPrintSupported, checkedFile, defaultResumeStateDir } from "./printers/bambu.js";
|
|
@@ -43,7 +44,7 @@ import { bambuPrinterInfo, bambuSliceCapabilities } from "./counterpart/info.js"
|
|
|
43
44
|
import { DISCOVER_OUTPUT_SCHEMA, discoverBambu } from "./counterpart/discovery.js";
|
|
44
45
|
import { SETUP_FIELDS_OUTPUT_SCHEMA, bambuSetupFields, slicerSetup } from "./counterpart/setup.js";
|
|
45
46
|
import { PROPOSE_FILAMENTS_INPUT_PROPERTIES, PROPOSE_FILAMENTS_OUTPUT_SCHEMA, NO_COLOUR_NAMES, bambuTrayLabel, loadColourNames, proposeFilaments, spoolName } from "./counterpart/filaments.js";
|
|
46
|
-
import { DESIGN_PROMPTS, FDM_CAPABILITY_GUIDANCE, FDM_CAPABILITY_RESOURCE, FDM_CAPABILITY_URI, SERVER_INSTRUCTIONS } from "./design-guidance.js";
|
|
47
|
+
import { DESIGN_PROMPTS, FDM_CAPABILITY_GUIDANCE, FDM_CAPABILITY_RESOURCE, FDM_CAPABILITY_URI, FDM_SLICING_PROMPT, SERVER_INSTRUCTIONS, slicingGuidance } from "./design-guidance.js";
|
|
47
48
|
import { bambuProgress, offlineProgress } from "./counterpart/progress.js";
|
|
48
49
|
import { makeCounterpart3mf } from "./counterpart/make-3mf.js";
|
|
49
50
|
import { MAKE_3MF_OUTPUT_SCHEMA, PRINT_PROGRESS_OUTPUT_SCHEMA, PRINTER_INFO_OUTPUT_SCHEMA } from "./counterpart/schemas.js";
|
|
@@ -1108,6 +1109,9 @@ class BambuPrinterMCPServer {
|
|
|
1108
1109
|
constructor() {
|
|
1109
1110
|
this.blender = new BlenderMcpBridge();
|
|
1110
1111
|
this.fusion = new FusionMcpBridge();
|
|
1112
|
+
// Downloads and installer output are staged in this server's own temporary folder.
|
|
1113
|
+
this.blenderSetup = new BlenderAddonSetup(() => this.blenderAddonHandshake(), { ...defaultSetupSystem, tmp: TEMP_DIR });
|
|
1114
|
+
this.fusionSetup = new FusionAddinSetup(() => addinAddress().port, FUSION_MCP_DEFAULT_ARGS, { ...defaultSetupSystem, tmp: TEMP_DIR });
|
|
1111
1115
|
this.shuttingDown = false;
|
|
1112
1116
|
this.confirmationTimeoutMs = parseConfirmationTimeout(process.env.BAMBU_CONFIRMATION_TIMEOUT_MS);
|
|
1113
1117
|
this.runtimeConfig = readRuntimeConfig();
|
|
@@ -1160,6 +1164,14 @@ class BambuPrinterMCPServer {
|
|
|
1160
1164
|
this.setupPromptHandlers();
|
|
1161
1165
|
this.setupToolHandlers();
|
|
1162
1166
|
}
|
|
1167
|
+
/** The running Blender add-on's get_addon_status, read through this server's Blender bridge (undefined when it has none). */
|
|
1168
|
+
async blenderAddonHandshake() {
|
|
1169
|
+
const signal = AbortSignal.timeout(20000);
|
|
1170
|
+
const status = await this.blender.status({ connect: true, timeout_ms: 15000 }, signal);
|
|
1171
|
+
if (status?.connected !== true || !status.tools?.some(tool => tool.name === "get_addon_status"))
|
|
1172
|
+
return undefined;
|
|
1173
|
+
return parseAddonHandshake(await this.blender.call({ tool_name: "get_addon_status", arguments: {}, timeout_ms: 15000 }, signal));
|
|
1174
|
+
}
|
|
1163
1175
|
/**
|
|
1164
1176
|
* The model for display-only counterpart tools: the argument, then the
|
|
1165
1177
|
* configured model, then the serial prefix. Never a safety decision and
|
|
@@ -1602,7 +1614,7 @@ class BambuPrinterMCPServer {
|
|
|
1602
1614
|
amsMapping: mapping,
|
|
1603
1615
|
params: redactPrintParams(params),
|
|
1604
1616
|
};
|
|
1605
|
-
}));
|
|
1617
|
+
}, bridgeSnapshotRoot()));
|
|
1606
1618
|
}
|
|
1607
1619
|
async handoff3mfViaBambuConnect(args) {
|
|
1608
1620
|
if (!args?.three_mf_path) {
|
|
@@ -1862,9 +1874,17 @@ class BambuPrinterMCPServer {
|
|
|
1862
1874
|
/** The FDM design guidance as MCP prompts: the client decides when to attach each one. */
|
|
1863
1875
|
setupPromptHandlers() {
|
|
1864
1876
|
this.server.setRequestHandler(ListPromptsRequestSchema, async () => ({
|
|
1865
|
-
prompts: DESIGN_PROMPTS.map(({ name, title, description }) => ({ name, title, description })),
|
|
1877
|
+
prompts: [...DESIGN_PROMPTS, FDM_SLICING_PROMPT].map(({ name, title, description }) => ({ name, title, description })),
|
|
1866
1878
|
}));
|
|
1867
1879
|
this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
1880
|
+
if (request.params.name === FDM_SLICING_PROMPT.name) {
|
|
1881
|
+
// The slicer slice_stl uses by default, and what it applies there (as counterpart_printer_info reports it).
|
|
1882
|
+
const slicerType = normalizeSlicerType(DEFAULT_SLICER_TYPE);
|
|
1883
|
+
return {
|
|
1884
|
+
description: FDM_SLICING_PROMPT.description,
|
|
1885
|
+
messages: [{ role: "user", content: { type: "text", text: slicingGuidance(slicerType, bambuSliceCapabilities(slicerType)) } }],
|
|
1886
|
+
};
|
|
1887
|
+
}
|
|
1868
1888
|
const prompt = DESIGN_PROMPTS.find(item => item.name === request.params.name);
|
|
1869
1889
|
if (!prompt)
|
|
1870
1890
|
throw new McpError(ErrorCode.InvalidParams, `Unknown prompt: ${request.params.name}`);
|
|
@@ -3085,9 +3105,29 @@ class BambuPrinterMCPServer {
|
|
|
3085
3105
|
},
|
|
3086
3106
|
outputSchema: MAKE_3MF_OUTPUT_SCHEMA
|
|
3087
3107
|
},
|
|
3108
|
+
{
|
|
3109
|
+
name: "blender_mcp_setup",
|
|
3110
|
+
description: "Check or update the MCP for Blender add-on that the configured Blender bridge (BLENDER_MCP_COMMAND uvx, BLENDER_MCP_ARGS naming mcp-for-blender or blender-mcp) needs. Without update: which add-on file Blender loads, its protocol and the protocol the package expects, whether Blender is listening and the running add-on's own handshake. Changes nothing. With update: true, stages the add-on with the package's own installer (mcp-for-blender install-addon) at the inspected version, checks it, keeps the old file as a backup next to it and renames the new one into place. Never starts, stops or edits Blender; a running Blender uses the new add-on once it is re-enabled or restarted. A custom bridge returns supported false.",
|
|
3111
|
+
inputSchema: {
|
|
3112
|
+
type: "object",
|
|
3113
|
+
properties: { update: { type: "boolean", description: "Replace the installed add-on with the package's own (default false: check only)." } },
|
|
3114
|
+
additionalProperties: false
|
|
3115
|
+
},
|
|
3116
|
+
outputSchema: BLENDER_SETUP_OUTPUT_SCHEMA
|
|
3117
|
+
},
|
|
3118
|
+
{
|
|
3119
|
+
name: "fusion_mcp_setup",
|
|
3120
|
+
description: `Check or install what the Fusion bridge needs on macOS: Autodesk Fusion itself (found, never installed), the Fusion360MCP add-in from ${FUSION_ADDIN_REPOSITORY} at ${FUSION_MCP_PIN} (every file checked against its pinned SHA-256) set to run on startup, a login item that sets FUSION_MCP_PORT for Fusion however it is opened, and this server's FUSION_MCP_* settings. Without install: reports them and changes nothing. With install: true, installs what is missing and adds the missing settings to this server's own .env (after a copy of it), keeping a configured FUSION_MCP_COMMAND and its arguments. Never starts or quits Fusion; check the connection with fusion_mcp_status.`,
|
|
3121
|
+
inputSchema: {
|
|
3122
|
+
type: "object",
|
|
3123
|
+
properties: { install: { type: "boolean", description: "Install what is missing (default false: check only)." } },
|
|
3124
|
+
additionalProperties: false
|
|
3125
|
+
},
|
|
3126
|
+
outputSchema: FUSION_SETUP_OUTPUT_SCHEMA
|
|
3127
|
+
},
|
|
3088
3128
|
{
|
|
3089
3129
|
name: "fusion_mcp_status",
|
|
3090
|
-
description: `Check Autodesk Fusion through the configured Fusion MCP server (
|
|
3130
|
+
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. connected is true only when the add-in answers. 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.`,
|
|
3091
3131
|
inputSchema: {
|
|
3092
3132
|
type: "object",
|
|
3093
3133
|
properties: {
|
|
@@ -4299,6 +4339,16 @@ class BambuPrinterMCPServer {
|
|
|
4299
4339
|
case "counterpart_make_3mf":
|
|
4300
4340
|
result = await makeCounterpart3mf(args ?? {});
|
|
4301
4341
|
break;
|
|
4342
|
+
case "blender_mcp_setup":
|
|
4343
|
+
if (args?.update !== undefined && typeof args.update !== "boolean")
|
|
4344
|
+
throw new Error("update must be a boolean.");
|
|
4345
|
+
result = args?.update === true ? await this.blenderSetup.update(extra.signal) : await this.blenderSetup.check();
|
|
4346
|
+
break;
|
|
4347
|
+
case "fusion_mcp_setup":
|
|
4348
|
+
if (args?.install !== undefined && typeof args.install !== "boolean")
|
|
4349
|
+
throw new Error("install must be a boolean.");
|
|
4350
|
+
result = args?.install === true ? await this.fusionSetup.install(extra.signal) : await this.fusionSetup.check();
|
|
4351
|
+
break;
|
|
4302
4352
|
case "fusion_mcp_status":
|
|
4303
4353
|
result = await this.fusion.status(args ?? {}, extra.signal);
|
|
4304
4354
|
break;
|
|
@@ -4374,6 +4424,8 @@ class BambuPrinterMCPServer {
|
|
|
4374
4424
|
// Closing the MCP transport aborts its active requests before exit cleanup.
|
|
4375
4425
|
await this.server.close();
|
|
4376
4426
|
await this.fusion.close();
|
|
4427
|
+
// The FULU host's container (BAMBU_NETWORK_BRIDGE_IMAGE) is removed with the server, not left running.
|
|
4428
|
+
await this.bambuNetwork.stop();
|
|
4377
4429
|
this.httpRuntime?.httpServer.close();
|
|
4378
4430
|
}
|
|
4379
4431
|
catch (error) {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare function cancelPendingPrinterOperations(_host: string, serial: string): void;
|
|
2
2
|
export declare function withPrinterOperation<T>(_host: string, serial: string, operation: (assertActive: () => void) => Promise<T>): Promise<T>;
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Inspect and send a private copy, so changes to the user's source cannot change the job. `root` is where the copy
|
|
5
|
+
* goes (the system temporary folder unless the bridge host needs it in a folder its container mounts).
|
|
6
|
+
*/
|
|
7
|
+
export declare function withPrintSnapshot<T>(source: string, operation: (snapshot: string, retainForDispatchedUpload: () => void) => Promise<T>, root?: string): Promise<T>;
|
|
5
8
|
export declare function uniquePrintName(filename: string): string;
|
|
6
9
|
export declare function normalizedRemotePath(filename: string): string;
|
package/dist/safety/artifact.js
CHANGED
|
@@ -36,9 +36,12 @@ export async function withPrinterOperation(_host, serial, operation) {
|
|
|
36
36
|
operations.delete(key);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Inspect and send a private copy, so changes to the user's source cannot change the job. `root` is where the copy
|
|
41
|
+
* goes (the system temporary folder unless the bridge host needs it in a folder its container mounts).
|
|
42
|
+
*/
|
|
43
|
+
export async function withPrintSnapshot(source, operation, root = os.tmpdir()) {
|
|
44
|
+
const directory = await fs.mkdtemp(path.join(root, "bambu-print-"));
|
|
42
45
|
const snapshot = path.join(directory, path.basename(source));
|
|
43
46
|
let retainUntilExit = false;
|
|
44
47
|
try {
|
package/dist/tool-annotations.js
CHANGED
|
@@ -87,6 +87,10 @@ export const TOOL_ANNOTATIONS = {
|
|
|
87
87
|
// The standard route preserves scene objects and needs a new output path; a configured legacy bridge promises neither.
|
|
88
88
|
blender_mcp_edit_model: hints(false, true, false, true),
|
|
89
89
|
fusion_mcp_status: hints(false, false, true, true), // launch: true starts Fusion on this computer
|
|
90
|
+
// Install add-ons into the person's own Blender or Fusion: the add-on file is replaced (kept as a backup), and
|
|
91
|
+
// the Fusion add-in folder, a login item and this server's .env are written. Repeating finds them current.
|
|
92
|
+
blender_mcp_setup: hints(false, true, true, true),
|
|
93
|
+
fusion_mcp_setup: hints(false, true, true, true),
|
|
90
94
|
fusion_mcp_call: hints(false, true, false, true), // any Fusion tool, including execute_code
|
|
91
95
|
fusion_mcp_new_design: hints(false, false, false, true), // opens another new document
|
|
92
96
|
fusion_mcp_export: hints(false, false, true, true), // never overwrites; a repeat fails and changes nothing
|