bambu-printer-mcp 1.1.8 → 1.1.10
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 +10 -3
- package/README.md +188 -370
- package/dist/index.js +39 -11
- package/dist/printers/bambu.d.ts +3 -2
- package/dist/printers/bambu.js +18 -5
- package/dist/slicer/profile-flatten.d.ts +14 -0
- package/dist/slicer/profile-flatten.js +88 -0
- package/dist/stl/stl-manipulator.d.ts +1 -0
- package/dist/stl/stl-manipulator.js +25 -6
- package/package.json +1 -1
- package/src/index.ts +36 -11
- package/src/printers/bambu.ts +20 -5
- package/src/slicer/profile-flatten.ts +103 -0
- package/src/stl/stl-manipulator.ts +29 -6
package/README.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
# bambu-printer-mcp
|
|
2
2
|
|
|
3
|
+
> **Thank you, [FULU Foundation](https://www.fulu.org/), [Louis Rossmann](https://www.youtube.com/watch?v=1jhRqgHxEP8), and the [OrcaSlicer-bambulab contributors](https://github.com/FULU-Foundation/OrcaSlicer-bambulab).** We stand with open-source developers, the right to repair, and your right to control hardware you own. You should be able to choose your software and print without a vendor cloud standing in the way.
|
|
4
|
+
>
|
|
5
|
+
> **Want to skip Bambu's software and cloud?** Use FULU OrcaSlicer-bambulab to slice and export, then this MCP's direct LAN path on supported printers and firmware. That workflow does not require Bambu Studio, Bambu Connect, or Bambu Cloud. Start with the [FULU setup guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md). The optional BambuNetwork bridge is a separate path that still uses Bambu's networking runtime; cloud jobs still use Bambu's services.
|
|
6
|
+
|
|
3
7
|
[](https://www.npmjs.com/package/bambu-printer-mcp)
|
|
4
8
|
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
|
5
9
|
[](https://www.typescriptlang.org/)
|
|
6
|
-
[](https://nodejs.org/en/download/)
|
|
7
11
|
[](https://github.com/DMontgomery40/bambu-printer-mcp)
|
|
8
12
|
[](https://www.npmjs.com/package/bambu-printer-mcp)
|
|
9
13
|
|
|
@@ -15,58 +19,83 @@ This is a stripped-down, Bambu-only fork of [mcp-3D-printer-server](https://gith
|
|
|
15
19
|
|
|
16
20
|
---
|
|
17
21
|
|
|
18
|
-
##
|
|
22
|
+
## Set up with your agent
|
|
23
|
+
|
|
24
|
+
Tell your agent your printer's **model and LAN address**, if you know them, then copy and paste this:
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
```text
|
|
27
|
+
Install bambu-printer-mcp in the agent/harness I'm using now.
|
|
21
28
|
|
|
22
|
-
|
|
29
|
+
Read https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SETUP.md
|
|
30
|
+
and https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md
|
|
31
|
+
for the current setup instructions and supported workflows.
|
|
23
32
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
- Connect to standard Blender MCP servers, discover and call their tools, and verify STL edit/export results.
|
|
28
|
-
- Preserve filament-slot order and isolate temporary files between concurrent jobs and server instances.
|
|
33
|
+
Detect my OS and harness, then use its native MCP configuration or installer.
|
|
34
|
+
Preserve my existing servers and settings. Prefer the published npm package
|
|
35
|
+
(npx -y bambu-printer-mcp, stdio); use Node.js 24 if a runtime is needed.
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
Find existing printer settings in relevant local configuration or available
|
|
38
|
+
LAN discovery. Confirm the detected printer's model, address, and identity
|
|
39
|
+
with me before connecting. Ask only for values you cannot find:
|
|
40
|
+
PRINTER_HOST, BAMBU_MODEL, BAMBU_SERIAL, and BAMBU_TOKEN (the LAN access code).
|
|
41
|
+
Keep credentials in local/private configuration; do not repeat access codes
|
|
42
|
+
or tokens in chat. Never guess the printer model.
|
|
31
43
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- **Utility controls** — `set_print_speed` (silent/standard/sport/ludicrous), `clear_hms_errors`, `reread_ams_rfid`, `set_airduct_mode` (cooling/heating for H2/P2).
|
|
40
|
-
- **H2-family-safe print path** — correct `project_file` format with `ams_mapping2` parallel array, H2 firmware quirks handled.
|
|
41
|
-
- **BambuStudio CLI auto-flatten** (automatic for BBL profiles) — works around upstream profile inheritance bugs.
|
|
42
|
-
- **Print collar charm** (`print_collar_charm`) — specialized two-color wrapper with fixed tray policy.
|
|
44
|
+
Use direct LAN printing by default. Explain any LAN/Developer Mode setting
|
|
45
|
+
I need to enable. Prefer FULU OrcaSlicer-bambulab GUI slicing/export; discover
|
|
46
|
+
an existing slicer before suggesting an install. Do not configure FULU/Orca
|
|
47
|
+
CLI auto-slicing while its machine-preset safety gate is missing (see guide).
|
|
48
|
+
A slicer is not needed here to print a pre-sliced file. Configure the optional FULU
|
|
49
|
+
BambuNetwork bridge only if I choose it, and explain its runtime/auth needs.
|
|
50
|
+
X2D supports status and slicing here, but direct printing is not supported.
|
|
43
51
|
|
|
44
|
-
|
|
52
|
+
If this harness does not already provide code mode or an equivalent, suggest
|
|
53
|
+
a compatible code-mode integration as an optional addition. It is not required;
|
|
54
|
+
finish ordinary MCP setup without it unless I choose to add it.
|
|
45
55
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
Verify that the MCP initializes, lists its tools, and reads printer status.
|
|
57
|
+
Do not start a print or change printer settings as a setup test. Tell me what
|
|
58
|
+
worked and whether I need to restart or reload the harness.
|
|
59
|
+
```
|
|
50
60
|
|
|
51
|
-
|
|
61
|
+
[Setup reference](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SETUP.md) · [FULU guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md) · [Optional code mode](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SETUP.md#optional-code-mode)
|
|
52
62
|
|
|
53
63
|
<details>
|
|
54
|
-
<summary><strong>
|
|
64
|
+
<summary><strong>Start here</strong></summary>
|
|
65
|
+
|
|
66
|
+
## Start here
|
|
67
|
+
|
|
68
|
+
| I want to… | Read next |
|
|
69
|
+
|---|---|
|
|
70
|
+
| Use open-source slicing and a cloud-free print workflow | [FULU setup: slicer, LAN, and optional bridge](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md) |
|
|
71
|
+
| Connect this MCP to my agent | [Copy the setup request](#set-up-with-your-agent) |
|
|
72
|
+
| Troubleshoot setup or configure it manually | [Installation, environment variables, and LAN reference](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SETUP.md) |
|
|
73
|
+
| Prepare a printable file or troubleshoot slicing | [Slicing guide and model routing](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md) |
|
|
74
|
+
| Choose filament trays or inspect a printer | [AMS setup](#ams-automatic-material-system-setup) and [printer tools](#printer-control-tools) |
|
|
75
|
+
| Edit an STL through Blender | [Blender MCP setup](#blender-mcp) |
|
|
76
|
+
| See release changes or contributor credit | [Changelog](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/CHANGELOG.md), [releases](https://github.com/DMontgomery40/bambu-printer-mcp/releases), and [contributors](./CONTRIBUTORS.md) |
|
|
77
|
+
|
|
78
|
+
</details>
|
|
79
|
+
|
|
80
|
+
<details>
|
|
81
|
+
<summary><strong>What's new in bambu-printer-mcp</strong></summary>
|
|
82
|
+
|
|
83
|
+
## What's new in bambu-printer-mcp
|
|
84
|
+
|
|
85
|
+
See the [changelog](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/CHANGELOG.md) for versioned changes. Recent releases add reliable npm and desktop-extension installs, standard Blender MCP integration, corrected P2S/A1 routing, and safer multi-filament CLI slicing. X2D status and slicing are available; **direct X2D printing remains unsupported** pending its native eMMC transport.
|
|
86
|
+
|
|
87
|
+
</details>
|
|
88
|
+
|
|
89
|
+
<details>
|
|
90
|
+
<summary><strong>Table of Contents</strong></summary>
|
|
55
91
|
|
|
56
92
|
## Table of Contents
|
|
57
93
|
|
|
94
|
+
- [Start here](#start-here)
|
|
58
95
|
- [Description](#description)
|
|
96
|
+
- [FULU and open-source printing](#fulu-and-open-source-printing)
|
|
59
97
|
- [Features](#features)
|
|
60
|
-
- [
|
|
61
|
-
- [Prerequisites](#prerequisites)
|
|
62
|
-
- [Run without installing (npx)](#run-without-installing-npx)
|
|
63
|
-
- [Install globally from npm](#install-globally-from-npm)
|
|
64
|
-
- [Install from source](#install-from-source)
|
|
65
|
-
- [Configuration](#configuration)
|
|
66
|
-
- [Environment variables reference](#environment-variables-reference)
|
|
67
|
-
- [Usage](#usage)
|
|
68
|
-
- [Enabling Developer Mode (Required)](#enabling-developer-mode-required)
|
|
69
|
-
- [Finding Your Bambu Printer's Serial Number and Access Token](#finding-your-bambu-printers-serial-number-and-access-token)
|
|
98
|
+
- [Set up with your agent](#set-up-with-your-agent)
|
|
70
99
|
- [AMS (Automatic Material System) Setup](#ams-automatic-material-system-setup)
|
|
71
100
|
- [Bambu Communication Notes (MQTT and FTP)](#bambu-communication-notes-mqtt-and-ftp)
|
|
72
101
|
- [What this fork fixes](#what-this-fork-fixes)
|
|
@@ -83,32 +112,51 @@ This fork adds a substantial set of printer control tools beyond the upstream `m
|
|
|
83
112
|
- [Memory usage](#memory-usage)
|
|
84
113
|
- [STL manipulation limitations](#stl-manipulation-limitations)
|
|
85
114
|
- [Performance considerations](#performance-considerations)
|
|
115
|
+
- [Acknowledgements](#acknowledgements)
|
|
86
116
|
- [License](#license)
|
|
87
117
|
|
|
88
118
|
</details>
|
|
89
119
|
|
|
90
|
-
|
|
120
|
+
<details>
|
|
121
|
+
<summary><strong>Description</strong></summary>
|
|
91
122
|
|
|
92
123
|
## Description
|
|
93
124
|
|
|
94
|
-
`bambu-printer-mcp` is a Model Context Protocol server
|
|
125
|
+
`bambu-printer-mcp` is a Model Context Protocol server for Bambu Lab 3D printers. A straightforward workflow is: **slice in FULU OrcaSlicer-bambulab, OrcaSlicer, or Bambu Studio, export a sliced `.gcode.3mf`, then pass its path to `print_3mf`**. The default direct LAN path uploads via FTPS and chooses the MQTT command for the target model. See the [slicing guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md) for CLI options, model routing, and validation limits.
|
|
95
126
|
|
|
96
127
|
**What this is not.** This package intentionally supports only Bambu Lab printers. It does not include adapters for OctoPrint, Klipper (Moonraker), Duet, Repetier, Prusa Connect, or Creality Cloud. If you need multi-printer support, use the parent project [mcp-3D-printer-server](https://github.com/DMontgomery40/mcp-3D-printer-server) instead.
|
|
97
128
|
|
|
98
|
-
**Why a separate package?** The parent project carries all printer adapters in a single binary. When working exclusively with Bambu hardware, that breadth adds unnecessary weight. This fork strips the project to its Bambu core for a smaller, faster install.
|
|
129
|
+
**Why a separate package?** The parent project carries all printer adapters in a single binary. When working exclusively with Bambu hardware, that breadth adds unnecessary weight. This fork strips the project to its Bambu core for a smaller, faster install. See each project's changelog for its current fixes and supported workflows.
|
|
99
130
|
|
|
100
131
|
**Note on resource usage.** STL manipulation loads entire mesh geometry into memory. For large or complex STL files (greater than 10 MB), these operations can be memory-intensive. See [General Limitations and Considerations](#general-limitations-and-considerations) for details.
|
|
101
132
|
|
|
102
|
-
|
|
133
|
+
</details>
|
|
134
|
+
|
|
135
|
+
<details>
|
|
136
|
+
<summary><strong>FULU and open-source printing</strong></summary>
|
|
137
|
+
|
|
138
|
+
## FULU and open-source printing
|
|
139
|
+
|
|
140
|
+
[FULU OrcaSlicer-bambulab](https://github.com/FULU-Foundation/OrcaSlicer-bambulab) is a supported slicer target (`SLICER_TYPE=orcaslicer-bambulab`; aliases include `fulu-orca` and `orca-studio`). Use its GUI to export a sliced project for direct LAN printing. FULU/Orca CLI aliases are recognized, but **do not use them for unattended slicing or auto-slicing** while the [machine-preset safety gate is missing](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md#fulu-and-orca-cli-safety-limit).
|
|
141
|
+
|
|
142
|
+
The optional FULU **BambuNetwork bridge** exposes `bambu_network_bridge_status`, `bambu_network_call`, and `print_3mf_bambu_network`, also reachable through `print_3mf` with `connection_mode: "bambu_network"`. Slicer selection does not enable the bridge. It needs a separately installed FULU runtime and an explicit launch command; cloud printing also needs an authenticated BambuNetwork session.
|
|
143
|
+
|
|
144
|
+
**[Follow the FULU setup guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md)** for the direct LAN recipe, Linux/Windows/macOS bridge setup, connection probes, authentication, and troubleshooting. Bridge protocol tests and a successful handshake do not establish a successful physical print.
|
|
145
|
+
|
|
146
|
+
</details>
|
|
147
|
+
|
|
148
|
+
<details>
|
|
149
|
+
<summary><strong>Features</strong></summary>
|
|
103
150
|
|
|
104
151
|
## Features
|
|
105
152
|
|
|
106
153
|
- Get detailed printer status: temperatures (nozzle, bed, chamber), print progress, current layer, time remaining, and live AMS slot data
|
|
107
154
|
- Query live AMS inventory with resolved Bambu/Orca filament profile paths via `get_printer_filaments`. Includes per-tray display names, match confidence (`high`/`medium`/`low`/`none`), resolution tier (`exact-model-nozzle`/`model`/`generic`/`unresolved`), and a summary with recommended auto-slice filament. Retries automatically when AMS data hasn't arrived yet (common on first MQTT push from idle printers).
|
|
108
155
|
- List, upload, and delete files on the printer's SD card via FTPS
|
|
109
|
-
- Capture a JPEG snapshot from the chamber camera. Supports A1, A1 mini, P1S, P1P (TCP-on-6000), and X1, X1C, X1E, P2S, H2, H2S, H2D, H2C, H2D Pro (RTSP via ffmpeg). Requires ffmpeg in PATH for the RTSP path.
|
|
110
|
-
- Upload and print pre-sliced `.gcode.3mf` files with full plate selection and calibration flag control (recommended path — see [
|
|
111
|
-
-
|
|
156
|
+
- Capture a JPEG snapshot from the chamber camera. Supports A1, A1 mini, P1S, P1P (TCP-on-6000), and X1, X1C, X1E, P2S, H2, H2S, H2D, H2C, H2D Pro, X2D (RTSP via ffmpeg). Requires ffmpeg in PATH for the RTSP path.
|
|
157
|
+
- Upload and print pre-sliced `.gcode.3mf` files with full plate selection and calibration flag control (recommended path — see [slicing guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md))
|
|
158
|
+
- Slice through BambuStudio CLI with automatic BBL inheritance/include resolution, per-slot filament colours, and fallback prime-tower placement for multi-nozzle printers. Missing dependencies stop the slice; custom settings and saved project tower positions are preserved. Multi-colour slicing is verified by the contributor on BambuStudio 02.08.02.60 for Windows; older CLI versions have separate limitations. See [slicing guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md).
|
|
159
|
+
- Recognize X2D status and slice with its own installed BambuStudio preset (`BAMBU_MODEL=x2d`). **Direct X2D printing is not supported yet**: the internal eMMC transport is pending. These print requests stop before slicing, uploading, or issuing printer commands. Print exported projects through a supported slicer instead.
|
|
112
160
|
- 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, with correct H2S/H2D/H2C `ams_mapping2` parallel array format
|
|
113
161
|
- **Auto-match AMS slots by RFID** (`auto_match_ams` flag on `print_3mf`). Resolves required `tray_info_idx` from the sliced 3MF against live AMS inventory. Handles same-SKU different-color filaments by matching on `(tray_info_idx, tray_color)` and tracking already-claimed slots. Dry-run with `resolve_3mf_ams_slots` before printing.
|
|
114
162
|
- Cancel, pause, and resume in-progress print jobs via MQTT
|
|
@@ -121,7 +169,7 @@ This fork adds a substantial set of printer control tools beyond the upstream `m
|
|
|
121
169
|
- Start G-code files already stored on the printer
|
|
122
170
|
- **Collar charm print wrapper** (`print_collar_charm`) — specialized two-color workflow with fixed tray policy for inner (black, AMS 1 slot 1) and outer (white, AMS 2 slot 1) charm parts
|
|
123
171
|
- STL manipulation: scale, rotate, extend base, merge vertices, center at origin, lay flat, and inspect model info
|
|
124
|
-
- Slice STL or 3MF files using
|
|
172
|
+
- Slice STL or 3MF files using an external CLI. For Bambu headless workflows, use the validated BambuStudio profile path; FULU/Orca users should [GUI-export while the CLI safety limitation remains](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md#fulu-and-orca-cli-safety-limit).
|
|
125
173
|
- Inspect slicer settings from a saved 3MF template or extracted profile via `get_slice_settings`
|
|
126
174
|
- Enumerate saved slicing templates from the local registry via `list_templates`
|
|
127
175
|
- Save templates into the local registry via `save_template`
|
|
@@ -131,292 +179,10 @@ This fork adds a substantial set of printer control tools beyond the upstream `m
|
|
|
131
179
|
- Optional Blender MCP bridge for advanced mesh operations
|
|
132
180
|
- Dual transport: stdio (default, for Claude Desktop / Claude Code) and Streamable HTTP
|
|
133
181
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
## Installation
|
|
137
|
-
|
|
138
|
-
### Prerequisites
|
|
139
|
-
|
|
140
|
-
- Node.js 18 or higher
|
|
141
|
-
- npm
|
|
142
|
-
- **BambuStudio** *(optional -- only needed for slicing)* -- [download from bambulab.com](https://bambulab.com/en/download/studio). Required by `slice_stl` and `print_3mf` auto-slice (when a 3MF has no embedded gcode). Not needed if you only print pre-sliced 3MF files. Default path: `/Applications/BambuStudio.app/Contents/MacOS/BambuStudio` (macOS); set `SLICER_PATH` if installed elsewhere.
|
|
143
|
-
|
|
144
|
-
### Run without installing (npx)
|
|
145
|
-
|
|
146
|
-
The fastest way to get started. No global install required:
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
npx bambu-printer-mcp
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
Set environment variables inline or via a `.env` file in your working directory (see [Configuration](#configuration)).
|
|
153
|
-
|
|
154
|
-
### Install globally from npm
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
npm install -g bambu-printer-mcp
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
After installation, the `bambu-printer-mcp` command is available in your PATH.
|
|
161
|
-
|
|
162
|
-
### Install from source
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
git clone https://github.com/DMontgomery40/bambu-printer-mcp.git
|
|
166
|
-
cd bambu-printer-mcp
|
|
167
|
-
npm install
|
|
168
|
-
npm run build
|
|
169
|
-
npm link
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
`npm link` makes the `bambu-printer-mcp` binary available globally without publishing to npm.
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## Configuration
|
|
177
|
-
|
|
178
|
-
Create a `.env` file in the directory where you run the server, or pass environment variables directly in your MCP client config. All printer connection variables can also be passed as tool arguments on a per-call basis, which is useful when working with multiple printers.
|
|
179
|
-
|
|
180
|
-
```env
|
|
181
|
-
# --- Bambu printer connection (required for all printer tools) ---
|
|
182
|
-
PRINTER_HOST=192.168.1.100 # IP address of your Bambu printer on the local network
|
|
183
|
-
BAMBU_SERIAL=01P00A123456789 # Printer serial number (see Finding Your Serial Number below)
|
|
184
|
-
BAMBU_TOKEN=your_access_token # LAN access token from printer touchscreen
|
|
185
|
-
# Compatible aliases also accepted:
|
|
186
|
-
# BAMBU_PRINTER_HOST / BAMBU_PRINTER_SERIAL / BAMBU_PRINTER_ACCESS_TOKEN
|
|
187
|
-
|
|
188
|
-
# --- Printer model (CRITICAL for safe operation) ---
|
|
189
|
-
BAMBU_MODEL=p1s # Your printer model: p1s, p1p, p2s, x1c, x1e, a1, a1mini, h2d, h2s, h2c
|
|
190
|
-
# Alias also accepted: BAMBU_PRINTER_MODEL
|
|
191
|
-
BED_TYPE=textured_plate # Bed plate type: textured_plate, cool_plate, engineering_plate, hot_plate, supertack_plate
|
|
192
|
-
NOZZLE_DIAMETER=0.4 # Nozzle diameter in mm (default: 0.4)
|
|
193
|
-
|
|
194
|
-
# --- Slicer configuration (required for slice_stl and print_3mf auto-slice) ---
|
|
195
|
-
SLICER_TYPE=bambustudio # Options: bambustudio, prusaslicer, orcaslicer, cura, slic3r
|
|
196
|
-
SLICER_PATH=/Applications/BambuStudio.app/Contents/MacOS/BambuStudio
|
|
197
|
-
# Default on macOS. Adjust for your OS and install path.
|
|
198
|
-
# Alias also accepted: BAMBU_STUDIO_PATH
|
|
199
|
-
SLICER_PROFILE= # Optional: path to a slicer profile/config file
|
|
200
|
-
|
|
201
|
-
# --- Temporary file directory ---
|
|
202
|
-
TEMP_DIR=/tmp/bambu-mcp-temp # Directory for intermediate files. Created automatically if absent.
|
|
203
|
-
|
|
204
|
-
# --- MCP transport ---
|
|
205
|
-
MCP_TRANSPORT=stdio # Options: stdio (default), streamable-http
|
|
206
|
-
|
|
207
|
-
# --- Streamable HTTP transport (only used when MCP_TRANSPORT=streamable-http) ---
|
|
208
|
-
MCP_HTTP_HOST=127.0.0.1
|
|
209
|
-
MCP_HTTP_PORT=3000
|
|
210
|
-
MCP_HTTP_PATH=/mcp
|
|
211
|
-
MCP_HTTP_STATEFUL=true
|
|
212
|
-
MCP_HTTP_JSON_RESPONSE=true
|
|
213
|
-
MCP_HTTP_ALLOWED_ORIGINS=http://localhost
|
|
214
|
-
|
|
215
|
-
# --- Optional standard Blender MCP server ---
|
|
216
|
-
BLENDER_MCP_COMMAND=uvx # Executable or full path; no shell command string
|
|
217
|
-
BLENDER_MCP_ARGS='["blender-mcp"]'
|
|
218
|
-
BLENDER_MCP_TIMEOUT_MS=120000
|
|
219
|
-
# Start the matching MCP addon inside Blender.
|
|
220
|
-
# Legacy custom executable bridge (optional): BLENDER_MCP_BRIDGE_COMMAND=
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### Environment variables reference
|
|
224
|
-
|
|
225
|
-
| Variable | Default | Required | Description |
|
|
226
|
-
|---|---|---|---|
|
|
227
|
-
| `PRINTER_HOST` | `localhost` | Yes | IP address of the Bambu printer. Alias: `BAMBU_PRINTER_HOST` |
|
|
228
|
-
| `BAMBU_SERIAL` | | Yes | Printer serial number. Alias: `BAMBU_PRINTER_SERIAL` |
|
|
229
|
-
| `BAMBU_TOKEN` | | Yes | LAN access token. Alias: `BAMBU_PRINTER_ACCESS_TOKEN` |
|
|
230
|
-
| `BAMBU_MODEL` | | **Yes** | Printer model: `p1s`, `p1p`, `p2s`, `x1c`, `x1e`, `a1`, `a1mini`, `h2d`, `h2s`, `h2c`. **Required for safe operation** -- determines the correct G-code generation. Alias: `BAMBU_PRINTER_MODEL`. If omitted and the MCP client supports elicitation, the server will ask you interactively. Use `h2c` for H2C; do not use `h2d` as a fallback. |
|
|
231
|
-
| `BED_TYPE` | `textured_plate` | No | Bed plate type: `textured_plate`, `cool_plate`, `engineering_plate`, `hot_plate`, `supertack_plate` |
|
|
232
|
-
| `NOZZLE_DIAMETER` | `0.4` | No | Nozzle diameter in mm. Used to select the correct BambuStudio machine preset. |
|
|
233
|
-
| `SLICER_TYPE` | `bambustudio` | No | Slicer to use for slicing operations |
|
|
234
|
-
| `SLICER_PATH` | BambuStudio macOS path | No | Full path to the slicer executable. Alias: `BAMBU_STUDIO_PATH` |
|
|
235
|
-
| `SLICER_PROFILE` | | No | Path to a slicer profile or config file |
|
|
236
|
-
| `TEMP_DIR` | private folder under the system temporary directory | No | Intermediate files; each server instance gets its own folder unless explicitly configured |
|
|
237
|
-
| `MCP_TRANSPORT` | `stdio` | No | Transport mode: `stdio` or `streamable-http` |
|
|
238
|
-
| `MCP_HTTP_HOST` | `127.0.0.1` | No | HTTP bind address (HTTP transport only) |
|
|
239
|
-
| `MCP_HTTP_PORT` | `3000` | No | HTTP port (HTTP transport only) |
|
|
240
|
-
| `MCP_HTTP_PATH` | `/mcp` | No | HTTP endpoint path (HTTP transport only) |
|
|
241
|
-
| `MCP_HTTP_STATEFUL` | `true` | No | Enable stateful HTTP sessions |
|
|
242
|
-
| `MCP_HTTP_JSON_RESPONSE` | `true` | No | Return structured JSON alongside text responses |
|
|
243
|
-
| `MCP_HTTP_ALLOWED_ORIGINS` | | No | Comma-separated list of allowed CORS origins |
|
|
244
|
-
| `BLENDER_MCP_COMMAND` | | No | Trusted executable for a standard stdio Blender MCP server, e.g. full path to `uvx` |
|
|
245
|
-
| `BLENDER_MCP_ARGS` | `[]` | No | JSON array of server arguments, e.g. `["blender-mcp"]`; no shell parsing |
|
|
246
|
-
| `BLENDER_MCP_TIMEOUT_MS` | `120000` | No | Connection/discovery/call deadline, 100–300000 ms; interrupted edits are never retried automatically |
|
|
247
|
-
| `BLENDER_MCP_BRIDGE_COMMAND` | | No | Legacy custom executable receiving `MCP_BLENDER_PAYLOAD`; separate from the standard MCP integration |
|
|
248
|
-
| `BAMBU_CLI_FLATTEN` | automatic | No | Legacy setting; BBL profile resolution now always runs when profiles contain inheritance or includes. A false/unset value cannot bypass required machine G-code. Standalone custom files without dependencies pass through. See [docs/SLICING.md](./docs/SLICING.md). |
|
|
249
|
-
| `BAMBU_PROFILES_ROOT` | derived from `SLICER_PATH` | No | Override path to the BambuStudio `Resources/profiles` directory used by the CLI flattener. Useful for non-standard installs or dev environments. |
|
|
250
|
-
|
|
251
|
-
SuperTack can be passed for pre-sliced print jobs, but BambuStudio CLI slicing currently fails fast for `supertack_plate` because the accepted CLI bed identifier is not verified. Use a pre-sliced 3MF for SuperTack until this is confirmed.
|
|
252
|
-
|
|
253
|
-
---
|
|
254
|
-
|
|
255
|
-
## Usage
|
|
256
|
-
|
|
257
|
-
Add this server to your MCP client's config (Claude Desktop, Claude Code, Cursor, Codex CLI, or any MCP-compatible client). The config format is the same everywhere -- an `mcpServers` entry with the command and env vars:
|
|
258
|
-
|
|
259
|
-
```json
|
|
260
|
-
{
|
|
261
|
-
"mcpServers": {
|
|
262
|
-
"bambu-printer": {
|
|
263
|
-
"command": "npx",
|
|
264
|
-
"args": ["-y", "bambu-printer-mcp"],
|
|
265
|
-
"env": {
|
|
266
|
-
"PRINTER_HOST": "192.168.1.100",
|
|
267
|
-
"BAMBU_SERIAL": "01P00A123456789",
|
|
268
|
-
"BAMBU_TOKEN": "your_access_token",
|
|
269
|
-
"BAMBU_MODEL": "p1s",
|
|
270
|
-
"SLICER_TYPE": "bambustudio",
|
|
271
|
-
"SLICER_PATH": "/Applications/BambuStudio.app/Contents/MacOS/BambuStudio"
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
Where this config lives depends on your client:
|
|
279
|
-
|
|
280
|
-
| Client | Config location |
|
|
281
|
-
|--------|----------------|
|
|
282
|
-
| Claude Desktop (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
283
|
-
| Claude Desktop (Windows) | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
284
|
-
| Claude Code (project) | `.mcp.json` in project root |
|
|
285
|
-
| Claude Code (global) | `~/.claude/settings.json` |
|
|
286
|
-
| Cursor | MCP settings in Cursor preferences |
|
|
287
|
-
| Codex CLI | MCP config per Codex docs |
|
|
288
|
-
|
|
289
|
-
Restart your client after editing the config.
|
|
290
|
-
|
|
291
|
-
### Alternative: Claude Desktop extension (.mcpb)
|
|
292
|
-
|
|
293
|
-
You can install this server into Claude Desktop without editing JSON by using the `.mcpb` extension bundle. Download `bambu-printer-mcp.mcpb` from the [latest release](https://github.com/DMontgomery40/bambu-printer-mcp/releases), double-click it, and Claude Desktop's extension wizard will register the server. You'll be prompted for your printer IP, serial number, LAN access code, and printer model -- the same values as the `mcpServers` config above.
|
|
294
|
-
|
|
295
|
-
If your org has disabled Claude Desktop extension installs, install unpacked instead:
|
|
296
|
-
|
|
297
|
-
1. Clone the repo and run `npm ci && npm run build`.
|
|
298
|
-
2. Open Claude Desktop -> **Settings** -> **Extensions** -> **Advanced Settings** -> **Extension Developer** -> **Install Unpacked**.
|
|
299
|
-
3. Select the repo's root directory (the one containing `manifest.json`).
|
|
300
|
-
|
|
301
|
-
To build the bundle yourself instead of downloading a release asset:
|
|
302
|
-
|
|
303
|
-
```bash
|
|
304
|
-
npm ci
|
|
305
|
-
npm run package:mcpb
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
This produces `bambu-printer-mcp.mcpb` in the repo root using a pinned packaging tool. Packaging installs production dependencies in a temporary directory, retains licenses and source, excludes local credentials and models, and leaves your development dependencies intact.
|
|
309
|
-
|
|
310
|
-
### Recommended: use with codemode-mcp
|
|
311
|
-
|
|
312
|
-
For any MCP server with a large tool surface, wrapping it behind [codemode-mcp](https://github.com/jx-codes/codemode-mcp) dramatically reduces token usage. Instead of exposing every tool definition to the model (which can consume tens of thousands of tokens per turn), codemode lets the agent write code against a two-tool interface (`search()` and `execute()`), loading only the tools it needs on demand.
|
|
313
|
-
|
|
314
|
-
Anthropic and Cloudflare independently demonstrated this pattern reduces MCP token costs by up to 98%:
|
|
315
|
-
|
|
316
|
-
- [Code execution with MCP](https://www.anthropic.com/engineering/code-execution-with-mcp) (Anthropic)
|
|
317
|
-
- [Code Mode: give agents an entire API in 1,000 tokens](https://blog.cloudflare.com/code-mode-mcp/) (Cloudflare)
|
|
318
|
-
|
|
319
|
-
This applies to all MCP servers, not just this one.
|
|
320
|
-
|
|
321
|
-
---
|
|
322
|
-
|
|
323
|
-
## Enabling Developer Mode (Required)
|
|
324
|
-
|
|
325
|
-
This MCP server communicates directly with your printer over your local network using MQTT and FTPS. For this to work, **Developer Mode** must be enabled on the printer. Without it, the printer will reject third-party LAN connections even if you have the correct access code.
|
|
326
|
-
|
|
327
|
-
On H2D/H2-series firmware, the printer may stream `push_status` data without ever answering the legacy `get_version` handshake used by older libraries. This fork treats the live status stream as authoritative and does not require that extra ACK before considering the connection usable.
|
|
328
|
-
|
|
329
|
-
Developer Mode is available on the following firmware versions and later:
|
|
330
|
-
|
|
331
|
-
| Series | Minimum Firmware |
|
|
332
|
-
|--------|-----------------|
|
|
333
|
-
| P1 Series (P1P, P1S) | `01.08.02.00` |
|
|
334
|
-
| X1 Series (X1C, X1E) | `01.08.03.00` |
|
|
335
|
-
| A1 Series (A1, A1 Mini) | `01.05.00.00` |
|
|
336
|
-
| H2D | `01.01.00.01` |
|
|
337
|
-
|
|
338
|
-
If your firmware is older than these versions, update through Bambu Studio or the Bambu Handy app before proceeding.
|
|
339
|
-
|
|
340
|
-
### Step 1: Navigate to Network Settings
|
|
341
|
-
|
|
342
|
-
On the printer's touchscreen, go to **Settings**, then select the **Network** (WLAN) page. You should see your WiFi network name, IP address, and the LAN Only Mode toggle.
|
|
343
|
-
|
|
344
|
-
<p align="center">
|
|
345
|
-
<img src="docs/images/p1s-network-settings.jpeg" width="400" alt="P1S network settings screen showing WLAN, LAN Only Mode, IP address, and Access Code" />
|
|
346
|
-
</p>
|
|
347
|
-
|
|
348
|
-
### Step 2: Enable LAN Only Mode
|
|
349
|
-
|
|
350
|
-
Toggle **LAN Only Mode** to **ON**. This enables direct local network communication protocols (MQTT on port 8883 and FTPS on port 990) that this server requires.
|
|
351
|
-
|
|
352
|
-
**Important:** Enabling LAN Only Mode disconnects the printer from Bambu Lab's cloud services. The Bambu Handy mobile app will stop working while this mode is active. Bambu Studio and OrcaSlicer can still connect over LAN.
|
|
353
|
-
|
|
354
|
-
### Step 3: Enable Developer Mode
|
|
355
|
-
|
|
356
|
-
Once LAN Only Mode is on, a **Developer Mode** option appears in the same settings menu. Toggle it **ON**. This allows third-party clients (like this MCP server) to authenticate and send commands over MQTT.
|
|
357
|
-
|
|
358
|
-
### Step 4: Note the Access Code
|
|
359
|
-
|
|
360
|
-
The **Access Code** displayed on the network settings screen is your LAN access token. You will need this value for the `BAMBU_TOKEN` environment variable.
|
|
361
|
-
|
|
362
|
-
<p align="center">
|
|
363
|
-
<img src="docs/images/p1s-access-code.jpeg" width="400" alt="P1S network settings showing the Access Code field" />
|
|
364
|
-
</p>
|
|
365
|
-
|
|
366
|
-
The access code can be refreshed by tapping the circular arrow icon next to it. If you refresh it, any existing connections using the old code will be disconnected and you will need to update your configuration with the new code.
|
|
367
|
-
|
|
368
|
-
---
|
|
369
|
-
|
|
370
|
-
## Finding Your Bambu Printer's Serial Number and Access Token
|
|
371
|
-
|
|
372
|
-
Two values are required to connect directly to a Bambu Lab printer over your local network: the printer's serial number and its LAN access token (the Access Code from Developer Mode setup above).
|
|
373
|
-
|
|
374
|
-
### Serial number
|
|
375
|
-
|
|
376
|
-
The serial number is printed on a sticker on the back or underside of the printer. It typically follows one of these formats:
|
|
377
|
-
|
|
378
|
-
- P1 Series: begins with `01P`
|
|
379
|
-
- X1 Series: begins with `01X`
|
|
380
|
-
- A1 Series: begins with `01A`
|
|
381
|
-
|
|
382
|
-
You can also find it on the printer's touchscreen. Navigate to **Settings** and select the **Device Info** page:
|
|
383
|
-
|
|
384
|
-
<p align="center">
|
|
385
|
-
<img src="docs/images/p1s-device-info.jpeg" width="400" alt="P1S device info screen showing model name, serial number, AMS serial, and printing time" />
|
|
386
|
-
</p>
|
|
387
|
-
|
|
388
|
-
The **Printer** line shows your serial number. In Bambu Studio, you can also find it under Device > Device Management in the printer information panel.
|
|
389
|
-
|
|
390
|
-
### LAN access token
|
|
391
|
-
|
|
392
|
-
The access token is the **Access Code** shown on the printer's network settings screen. It is separate from your Bambu Cloud account password. If you followed the [Developer Mode setup](#enabling-developer-mode-required) above, you already have this value.
|
|
393
|
-
|
|
394
|
-
**P1 Series (P1P, P1S):**
|
|
395
|
-
1. On the printer touchscreen, go to Settings.
|
|
396
|
-
2. Select the Network / WLAN page.
|
|
397
|
-
3. The Access Code is displayed at the bottom of the screen.
|
|
398
|
-
|
|
399
|
-
**X1 Series (X1C, X1E):**
|
|
400
|
-
1. On the printer touchscreen, go to Settings.
|
|
401
|
-
2. Select Network.
|
|
402
|
-
3. Enable LAN Only Mode and Developer Mode if not already on.
|
|
403
|
-
4. The Access Code appears on this screen.
|
|
404
|
-
|
|
405
|
-
**A1 and A1 Mini:**
|
|
406
|
-
1. Open the Bambu Handy app on your phone.
|
|
407
|
-
2. Connect to your printer.
|
|
408
|
-
3. Navigate to Settings > Network.
|
|
409
|
-
4. The Access Code is shown here.
|
|
410
|
-
|
|
411
|
-
Your printer must also be logged into a Bambu Cloud account for LAN mode to function. You can verify this on the cloud/account settings screen:
|
|
412
|
-
|
|
413
|
-
<p align="center">
|
|
414
|
-
<img src="docs/images/p1s-cloud-account.jpeg" width="400" alt="P1S cloud account screen showing logged-in user with Logout button" />
|
|
415
|
-
</p>
|
|
416
|
-
|
|
417
|
-
**Troubleshooting:** If the LAN Only Mode or Developer Mode options are not visible, your printer firmware is likely outdated. Update to the latest firmware version through Bambu Studio or the Bambu Handy app and try again.
|
|
182
|
+
</details>
|
|
418
183
|
|
|
419
|
-
|
|
184
|
+
<details>
|
|
185
|
+
<summary><strong>AMS (Automatic Material System) Setup</strong></summary>
|
|
420
186
|
|
|
421
187
|
## AMS (Automatic Material System) Setup
|
|
422
188
|
|
|
@@ -444,20 +210,20 @@ If you need to override the embedded mapping (for example, you swapped filament
|
|
|
444
210
|
|
|
445
211
|
Each element in the array corresponds to a filament slot used in the print file, in the order they appear in the slicer. The value is the physical AMS slot number (0-based) where that filament is currently loaded. In the example above, the first filament in the print uses AMS slot 0, and the second uses AMS slot 2.
|
|
446
212
|
|
|
447
|
-
|
|
213
|
+
Mapping is positional: each entry corresponds to a project filament, and `-1` means unused. H2/P2S project-file commands use project-length mapping plus a parallel `ams_mapping2`; other project-file routes retain at least five positions without truncating longer projects. Prefer `ams_slots` in plate filament order or `auto_match_ams: true` when you do not already have the full project mapping.
|
|
448
214
|
|
|
449
215
|
### Single-material prints
|
|
450
216
|
|
|
451
|
-
For a single-material
|
|
217
|
+
For a single-material plate, explicitly select its loaded tray. For example, use AMS slot 2:
|
|
452
218
|
|
|
453
219
|
```json
|
|
454
220
|
{
|
|
455
221
|
"three_mf_path": "/path/to/model.3mf",
|
|
456
|
-
"
|
|
222
|
+
"ams_slots": [2]
|
|
457
223
|
}
|
|
458
224
|
```
|
|
459
225
|
|
|
460
|
-
This
|
|
226
|
+
This expands slot 2 into the correct project filament position. There is no universal fixed default mapping for every model and project.
|
|
461
227
|
|
|
462
228
|
### Printing without AMS
|
|
463
229
|
|
|
@@ -470,6 +236,8 @@ If you are using the direct-feed spool holder (no AMS attached) or want to bypas
|
|
|
470
236
|
}
|
|
471
237
|
```
|
|
472
238
|
|
|
239
|
+
For H2 projects with declared filaments, also provide the required mapping; `use_ams: false` alone does not remove the firmware's mapping requirement. See [`print_3mf`](#print_3mf).
|
|
240
|
+
|
|
473
241
|
### Auto-match AMS by RFID
|
|
474
242
|
|
|
475
243
|
For pre-sliced 3MFs that declare filament types, the `auto_match_ams` flag on `print_3mf` (or the standalone `resolve_3mf_ams_slots` dry-run tool) automatically resolves the required filaments against your live AMS inventory. The matcher works as follows:
|
|
@@ -500,19 +268,22 @@ Use `get_printer_filaments` for the parsed, enriched view (profile paths, displa
|
|
|
500
268
|
"What filaments are loaded in my AMS right now?"
|
|
501
269
|
```
|
|
502
270
|
|
|
503
|
-
|
|
271
|
+
</details>
|
|
272
|
+
|
|
273
|
+
<details>
|
|
274
|
+
<summary><strong>Bambu Communication Notes (MQTT and FTP)</strong></summary>
|
|
504
275
|
|
|
505
276
|
## Bambu Communication Notes (MQTT and FTP)
|
|
506
277
|
|
|
507
278
|
Bambu Lab printers do not use a conventional REST API. Instead, they expose two local protocols that this server uses directly:
|
|
508
279
|
|
|
509
|
-
**MQTT (port 8883, TLS):** All printer commands and state reports flow over an MQTT broker running on the printer itself.
|
|
280
|
+
**MQTT (port 8883, TLS):** All printer commands and state reports flow over an MQTT broker running on the printer itself. Authentication uses username `bblp` and your LAN access code; the serial number identifies the device topics. Commands like starting a print, cancelling a job, and dispatching G-code lines are all MQTT publishes to the device topic. Status data is received by subscribing to the printer's report topic and requesting a `push_all` refresh. This implementation is based on community reverse engineering documented in the [OpenBambuAPI](https://github.com/Doridian/OpenBambuAPI) project.
|
|
510
281
|
|
|
511
282
|
**FTPS (port 990, implicit TLS):** File operations (upload and directory listing) use FTPS. The printer's SD card is accessible as a filesystem with directories including `cache/` (for 3MF and G-code print files), `timelapse/`, and `logs/`. Authentication uses the username `bblp` and your access token as the password.
|
|
512
283
|
|
|
513
284
|
### What this fork fixes
|
|
514
285
|
|
|
515
|
-
|
|
286
|
+
This package works around two protocol-level issues in the underlying `bambu-js` library.
|
|
516
287
|
|
|
517
288
|
**Bug 1: FTP double-path error in bambu-js.**
|
|
518
289
|
|
|
@@ -539,15 +310,15 @@ private async ftpUpload(host, token, localPath, remotePath): Promise<void> {
|
|
|
539
310
|
|
|
540
311
|
The `bambu-js` library's project file command hardcodes `use_ams: true` and does not support the `ams_mapping` field at all. Without the fix, the mapping is a simple array of slot indices (e.g., `[0, 2]`), which does not match the OpenBambuAPI specification.
|
|
541
312
|
|
|
542
|
-
|
|
313
|
+
For the non-H2/P2S project-file route, this implementation retains at least five positions in the `ams_mapping` array where position `i` is the project filament index and the value is the AMS slot feeding that filament. For example, a single-filament print from AMS slot 0 sends `[0, -1, -1, -1, -1]`.
|
|
543
314
|
|
|
544
315
|
This fork sends the `project_file` command directly via `bambu-node` (bypassing `bambu-js` entirely for print initiation) and constructs the mapping in the format the target firmware expects:
|
|
545
316
|
|
|
546
317
|
```typescript
|
|
547
|
-
//
|
|
318
|
+
// Non-H2/P2S project_file: at least five entries; preserve longer projects
|
|
548
319
|
ams_mapping = [0, -1, -1, -1, -1];
|
|
549
320
|
|
|
550
|
-
// H2S/H2D/H2C: project-length lookup table + parallel ams_mapping2
|
|
321
|
+
// H2S/H2D/H2C/P2S: project-length lookup table + parallel ams_mapping2
|
|
551
322
|
ams_mapping = [-1, 1, -1, -1];
|
|
552
323
|
ams_mapping2 = [
|
|
553
324
|
{ ams_id: 255, slot_id: 255 },
|
|
@@ -561,7 +332,7 @@ The command payload also includes all required fields per the OpenBambuAPI spec:
|
|
|
561
332
|
|
|
562
333
|
### Verified print procedure (H2S, LAN-only, no client cert)
|
|
563
334
|
|
|
564
|
-
This is the sequence that successfully started a print on an H2S
|
|
335
|
+
This is the sequence that successfully started a print on an H2S in the original LAN-only test. It's documented here because several common approaches fail on this firmware, and this fork's transport is what makes it reliable.
|
|
565
336
|
|
|
566
337
|
**Result:** print started in `RUNNING` state, printer accepted the MQTT `project_file` command, no client certificate was required. Authentication was plain `bblp` + LAN access code over TLS with `rejectUnauthorized: false`.
|
|
567
338
|
|
|
@@ -624,12 +395,15 @@ This is the sequence that successfully started a print on an H2S running current
|
|
|
624
395
|
- No client X.509 certificate was needed. The earlier assumption that post-Jan 2025 firmware mandates mTLS on all models does not hold for the H2S in LAN mode — user/password over TLS is sufficient.
|
|
625
396
|
- The MCP server's `ftpUpload` helper (basic-ftp with `secure: "implicit"` and a short idle timeout) performs the equivalent upload natively and is the preferred path when using the server itself; the curl form is the manual-debug equivalent.
|
|
626
397
|
|
|
627
|
-
|
|
398
|
+
</details>
|
|
399
|
+
|
|
400
|
+
<details>
|
|
401
|
+
<summary><strong>Available Tools</strong></summary>
|
|
628
402
|
|
|
629
403
|
## Available Tools
|
|
630
404
|
|
|
631
405
|
<details>
|
|
632
|
-
<summary><strong>
|
|
406
|
+
<summary><strong>STL Manipulation Tools</strong></summary>
|
|
633
407
|
|
|
634
408
|
### STL Manipulation Tools
|
|
635
409
|
|
|
@@ -733,7 +507,7 @@ Note: this works best on models with a clearly dominant flat face. Results on or
|
|
|
733
507
|
</details>
|
|
734
508
|
|
|
735
509
|
<details>
|
|
736
|
-
<summary><strong>
|
|
510
|
+
<summary><strong>Printer Control Tools</strong></summary>
|
|
737
511
|
|
|
738
512
|
### Printer Control Tools
|
|
739
513
|
|
|
@@ -803,7 +577,7 @@ Capture a single JPEG frame from the printer's chamber camera. Read-only.
|
|
|
803
577
|
Two transports are wired in, picked by `bambu_model`:
|
|
804
578
|
|
|
805
579
|
- **TCP-on-6000** for **A1, A1 mini, P1S, P1P**. Native protocol per [OpenBambuAPI/video.md](https://github.com/Doridian/OpenBambuAPI/blob/main/video.md): TLS on port 6000, 80-byte auth packet (`bblp` + access token), repeating 16-byte frame header + JPEG payload.
|
|
806
|
-
- **RTSP** for **X1, X1 Carbon, X1E, P2S** and **H2, H2S, H2D, H2C, H2D Pro**. Shells out to ffmpeg with `rtsps://bblp:<token>@<host>:322/streaming/live/1 -frames:v 1`. The H2 series wasn't documented in OpenBambuAPI's `video.md` but its firmware uses the same RTSP endpoint as X1 (verified live against an H2S, 2026-04-27).
|
|
580
|
+
- **RTSP** for **X1, X1 Carbon, X1E, P2S, X2D** and **H2, H2S, H2D, H2C, H2D Pro**. Shells out to ffmpeg with `rtsps://bblp:<token>@<host>:322/streaming/live/1 -frames:v 1`. The H2 series wasn't documented in OpenBambuAPI's `video.md` but its firmware uses the same RTSP endpoint as X1 (verified live against an H2S, 2026-04-27).
|
|
807
581
|
|
|
808
582
|
**Requires ffmpeg in PATH** for the RTSP path. Install with `brew install ffmpeg` on macOS. Configure a trusted custom binary with the server-side `FFMPEG_PATH` environment variable, or set `MCP_ALLOW_EXECUTABLE_ARG=1` before using the `ffmpeg_path` tool argument. The TCP-on-6000 path uses native Node TLS and does not require ffmpeg.
|
|
809
583
|
|
|
@@ -838,6 +612,9 @@ A bare filename defaults to `cache/<filename>`. To target other directories pass
|
|
|
838
612
|
|
|
839
613
|
```json
|
|
840
614
|
{ "filename": "timelapse/2026-04-26_12-00.mp4", "confirm": true }
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
```json
|
|
841
618
|
{ "filename": "logs/printer.log", "confirm": true }
|
|
842
619
|
```
|
|
843
620
|
|
|
@@ -1053,13 +830,13 @@ To stop drying:
|
|
|
1053
830
|
|
|
1054
831
|
#### print_3mf
|
|
1055
832
|
|
|
1056
|
-
The primary tool for starting a Bambu print. **Recommended input: a pre-sliced `.gcode.3mf` exported from Bambu Studio** — see [
|
|
833
|
+
The primary tool for starting a Bambu print. **Recommended input: a pre-sliced `.gcode.3mf` exported from FULU OrcaSlicer-bambulab, OrcaSlicer, or Bambu Studio** — see [slicing guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md). This tool handles the complete workflow:
|
|
1057
834
|
|
|
1058
835
|
1. Checks whether the 3MF contains embedded G-code (`Metadata/plate_<n>.gcode` entries).
|
|
1059
|
-
2. If no G-code is found, attempts to auto-slice via the configured slicer.
|
|
836
|
+
2. If no G-code is found, attempts to auto-slice via the configured slicer. Profile preparation or slicing failures stop the operation before upload. See the slicing guide for tested CLI versions and combinations.
|
|
1060
837
|
3. Parses the sliced 3MF to extract the correct plate file and compute its MD5 hash.
|
|
1061
|
-
4.
|
|
1062
|
-
5. Uploads
|
|
838
|
+
4. Reads slicer metadata and any explicit AMS selection to build the filament mapping.
|
|
839
|
+
5. Uploads via `basic-ftp` to the model-specific location: SD root for H2/full-size A1, `cache/` for P1/X1/A1 mini/P2S. X2D direct printing stops before upload.
|
|
1063
840
|
6. Sends the correct MQTT print command for the target printer family. For H2S/H2D/H2C that means `project_file` with project-length `ams_mapping`, parallel `ams_mapping2`, and H2-compatible calibration flags.
|
|
1064
841
|
|
|
1065
842
|
```json
|
|
@@ -1079,7 +856,7 @@ The primary tool for starting a Bambu print. **Recommended input: a pre-sliced `
|
|
|
1079
856
|
}
|
|
1080
857
|
```
|
|
1081
858
|
|
|
1082
|
-
`bambu_model` is **required**
|
|
859
|
+
`bambu_model` is **required** for model-specific routing and preset selection. It does not by itself validate the G-code or guarantee matching output from the FULU/Orca CLI; use GUI-exported sliced projects for those slicers while the machine-preset gate is missing. Using the wrong model can damage hardware. If `bambu_model` is not provided in the tool call and `BAMBU_MODEL` is not set in the environment, the server will ask you interactively via MCP elicitation (if your client supports it) or return a clear error.
|
|
1083
860
|
|
|
1084
861
|
`bed_type` defaults to `textured_plate` if omitted. `ams_slots` is the preferred override input; `ams_mapping` remains the raw escape hatch. On AMS-equipped H2 printers, `use_ams: false` does not suppress mapping lookup if the sliced file declares filaments. If no mapping is provided for an H2 pre-sliced job with declared filaments, the server fails before sending; pass explicit `ams_slots`, raw `ams_mapping`, or `auto_match_ams: true`.
|
|
1085
862
|
|
|
@@ -1087,6 +864,20 @@ Set `auto_match_ams: true` to match the sliced 3MF's `tray_info_idx` values agai
|
|
|
1087
864
|
|
|
1088
865
|
Layer height, nozzle temperature, and other slicer parameters cannot be overridden via this tool -- they are baked into the 3MF's G-code at slice time. Apply those settings in your slicer before generating the 3MF.
|
|
1089
866
|
|
|
867
|
+
For the optional FULU bridge, set `connection_mode: "bambu_network"` and explicitly choose `connection_type: "cloud"` or `"lan"`; see [FULU setup](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md). A successful command submission is not proof that the printer accepted it: inspect printer state, HMS errors, and the printer itself.
|
|
868
|
+
|
|
869
|
+
#### bambu_network_bridge_status
|
|
870
|
+
|
|
871
|
+
Inspect the configured FULU bridge without starting it using `{}`. Use `{"connect": true}` to launch the host, handshake, and initialize an agent. See [bridge probes](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md#probe-without-printing) for interpreting the result.
|
|
872
|
+
|
|
873
|
+
#### bambu_network_call
|
|
874
|
+
|
|
875
|
+
Call a runtime method such as `{"method": "net.is_user_login", "payload": {}}`. The default injects the initialized agent; use `with_agent: false` for `bridge.handshake`. Raw methods can mutate runtime or printer state; use the method contract from your installed FULU build.
|
|
876
|
+
|
|
877
|
+
#### print_3mf_bambu_network
|
|
878
|
+
|
|
879
|
+
Submit a sliced project through FULU's separately configured networking runtime. `connection_type` defaults to `cloud`; LAN bridge jobs also require a printer IP and access code. `bambu_model` and a device ID are required. See [print examples and AMS requirements](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md#print-through-the-bridge). A zero bridge return code confirms submission, not a physical print or direct X2D support.
|
|
880
|
+
|
|
1090
881
|
#### resolve_3mf_ams_slots
|
|
1091
882
|
|
|
1092
883
|
Dry-run the AMS match without uploading or starting a print. The tool reads `Metadata/plate_<n>.json` and `Metadata/slice_info.config`, then compares required `tray_info_idx` values against live AMS trays.
|
|
@@ -1155,11 +946,11 @@ If the project does not match those assumptions, the tool fails fast with a stru
|
|
|
1155
946
|
</details>
|
|
1156
947
|
|
|
1157
948
|
<details>
|
|
1158
|
-
<summary><strong>
|
|
949
|
+
<summary><strong>Slicing Tools</strong></summary>
|
|
1159
950
|
|
|
1160
951
|
### Slicing Tools
|
|
1161
952
|
|
|
1162
|
-
> **Note:** the verified workflow is to slice in Bambu Studio (GUI) and feed the resulting `.gcode.3mf` to `print_3mf`. The CLI-driven slicing tools below (`slice_stl`, `slice_with_template`) work but are sensitive to profile drift and are not the recommended path for production prints. See [
|
|
953
|
+
> **Note:** the verified workflow is to slice in Bambu Studio (GUI) and feed the resulting `.gcode.3mf` to `print_3mf`. The CLI-driven slicing tools below (`slice_stl`, `slice_with_template`) work but are sensitive to profile drift and are not the recommended path for production prints. See [slicing guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md).
|
|
1163
954
|
|
|
1164
955
|
#### list_templates
|
|
1165
956
|
|
|
@@ -1212,24 +1003,25 @@ This uses the named template as the slicing profile source and still supports li
|
|
|
1212
1003
|
|
|
1213
1004
|
#### slice_stl
|
|
1214
1005
|
|
|
1215
|
-
Slice an STL or 3MF file using an external slicer and return the path to the output file. The output is a sliced 3MF (for BambuStudio and OrcaSlicer) or a G-code file (for PrusaSlicer, Cura, Slic3r).
|
|
1006
|
+
Slice an STL or 3MF file using an external slicer and return the path to the output file. The output is a sliced 3MF (for BambuStudio, OrcaSlicer, and FULU OrcaSlicer-bambulab) or a G-code file (for PrusaSlicer, Cura, Slic3r).
|
|
1216
1007
|
|
|
1217
1008
|
```json
|
|
1218
1009
|
{
|
|
1219
1010
|
"stl_path": "/path/to/model.stl",
|
|
1220
1011
|
"slicer_type": "bambustudio",
|
|
1221
|
-
"
|
|
1222
|
-
"slicer_profile": "/path/to/profile.ini"
|
|
1012
|
+
"bambu_model": "p1s"
|
|
1223
1013
|
}
|
|
1224
1014
|
```
|
|
1225
1015
|
|
|
1226
|
-
`slicer_type` options: `bambustudio`, `orcaslicer`, `prusaslicer`, `cura`, `slic3r`. When omitted, the value from the `SLICER_TYPE` environment variable is used (default: `bambustudio`).
|
|
1016
|
+
`slicer_type` options: `bambustudio`, `orcaslicer`, `orcaslicer-bambulab` (FULU), `prusaslicer`, `cura`, `slic3r`. Aliases include `fulu-orca` and `orca-studio`. When omitted, the value from the `SLICER_TYPE` environment variable is used (default: `bambustudio`).
|
|
1017
|
+
|
|
1018
|
+
**FULU/Orca CLI limitation:** recognized slicer names do not guarantee that a missing machine preset is rejected. Use GUI-exported sliced projects instead of those CLI backends until the [machine-preset gate is implemented](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md#fulu-and-orca-cli-safety-limit).
|
|
1227
1019
|
|
|
1228
1020
|
`slicer_path` and `slicer_profile` fall back to the `SLICER_PATH` and `SLICER_PROFILE` environment variables when omitted. Per-call `slicer_path` overrides require `MCP_ALLOW_EXECUTABLE_ARG=1`.
|
|
1229
1021
|
|
|
1230
1022
|
You can provide either `template_3mf_path` or `template_name` when you want to slice from a saved template. `template_name` resolves through the local template registry directory configured for the server.
|
|
1231
1023
|
|
|
1232
|
-
For printing on a Bambu printer, the recommended workflow is:
|
|
1024
|
+
For printing on a Bambu printer, the recommended workflow is: export a sliced 3MF from your selected Bambu-compatible slicer, then pass that output path to `print_3mf`.
|
|
1233
1025
|
|
|
1234
1026
|
#### BambuStudio Slicer Options
|
|
1235
1027
|
|
|
@@ -1246,6 +1038,7 @@ When `slicer_type` is `bambustudio` (the default), these additional parameters a
|
|
|
1246
1038
|
| `skip_objects` | string | Object indices to skip, comma-separated (e.g. `"3,5,10"`) |
|
|
1247
1039
|
| `load_filaments` | string | Filament profile paths, semicolon-separated |
|
|
1248
1040
|
| `load_filament_ids` | string | Filament-to-object mapping, comma-separated |
|
|
1041
|
+
| `filament_colours` | string | Slot colours, one `#RRGGBB` per filament slot, semicolon-separated. Explicit values take priority, followed by input 3MF colours, each custom profile's colour, then the BambuStudio default. |
|
|
1249
1042
|
| `enable_timelapse` | boolean | Enable timelapse-aware slicing |
|
|
1250
1043
|
| `allow_mix_temp` | boolean | Allow mixed-temperature filaments on one plate |
|
|
1251
1044
|
| `scale` | number | Uniform scale factor |
|
|
@@ -1276,12 +1069,12 @@ When `print_3mf` detects an unsliced 3MF and auto-slices it, these defaults are
|
|
|
1276
1069
|
- `min_save: true` -- smaller output for faster FTP uploads to the printer
|
|
1277
1070
|
- `skip_modified_gcodes: true` -- strips custom gcodes from other users' profiles
|
|
1278
1071
|
|
|
1279
|
-
These defaults
|
|
1072
|
+
These defaults reduce stale-profile problems; inspect downloaded models and their slice preview before printing. When calling `slice_stl` directly, you have full control over every flag.
|
|
1280
1073
|
|
|
1281
1074
|
</details>
|
|
1282
1075
|
|
|
1283
1076
|
<details>
|
|
1284
|
-
<summary><strong>
|
|
1077
|
+
<summary><strong>Advanced Tools</strong></summary>
|
|
1285
1078
|
|
|
1286
1079
|
### Advanced Tools
|
|
1287
1080
|
|
|
@@ -1351,7 +1144,10 @@ configuration is an error when execution is requested. Per-call legacy
|
|
|
1351
1144
|
|
|
1352
1145
|
</details>
|
|
1353
1146
|
|
|
1354
|
-
|
|
1147
|
+
</details>
|
|
1148
|
+
|
|
1149
|
+
<details>
|
|
1150
|
+
<summary><strong>Available Resources</strong></summary>
|
|
1355
1151
|
|
|
1356
1152
|
## Available Resources
|
|
1357
1153
|
|
|
@@ -1367,7 +1163,10 @@ Resources follow the MCP resource protocol and can be read by calling `ReadResou
|
|
|
1367
1163
|
|
|
1368
1164
|
**Example:** To read the status of the default printer, use URI `printer://192.168.1.100/status`. The host segment must match a configured printer IP; the server uses `PRINTER_HOST` if the default URI template is used.
|
|
1369
1165
|
|
|
1370
|
-
|
|
1166
|
+
</details>
|
|
1167
|
+
|
|
1168
|
+
<details>
|
|
1169
|
+
<summary><strong>Example Commands for Claude</strong></summary>
|
|
1371
1170
|
|
|
1372
1171
|
## Example Commands for Claude
|
|
1373
1172
|
|
|
@@ -1400,7 +1199,8 @@ After connecting the MCP server in Claude Desktop or Claude Code, you can ask Cl
|
|
|
1400
1199
|
- "Upload bracket.3mf to the printer and start printing with AMS slots 0 and 1."
|
|
1401
1200
|
- "Print my_model.3mf with bed leveling enabled and vibration calibration off."
|
|
1402
1201
|
- "Upload this 3MF without printing it yet."
|
|
1403
|
-
- "
|
|
1202
|
+
- "Use FULU OrcaSlicer-bambulab to prepare this model, then show me the sliced output before printing."
|
|
1203
|
+
- "Probe the FULU BambuNetwork bridge without starting a print."
|
|
1404
1204
|
|
|
1405
1205
|
### STL manipulation
|
|
1406
1206
|
|
|
@@ -1419,27 +1219,33 @@ After connecting the MCP server in Claude Desktop or Claude Code, you can ask Cl
|
|
|
1419
1219
|
- "Take this unsliced 3MF, slice it with BambuStudio, and print the result."
|
|
1420
1220
|
- "Scale this part to 80% of its size, lay it flat, and start a print."
|
|
1421
1221
|
|
|
1422
|
-
|
|
1222
|
+
</details>
|
|
1223
|
+
|
|
1224
|
+
<details>
|
|
1225
|
+
<summary><strong>Bambu Lab Printer Limitations</strong></summary>
|
|
1423
1226
|
|
|
1424
1227
|
## Bambu Lab Printer Limitations
|
|
1425
1228
|
|
|
1426
1229
|
Understanding these constraints will help you avoid frustrating errors and set appropriate expectations.
|
|
1427
1230
|
|
|
1428
|
-
1. **Printable 3MF required for print_3mf.** The `print_3mf` tool expects a sliced 3MF containing at least one `Metadata/plate_<n>.gcode` entry. If you pass an unsliced 3MF (one exported from a CAD tool without slicing), the server
|
|
1231
|
+
1. **Printable 3MF required for print_3mf.** The `print_3mf` tool expects a sliced 3MF containing at least one `Metadata/plate_<n>.gcode` entry. If you pass an unsliced 3MF (one exported from a CAD tool without slicing), the server attempts auto-slicing. Use the validated BambuStudio CLI path for that; FULU/Orca users must supply GUI-exported sliced files while their CLI preset gate is missing — any inspection or slicing failure stops before upload. For a previewable workflow, pre-slice in FULU OrcaSlicer-bambulab, OrcaSlicer, or Bambu Studio and pass the resulting `.gcode.3mf`. See [slicing guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md) for the full procedure.
|
|
1429
1232
|
|
|
1430
1233
|
2. **Layer height, temperature, and slicer settings are baked in.** The `project_file` MQTT command tells the printer which plate to run. It does not support overriding layer height, temperature targets, infill percentage, or other slicing parameters at print time. These must be set in your slicer before generating the 3MF.
|
|
1431
1234
|
|
|
1432
|
-
3. **G-code and 3MF jobs use different command paths.** `start_print_job` sends a `GCodeFileCommand` over MQTT and is intended only for plain G-code files stored in the `cache/` directory.
|
|
1235
|
+
3. **G-code and 3MF jobs use different command paths.** `start_print_job` sends a `GCodeFileCommand` over MQTT and is intended only for plain G-code files stored in the `cache/` directory. Sliced 3MF files must go through `print_3mf`, which selects the model-specific command and upload location. See the [routing table](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/SLICING.md#firmware-routing-handled-internally). Mixing these up will result in the printer either ignoring the command or displaying an error.
|
|
1433
1236
|
|
|
1434
1237
|
4. **Temperature commands depend on printer state.** `set_temperature` dispatches M104 or M140 G-code via MQTT. Whether the printer accepts these commands depends on its current firmware version and operational state. Some printer states (such as the idle screen with AMS management open) may ignore or queue the commands.
|
|
1435
1238
|
|
|
1436
|
-
5. **
|
|
1239
|
+
5. **Status and command submission are separate evidence.** Local MQTT connections are reused and status is read from received printer reports. Reports can lag during startup, sleep, or state transitions. Inspect HMS errors and the printer's actual state after submitting a job; a tool's success response is not physical-print confirmation.
|
|
1437
1240
|
|
|
1438
|
-
6. **
|
|
1241
|
+
6. **Network requirements depend on the path.** Direct MQTT/FTPS tools require local reachability and compatible LAN/Developer Mode settings. FULU bridge cloud jobs use BambuNetwork and require its runtime, internet access, and authentication. Standard status, camera, file, and control tools remain local; bridge printing does not turn them into cloud tools.
|
|
1439
1242
|
|
|
1440
1243
|
7. **Self-signed TLS certificate.** The printer's FTPS server uses a self-signed certificate. The `basic-ftp` client is configured with `rejectUnauthorized: false` to accept it. This is standard for local network Bambu connections but assumes a trusted local network environment.
|
|
1441
1244
|
|
|
1442
|
-
|
|
1245
|
+
</details>
|
|
1246
|
+
|
|
1247
|
+
<details>
|
|
1248
|
+
<summary><strong>General Limitations and Considerations</strong></summary>
|
|
1443
1249
|
|
|
1444
1250
|
## General Limitations and Considerations
|
|
1445
1251
|
|
|
@@ -1465,7 +1271,10 @@ STL manipulation tools load the entire mesh into memory as Three.js geometry. Fo
|
|
|
1465
1271
|
- FTPS uploads for large 3MF files (multi-plate prints, high-detail models) may take 15 to 60 seconds depending on your local network speed.
|
|
1466
1272
|
- MQTT connections are pooled by `host + serial` key. The first call to any printer tool in a session establishes the MQTT connection; subsequent calls reuse it. If the connection drops (printer power cycled, network interruption), the next call will reconnect automatically.
|
|
1467
1273
|
|
|
1468
|
-
|
|
1274
|
+
</details>
|
|
1275
|
+
|
|
1276
|
+
<details>
|
|
1277
|
+
<summary><strong>License</strong></summary>
|
|
1469
1278
|
|
|
1470
1279
|
## License
|
|
1471
1280
|
|
|
@@ -1473,6 +1282,15 @@ GPL-2.0. See [LICENSE](./LICENSE) for the full text.
|
|
|
1473
1282
|
|
|
1474
1283
|
This project is a fork of [mcp-3D-printer-server](https://github.com/DMontgomery40/mcp-3D-printer-server) by David Montgomery, also GPL-2.0.
|
|
1475
1284
|
|
|
1285
|
+
</details>
|
|
1286
|
+
|
|
1287
|
+
<details>
|
|
1288
|
+
<summary><strong>Acknowledgements</strong></summary>
|
|
1289
|
+
|
|
1476
1290
|
## Acknowledgements
|
|
1477
1291
|
|
|
1292
|
+
Thank you to **[FULU Foundation](https://www.fulu.org/), [Louis Rossmann](https://www.youtube.com/watch?v=1jhRqgHxEP8), and the [OrcaSlicer-bambulab community](https://github.com/FULU-Foundation/OrcaSlicer-bambulab)** for advancing user choice and interoperability. Our support for open-source tools, repair rights, and printing without Bambu's software or cloud is a project priority. See the [FULU setup guide](https://github.com/DMontgomery40/bambu-printer-mcp/blob/main/docs/FULU.md) and [contributor credits](./CONTRIBUTORS.md).
|
|
1293
|
+
|
|
1478
1294
|
Some printer command surfaces and workflow priorities were informed by [Bambuddy](https://github.com/maziggy/bambuddy), an AGPL-3.0 Bambu Lab printer management project. This project does not vendor Bambuddy code.
|
|
1295
|
+
|
|
1296
|
+
</details>
|