You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- New deleteFile() in BambuImplementation: FTPS DELETE via basic-ftp
using the same TLS-session-ticket dance as ftpUpload.
- Confirm-gated (confirm:true required) so a default invocation can't
destroy data; returns status:"skipped" otherwise without contacting
the printer.
- Path safety: rejects ".." segments, restricts deletes to cache/,
timelapse/, and logs/ to prevent walking the filesystem.
- Bare filenames default to cache/<name>; relative paths to other
allowed dirs are honored as-is.
- README features bullet + delete_printer_file tool section updated.
- 5 new unit tests cover the gating, path safety, and happy path.
npm test: 28/28.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ Local handoff note: see [REMOTE-DEPLOYMENT.md](./REMOTE-DEPLOYMENT.md) for the c
68
68
69
69
- Get detailed printer status: temperatures (nozzle, bed, chamber), print progress, current layer, time remaining, and live AMS slot data
70
70
- Query live AMS inventory with resolved Bambu/Orca filament profile paths via `get_printer_filaments`
71
-
- List, upload, and manage files on the printer's SD card via FTPS
71
+
- List, upload, and delete files on the printer's SD card via FTPS
72
72
- 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))
73
73
- Optional 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)). Verified on H2S/H2D/X1C/P1S. Default off; Path A (GUI-slice) remains the recommended workflow for non-BBL profiles or first-time prints. See [docs/SLICING.md](./docs/SLICING.md).
74
74
- 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
@@ -678,6 +678,27 @@ List files stored on the printer's SD card. Scans the `cache/`, `timelapse/`, an
678
678
}
679
679
```
680
680
681
+
#### delete_printer_file
682
+
683
+
Delete a single file from the printer's SD card via FTPS. **Destructive.** Requires `confirm: true` — without it the call returns `status: "skipped"` and does not contact the printer. Path traversal segments (`..`) are rejected. Only files under `cache/`, `timelapse/`, and `logs/` can be deleted.
684
+
685
+
```json
686
+
{
687
+
"filename": "old_print.gcode.3mf",
688
+
"confirm": true,
689
+
"host": "192.168.1.100",
690
+
"bambu_serial": "01P00A123456789",
691
+
"bambu_token": "your_access_token"
692
+
}
693
+
```
694
+
695
+
A bare filename defaults to `cache/<filename>`. To target other directories pass a relative path:
Copy file name to clipboardExpand all lines: dist/index.js
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1039,6 +1039,27 @@ class BambuPrinterMCPServer {
1039
1039
}
1040
1040
}
1041
1041
},
1042
+
{
1043
+
name: "delete_printer_file",
1044
+
description: "Delete a file from the Bambu Lab printer's SD card via FTPS. Destructive: requires confirm:true. Restricted to cache/, timelapse/, and logs/ directories. Path traversal segments (..) are rejected.",
1045
+
inputSchema: {
1046
+
type: "object",
1047
+
properties: {
1048
+
filename: {
1049
+
type: "string",
1050
+
description: "File to delete. Bare names default to cache/<name>; pass a relative path like timelapse/foo.mp4 to target other allowed directories."
1051
+
},
1052
+
confirm: {
1053
+
type: "boolean",
1054
+
description: "Must be true to actually delete. When false or omitted the call returns without sending an FTP request."
1055
+
},
1056
+
host: {type: "string",description: "Hostname or IP of the printer (default: value from env)"},
1057
+
bambu_serial: {type: "string",description: "Serial number (default: value from env)"},
1058
+
bambu_token: {type: "string",description: "Access token (default: value from env)"}
1059
+
},
1060
+
required: ["filename"]
1061
+
}
1062
+
},
1042
1063
{
1043
1064
name: "upload_gcode",
1044
1065
description: "Upload a G-code file to the Bambu Lab printer",
@@ -1458,6 +1479,12 @@ class BambuPrinterMCPServer {
0 commit comments