mcp-3d-printer-server 1.2.5 → 1.2.11
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/CHANGELOG.md +228 -0
- package/CONTRIBUTORS.md +49 -0
- package/README.md +529 -739
- package/dist/3mf_parser.js +8 -8
- package/dist/blender-mcp-bridge.d.ts +11 -0
- package/dist/blender-mcp-bridge.js +661 -0
- package/dist/fulu-orca.js +29 -5
- package/dist/index.js +752 -212
- package/dist/printers/bambu-node-guard.d.ts +2 -0
- package/dist/printers/bambu-node-guard.js +38 -0
- package/dist/printers/bambu.d.ts +53 -7
- package/dist/printers/bambu.js +420 -120
- package/dist/printers/creality.d.ts +15 -6
- package/dist/printers/creality.js +42 -9
- package/dist/printers/duet.d.ts +11 -6
- package/dist/printers/duet.js +57 -34
- package/dist/printers/generic-base.d.ts +69 -0
- package/dist/printers/generic-base.js +209 -0
- package/dist/printers/klipper.d.ts +17 -6
- package/dist/printers/klipper.js +63 -16
- package/dist/printers/octoprint.d.ts +18 -6
- package/dist/printers/octoprint.js +64 -9
- package/dist/printers/printer-factory.d.ts +11 -2
- package/dist/printers/printer-factory.js +9 -8
- package/dist/printers/prusa.d.ts +14 -6
- package/dist/printers/prusa.js +56 -9
- package/dist/printers/repetier.d.ts +18 -6
- package/dist/printers/repetier.js +48 -6
- package/dist/safety/archive.d.ts +11 -0
- package/dist/safety/archive.js +214 -0
- package/dist/safety/artifact.d.ts +6 -0
- package/dist/safety/artifact.js +66 -0
- package/dist/safety/confirmation.d.ts +22 -0
- package/dist/safety/confirmation.js +43 -0
- package/dist/safety/expected-peaks.d.ts +24 -0
- package/dist/safety/expected-peaks.js +24 -0
- package/dist/safety/gcode-thermal.d.ts +64 -0
- package/dist/safety/gcode-thermal.js +382 -0
- package/dist/safety/limits.d.ts +31 -0
- package/dist/safety/limits.js +105 -0
- package/dist/safety/print-file.d.ts +25 -0
- package/dist/safety/print-file.js +517 -0
- package/dist/safety/printer-state.d.ts +51 -0
- package/dist/safety/printer-state.js +365 -0
- package/dist/slicer/bambu-cli.d.ts +110 -0
- package/dist/slicer/bambu-cli.js +547 -0
- package/dist/slicer/profile-flatten.d.ts +104 -0
- package/dist/slicer/profile-flatten.js +676 -0
- package/dist/slicer/run-slicer.d.ts +18 -0
- package/dist/slicer/run-slicer.js +102 -0
- package/dist/slicer/slicer-error.d.ts +27 -0
- package/dist/slicer/slicer-error.js +53 -0
- package/dist/slicer/templates.d.ts +126 -0
- package/dist/slicer/templates.js +255 -0
- package/dist/stl/stl-manipulator.d.ts +25 -3
- package/dist/stl/stl-manipulator.js +214 -232
- package/package.json +30 -14
- package/server.json +29 -0
- package/src/3mf_parser.ts +8 -8
- package/src/blender-mcp-bridge.ts +611 -0
- package/src/fulu-orca.ts +36 -6
- package/src/index.ts +888 -255
- package/src/printers/bambu-node-guard.ts +44 -0
- package/src/printers/bambu.ts +458 -158
- package/src/printers/creality.ts +40 -9
- package/src/printers/duet.ts +64 -53
- package/src/printers/generic-base.ts +286 -0
- package/src/printers/klipper.ts +83 -28
- package/src/printers/octoprint.ts +74 -21
- package/src/printers/printer-factory.ts +21 -11
- package/src/printers/prusa.ts +53 -10
- package/src/printers/repetier.ts +55 -17
- package/src/safety/archive.ts +181 -0
- package/src/safety/artifact.ts +58 -0
- package/src/safety/confirmation.ts +56 -0
- package/src/safety/expected-peaks.ts +47 -0
- package/src/safety/gcode-thermal.ts +404 -0
- package/src/safety/limits.ts +98 -0
- package/src/safety/print-file.ts +354 -0
- package/src/safety/printer-state.ts +339 -0
- package/src/slicer/bambu-cli.ts +633 -0
- package/src/slicer/profile-flatten.ts +830 -0
- package/src/slicer/run-slicer.ts +126 -0
- package/src/slicer/slicer-error.ts +72 -0
- package/src/slicer/templates.ts +288 -0
- package/src/stl/stl-manipulator.ts +247 -275
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,596 +1,262 @@
|
|
|
1
|
-
|
|
2
|
-
## Thank You To FULU And Louis Rossmann
|
|
3
|
-
|
|
4
|
-
Thank you to the [FULU Foundation](https://github.com/FULU-Foundation/OrcaSlicer-bambulab) and [Louis Rossmann](https://www.youtube.com/@rossmanngroup) for standing up for consumer ownership, open source developers, repair rights, and users who should not have working hardware made worse by locked-down software. This MCP server treats the FULU OrcaSlicer-bambulab fork as a first-class Bambu project slicer target.
|
|
5
|
-
|
|
6
1
|
# MCP 3D Printer Server
|
|
7
2
|
|
|
3
|
+
> **Thank you, [FULU Foundation](https://www.fulu.org/), [Louis Rossmann](https://www.youtube.com/@rossmanngroup), and the [OrcaSlicer-bambulab contributors](https://github.com/FULU-Foundation/OrcaSlicer-bambulab).** Thank you for standing up for consumer ownership, open-source developers, repair rights, and owners whose working hardware should not be made worse by locked-down software.
|
|
4
|
+
>
|
|
5
|
+
> This server treats the FULU OrcaSlicer-bambulab fork as a first-class slicer for Bambu Lab projects. See the [FULU guide](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/FULU.md) for setup and current status.
|
|
6
|
+
|
|
8
7
|
[](https://www.npmjs.com/package/mcp-3d-printer-server)
|
|
9
|
-
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
|
10
|
-
[](https://www.typescriptlang.org/)
|
|
11
|
-
[](https://github.com/yourusername/mcp-3d-printer-server/graphs/commit-activity)
|
|
12
|
-
[](https://makeapullrequest.com)
|
|
13
|
-
[](https://nodejs.org/en/download/)
|
|
14
8
|
[](https://www.npmjs.com/package/mcp-3d-printer-server)
|
|
15
|
-
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
|
10
|
+
[](https://nodejs.org/en/download/)
|
|
11
|
+
[](https://github.com/DMontgomery40/mcp-3D-printer-server)
|
|
12
|
+
|
|
13
|
+
An MCP server that connects Claude, Codex, and other MCP clients to 3D printers running OctoPrint, Klipper (Moonraker), Duet, Repetier-Server, Bambu Lab, PrusaLink or Prusa Connect, and Creality. Your agent can check status, upload and start jobs, cancel prints, edit STL meshes, run your slicer, and hand models to Blender through an optional Blender MCP bridge.
|
|
14
|
+
|
|
15
|
+
**[Browse the documentation site](https://dmontgomery40.github.io/mcp-3D-printer-server/)** for searchable setup guides, per-printer credentials, slicing, and the full tool reference. It is generated from this README and the docs folder.
|
|
16
|
+
|
|
17
|
+
**Only print on Bambu Lab printers?** [bambu-printer-mcp](https://github.com/DMontgomery40/bambu-printer-mcp) is a Bambu-focused fork of this project with more Bambu features, including AMS inventory and matching, camera snapshots, X2D support, and a Claude Desktop extension.
|
|
18
|
+
|
|
19
|
+
Built with help from our [contributors](./CONTRIBUTORS.md). Thank you to everyone sharing fixes, careful bug reports, and real printer testing!
|
|
20
|
+
|
|
21
|
+
---
|
|
16
22
|
|
|
23
|
+
## Set up with your agent
|
|
17
24
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
Tell your agent which **printer system** you use (OctoPrint, Klipper, Bambu Lab, Prusa, and so on) and its **address**, if you know them, then copy and paste this:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
Install mcp-3d-printer-server in the agent/harness I'm using now.
|
|
29
|
+
|
|
30
|
+
Read https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SETUP.md
|
|
31
|
+
for the current setup instructions and supported printer backends.
|
|
32
|
+
|
|
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 mcp-3d-printer-server, stdio); use Node.js 24 if a runtime is needed.
|
|
36
|
+
|
|
37
|
+
Ask which printer system I use and set PRINTER_TYPE to match. Never guess it.
|
|
38
|
+
Then ask only for the values that backend needs:
|
|
39
|
+
- octoprint: PRINTER_HOST, PRINTER_PORT if not 80, API_KEY
|
|
40
|
+
- klipper (Moonraker): PRINTER_HOST, PRINTER_PORT (usually 7125),
|
|
41
|
+
API_KEY if Moonraker requires authentication
|
|
42
|
+
- duet: PRINTER_HOST, PRINTER_PORT if not 80
|
|
43
|
+
- repetier: PRINTER_HOST, PRINTER_PORT (usually 3344), API_KEY
|
|
44
|
+
- bambu: PRINTER_HOST, BAMBU_SERIAL, BAMBU_TOKEN (the LAN access code),
|
|
45
|
+
and BAMBU_MODEL
|
|
46
|
+
- prusa: PRINTER_HOST (PrusaLink address or connect.prusa3d.com), API_KEY
|
|
47
|
+
- creality: PRINTER_HOST, PRINTER_PORT if not 80, API_KEY (bearer token)
|
|
48
|
+
For Bambu Lab, confirm the exact printer model with me; never guess it, and
|
|
49
|
+
explain any LAN Only Mode or Developer Mode setting I need to enable.
|
|
50
|
+
Keep keys, tokens, and access codes in local/private configuration; do not
|
|
51
|
+
repeat them in chat.
|
|
52
|
+
|
|
53
|
+
Bambu Lab has the most hardware testing. The other backends use each
|
|
54
|
+
system's HTTP API and rely on community reports, so tell me plainly if a
|
|
55
|
+
backend does not respond as the guide describes.
|
|
56
|
+
|
|
57
|
+
Offer these optional extras, and set them up only if I choose them:
|
|
58
|
+
- Blender MCP for model edits: uvx mcp-for-blender (formerly blender-mcp,
|
|
59
|
+
which now installs it as a compatibility wrapper). Its Blender addon must be
|
|
60
|
+
installed, enabled, and connected inside Blender.
|
|
61
|
+
- A slicer for slice_stl: look for an installed PrusaSlicer, OrcaSlicer,
|
|
62
|
+
FULU OrcaSlicer-bambulab, Bambu Studio, or CuraEngine before suggesting
|
|
63
|
+
an install.
|
|
64
|
+
Configure executables in the server environment. Do not enable
|
|
65
|
+
MCP_ALLOW_EXECUTABLE_ARG. Leave print confirmation on: do not set
|
|
66
|
+
PRINT_REQUIRE_CONFIRMATION=0 or BAMBU_REQUIRE_CONFIRMATION=0 unless I ask
|
|
67
|
+
for a headless setup.
|
|
68
|
+
|
|
69
|
+
Verify that the MCP initializes, lists its tools, and reads printer status.
|
|
70
|
+
Do not start a print or change printer settings, including temperatures, as
|
|
71
|
+
a setup test. Tell me what worked and whether I need to restart or reload
|
|
72
|
+
the harness.
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
[Setup reference](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SETUP.md) · [Printer backends](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SETUP.md#choose-your-printer-backend) · [Slicing guide](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SLICING.md) · [Blender MCP](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SETUP.md#blender-mcp-optional)
|
|
76
|
+
|
|
77
|
+
## What to ask your agent
|
|
78
|
+
|
|
79
|
+
Ask for the result you want, not the steps. Current models plan across tools: they search the web, read photos, look up exact dimensions, edit models, slice, and print. Expect a question or two when a choice matters, such as which printer or filament to use, or whether to start the print.
|
|
80
|
+
|
|
81
|
+
This server provides the printer, slicing, and mesh tools. Web search, photos, and Blender edits come from your agent and its other connections, such as a [Blender MCP server](#blender-mcp). What your agent can read back depends on the printer system; see [printer backends](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SETUP.md#choose-your-printer-backend).
|
|
82
|
+
|
|
83
|
+
### Start from anything
|
|
84
|
+
|
|
85
|
+
- **"Here's a phone case on MakerWorld. Make it fit my iPhone 17 Pro Max and print it."**\
|
|
86
|
+
Your agent reads Apple's dimensional drawings, refits the case in Blender around the new camera and buttons, checks the fit, exports a verified STL, slices it for your printer, and asks before it starts the print. [See it worked through](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/BLENDER.md#worked-example-refit-a-phone-case-for-a-new-phone).
|
|
87
|
+
- **"Can you print a replacement?"** *(with a photo of a snapped cabinet clip)*\
|
|
88
|
+
It asks for a measurement or two where the fit matters, models the part, and prints it on the printer you choose.
|
|
89
|
+
- **"Make this bracket 20% bigger and give it a thicker base."**\
|
|
90
|
+
It scales the STL, extends the base, and reports the new dimensions before it slices anything.
|
|
91
|
+
|
|
92
|
+
### Check on any printer
|
|
93
|
+
|
|
94
|
+
- **"How far along is the Bambu print?"**\
|
|
95
|
+
It requests a fresh status report and gives you progress, the current layer, and time remaining.
|
|
96
|
+
- **"Is the Prusa done yet?"**\
|
|
97
|
+
It reads the printer's status through PrusaLink and reports its state and job progress.
|
|
98
|
+
- **"What are the bed and nozzle temperatures on the OctoPrint printer?"**\
|
|
99
|
+
It reads OctoPrint's printer state, including current and target temperatures.
|
|
100
|
+
- **"The first layer isn't sticking. Cancel it."**\
|
|
101
|
+
It sends the cancel command through that printer's backend, then checks the printer's status.
|
|
102
|
+
|
|
103
|
+
### Slice and print
|
|
104
|
+
|
|
105
|
+
- **"Print this in PETG."** *(with an STL)*\
|
|
106
|
+
It slices with the PETG filament profile you've set up and checks the job's peak temperatures. The server then asks you to confirm before the print starts.
|
|
107
|
+
- **"Print the bracket I sliced last night on the Bambu."**\
|
|
108
|
+
It checks the plate's model, nozzle, bed type, materials, and temperatures against the live printer, then asks you to confirm before it uploads and starts the job.
|
|
109
|
+
- **"Send benchy.gcode to the Klipper printer, but don't start it yet."**\
|
|
110
|
+
It uploads the file through Moonraker so you can start it later.
|
|
21
111
|
|
|
22
112
|
<details>
|
|
23
|
-
<summary><strong
|
|
113
|
+
<summary><strong>Start here</strong></summary>
|
|
114
|
+
|
|
115
|
+
## Start here
|
|
24
116
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
117
|
+
| I want to… | Read next |
|
|
118
|
+
|---|---|
|
|
119
|
+
| Connect this MCP to my agent | [Copy the setup request](#set-up-with-your-agent) |
|
|
120
|
+
| See what my agent can do with it | [What to ask your agent](#what-to-ask-your-agent) |
|
|
121
|
+
| Find the credentials for my printer | [Printer backend setup](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SETUP.md#printer-backend-setup) |
|
|
122
|
+
| Configure it by hand, with Docker, or over HTTP | [Installation and configuration reference](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SETUP.md) |
|
|
123
|
+
| Slice from my agent or troubleshoot slicing | [Slicing guide](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SLICING.md) |
|
|
124
|
+
| Use open-source slicing for a Bambu Lab printer | [FULU guide](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/FULU.md) |
|
|
125
|
+
| Model or refit a part in Blender | [Blender guide](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/BLENDER.md) and [Blender tools](#blender-mcp) |
|
|
126
|
+
| See release changes or contributor credit | [Changelog](./CHANGELOG.md), [releases](https://github.com/DMontgomery40/mcp-3D-printer-server/releases), and [contributors](./CONTRIBUTORS.md) |
|
|
31
127
|
|
|
32
128
|
</details>
|
|
33
129
|
|
|
34
130
|
<details>
|
|
35
|
-
<summary><strong
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
- **Implement `.3mf` Print Overrides:** Add logic to the `print_3mf` tool to handle user-provided overrides (e.g., calibration flags) and potentially common slicer settings if feasible via MQTT/G-code.
|
|
41
|
-
- **Calculate MD5 Hash:** Add logic to calculate and include the MD5 hash of the `.3mf` file in the MQTT print command (optional but recommended by protocol).
|
|
42
|
-
- **Refactor Bambu File Ops:** Investigate replacing `bambu-js` FTP operations (`getFiles`, `uploadFile`) with direct MQTT methods if possible/stable, or contribute FTPS support to `bambu-js`.
|
|
43
|
-
- **Add Preset Discovery Logic:** Improve preset resource listing (currently lists based on potential filenames, could parse index files if they exist).
|
|
44
|
-
- **Expand `.3mf` Support:** Add `.3mf` printing support for other printer types where applicable.
|
|
45
|
-
- **Error Handling & Reporting:** Enhance MQTT error handling and reporting of print progress/completion.
|
|
46
|
-
- **Testing:** Conduct thorough runtime testing of all new Bambu features.
|
|
131
|
+
<summary><strong>What's new</strong></summary>
|
|
132
|
+
|
|
133
|
+
## What's new
|
|
134
|
+
|
|
135
|
+
See the [changelog](./CHANGELOG.md) for versioned changes. The next release brings the print safety gate to every printer backend: a human confirms every print start and positive heating command, and the server checks the exact G-code against hardware and material ceilings. It also adds Bambu-compatible CLI slicing with resolved machine presets and a template registry, `blender_mcp_export_stl` for verified STL export from Blender, and this documentation site. Release 1.2.9 fixes Bambu FTPS uploads that failed with "Premature close" ([#22](https://github.com/DMontgomery40/mcp-3D-printer-server/issues/22)), adds standard Blender MCP discovery, forwarding, and verified STL edits, requires the Bambu printer model for raw print starts, and isolates each server's scratch files. Separately, [#20](https://github.com/DMontgomery40/mcp-3D-printer-server/pull/20) and [#21](https://github.com/DMontgomery40/mcp-3D-printer-server/pull/21) made per-call executable selectors, such as a slicer path or bridge command, require an explicit opt-in.
|
|
47
136
|
|
|
48
137
|
</details>
|
|
49
138
|
|
|
50
139
|
<details>
|
|
51
|
-
<summary>
|
|
140
|
+
<summary><strong>Table of Contents</strong></summary>
|
|
52
141
|
|
|
53
142
|
## Table of Contents
|
|
54
143
|
|
|
144
|
+
- [Set up with your agent](#set-up-with-your-agent)
|
|
145
|
+
- [What to ask your agent](#what-to-ask-your-agent)
|
|
146
|
+
- [Start here](#start-here)
|
|
147
|
+
- [What's new](#whats-new)
|
|
55
148
|
- [Description](#description)
|
|
149
|
+
- [FULU and open-source printing](#fulu-and-open-source-printing)
|
|
56
150
|
- [Features](#features)
|
|
57
|
-
- [Installation](#installation)
|
|
58
|
-
- [Prerequisites](#prerequisites)
|
|
59
|
-
- [Install from npm](#install-from-npm)
|
|
60
|
-
- [Install from source](#install-from-source)
|
|
61
|
-
- [Running with Docker](#running-with-docker)
|
|
62
|
-
- [Using Slicers with Docker](#using-slicers-with-docker)
|
|
63
|
-
- [Configuration](#configuration)
|
|
64
|
-
- [Usage](#usage)
|
|
65
|
-
- [Supported Printer Management Systems](#supported-printer-management-systems)
|
|
66
|
-
- [OctoPrint](#octoprint)
|
|
67
|
-
- [Klipper (via Moonraker)](#klipper-via-moonraker)
|
|
68
|
-
- [Duet](#duet)
|
|
69
|
-
- [Repetier](#repetier)
|
|
70
|
-
- [Bambu Labs](#bambu-labs)
|
|
71
|
-
- [Finding Your Bambu Printer's Serial Number and Access Token](#finding-your-bambu-printers-serial-number-and-access-token)
|
|
72
|
-
- [Bambu Communication Notes (MQTT & FTP)](#bambu-communication-notes-mqtt--ftp)
|
|
73
|
-
- [Prusa Connect](#prusa-connect)
|
|
74
|
-
- [Setting up Prusa Connect](#setting-up-prusa-connect)
|
|
75
|
-
- [Creality Cloud](#creality-cloud)
|
|
76
|
-
- [Setting up Creality Cloud](#setting-up-creality-cloud)
|
|
77
151
|
- [Available Tools](#available-tools)
|
|
78
152
|
- [STL Manipulation Tools](#stl-manipulation-tools)
|
|
79
153
|
- [Printer Control Tools](#printer-control-tools)
|
|
80
154
|
- [Bambu-Specific Tools](#bambu-specific-tools)
|
|
155
|
+
- [Slicing Tools](#slicing-tools)
|
|
156
|
+
- [Advanced Tools](#advanced-tools)
|
|
81
157
|
- [Available Resources](#available-resources)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
- [
|
|
85
|
-
- [Bambu Lab Printer Limitations](#bambu-lab-printer-limitations)
|
|
86
|
-
- [Limitations and Considerations](#limitations-and-considerations)
|
|
87
|
-
- [Memory Usage](#memory-usage)
|
|
88
|
-
- [STL Manipulation Limitations](#stl-manipulation-limitations)
|
|
89
|
-
- [Visualization Limitations](#visualization-limitations)
|
|
90
|
-
- [Performance Considerations](#performance-considerations)
|
|
91
|
-
- [Testing Recommendations](#testing-recommendations)
|
|
92
|
-
- [Appendix: MCP Safety Notes](#appendix-mcp-safety-notes)
|
|
93
|
-
- [Badges](#badges)
|
|
158
|
+
- [Printer Limitations](#printer-limitations)
|
|
159
|
+
- [General Limitations and Considerations](#general-limitations-and-considerations)
|
|
160
|
+
- [MCP Safety Notes](#mcp-safety-notes)
|
|
94
161
|
- [License](#license)
|
|
162
|
+
- [Acknowledgements](#acknowledgements)
|
|
95
163
|
|
|
96
164
|
</details>
|
|
97
165
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
This is a server that allows MCP users to connect with the API endpoints of these 3D Printers:
|
|
101
|
-
|
|
102
|
-
- OctoPrint
|
|
103
|
-
- Klipper (Moonraker)
|
|
104
|
-
- Duet
|
|
105
|
-
- Repetier
|
|
106
|
-
- Bambu Labs
|
|
107
|
-
- Prusa Connect
|
|
108
|
-
- Creality/Ender
|
|
109
|
-
|
|
110
|
-
This server is a Model Context Protocol (MCP) server for connecting Claude with 3D printer management systems. It allows MCP to interact with 3D printers through the APIs of various printer management systems such as OctoPrint, Klipper (via Moonraker), Duet, Repetier, and Bambu Labs printers.
|
|
111
|
-
|
|
112
|
-
**Note on Resource Usage**: This MCP server includes advanced 3D model manipulation features that can be memory-intensive when working with large STL files. Please see the "Limitations and Considerations" section for important information about memory usage and performance.
|
|
113
|
-
|
|
114
|
-
## Features
|
|
115
|
-
|
|
116
|
-
- Get printer status (temperatures, print progress, etc.)
|
|
117
|
-
- List files on the printer
|
|
118
|
-
- Upload G-code files to the printer
|
|
119
|
-
- Start, cancel, and monitor print jobs
|
|
120
|
-
- Set printer temperatures
|
|
121
|
-
- Advanced STL file manipulation:
|
|
122
|
-
- Extend base for better adhesion
|
|
123
|
-
- Scale models uniformly or along specific axes
|
|
124
|
-
- Rotate models around any axis
|
|
125
|
-
- Translate (move) models
|
|
126
|
-
- Modify specific sections of STL files (top, bottom, center, or custom)
|
|
127
|
-
- Comprehensive STL analysis with detailed model information
|
|
128
|
-
- Generate multi-angle SVG visualizations of STL files
|
|
129
|
-
- Real-time progress reporting for long operations
|
|
130
|
-
- Error handling with detailed diagnostics
|
|
131
|
-
- Slice STL files to generate G-code
|
|
132
|
-
- Confirm temperature settings in G-code files
|
|
133
|
-
- Complete end-to-end workflow from STL modification to printing
|
|
134
|
-
- Print `.3mf` files directly on Bambu Lab printers (via MQTT command)
|
|
135
|
-
- Slice Bambu projects with FULU OrcaSlicer-bambulab (`SLICER_TYPE=orcaslicer-bambulab`) and auto-slice unsliced 3MF files before Bambu printing when a project slicer is configured
|
|
136
|
-
- Inspect and probe the FULU BambuNetwork runtime (`check_fulu_orca_setup`) and call safe-by-default FULU bridge RPC methods for diagnostics and development (`fulu_bambu_network_rpc`)
|
|
137
|
-
- Read Bambu Studio preset files (printer, filament, process) as resources
|
|
138
|
-
|
|
139
|
-
## Installation
|
|
140
|
-
|
|
141
|
-
### Prerequisites
|
|
142
|
-
|
|
143
|
-
- Node.js 18 or higher
|
|
144
|
-
- npm or yarn
|
|
145
|
-
|
|
146
|
-
### Install from npm
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
npm install -g mcp-3d-printer-server
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Install from source
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
git clone https://github.com/dmontgomery40/mcp-3d-printer-server.git
|
|
156
|
-
cd mcp-3d-printer-server
|
|
157
|
-
npm install
|
|
158
|
-
npm link # Makes the command available globally
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### Running with Docker
|
|
162
|
-
|
|
163
|
-
You can also run the server using Docker and Docker Compose for a containerized environment.
|
|
164
|
-
|
|
165
|
-
1. Ensure you have Docker and Docker Compose installed.
|
|
166
|
-
2. Copy `.env.example` to `.env` and configure your settings.
|
|
167
|
-
3. Build and run the container:
|
|
168
|
-
```bash
|
|
169
|
-
docker-compose up --build -d
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
#### Using Slicers with Docker
|
|
173
|
-
|
|
174
|
-
Please note that the default Docker setup **cannot directly use a slicer installed on your host machine**. Mounting the slicer executable directly from the host into the container is unreliable due to operating system and library differences between your host and the container.
|
|
175
|
-
|
|
176
|
-
The recommended approach is to **install your preferred slicer *inside* the Docker image**. This makes the container self-sufficient.
|
|
177
|
-
|
|
178
|
-
To do this, you will need to modify the `Dockerfile`. Here's a conceptual example of how you might add PrusaSlicer, OrcaSlicer, or the FULU OrcaSlicer-bambulab build (specific commands may vary depending on the slicer, its dependencies, and current Alpine packages):
|
|
179
|
-
|
|
180
|
-
```dockerfile
|
|
181
|
-
# ... other Dockerfile commands ...
|
|
182
|
-
|
|
183
|
-
# Example: Install PrusaSlicer, OrcaSlicer, or FULU OrcaSlicer-bambulab (adjust command as needed)
|
|
184
|
-
# Check Alpine package repositories first (e.g., apk add prusaslicer or apk add orcaslicer)
|
|
185
|
-
# If not available, download and install manually (e.g., AppImage):
|
|
186
|
-
# RUN apk add --no-cache fuse # FUSE might be needed for AppImages
|
|
187
|
-
# RUN wget https://example.com/path/to/OrcaSlicer_Linux_Vxxxx.AppImage -O /usr/local/bin/orcaslicer && \
|
|
188
|
-
# chmod +x /usr/local/bin/orcaslicer
|
|
189
|
-
|
|
190
|
-
# Set the SLICER_PATH env var accordingly in docker-compose.yml or when running
|
|
191
|
-
# Example for installed executable:
|
|
192
|
-
ENV SLICER_PATH=/usr/local/bin/orcaslicer
|
|
193
|
-
|
|
194
|
-
# ... rest of Dockerfile ...
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
After modifying the `Dockerfile`, rebuild your image (`docker-compose build`). You'll also need to ensure the `SLICER_PATH` environment variable in your `.env` file or `docker-compose.yml` points to the correct path *inside the container* (e.g., `/usr/local/bin/orcaslicer`). For the FULU Bambu-enabled fork, set `SLICER_TYPE=orcaslicer-bambulab`.
|
|
198
|
-
|
|
199
|
-
Apologies for not including a specific slicer out-of-the-box, but given the wide variety of slicers (PrusaSlicer, OrcaSlicer, Cura, etc.) and configurations available, pre-installing one would unnecessarily bloat the image for many users. If a particular slicer becomes a very common request, I can certainly look into adding official support for it in a future version.
|
|
200
|
-
|
|
201
|
-
## Configuration
|
|
202
|
-
|
|
203
|
-
Create a `.env` file in the directory where you'll run the server or set environment variables:
|
|
204
|
-
|
|
205
|
-
```env
|
|
206
|
-
# Required for authentication with your printer management system
|
|
207
|
-
API_KEY=your_api_key_here
|
|
208
|
-
|
|
209
|
-
# Default printer connection settings
|
|
210
|
-
PRINTER_HOST=localhost
|
|
211
|
-
PRINTER_PORT=80 # Port for non-Bambu HTTP APIs
|
|
212
|
-
PRINTER_TYPE=octoprint # Options: octoprint, klipper, duet, repetier, bambu, prusa, creality
|
|
213
|
-
|
|
214
|
-
# Optional: Directory for temporary files
|
|
215
|
-
TEMP_DIR=/path/to/temp/dir
|
|
216
|
-
|
|
217
|
-
# Bambu Labs specific configuration
|
|
218
|
-
BAMBU_SERIAL=your_printer_serial # REQUIRED for Bambu
|
|
219
|
-
BAMBU_TOKEN=your_access_token # REQUIRED for Bambu
|
|
220
|
-
BAMBU_MODEL=p1s # REQUIRED for Bambu: p1s, p1p, x1c, x1e, a1, a1mini, h2d
|
|
221
|
-
BED_TYPE=textured_plate # Bed plate: textured_plate, cool_plate, engineering_plate, hot_plate
|
|
222
|
-
NOZZLE_DIAMETER=0.4 # Nozzle diameter in mm (default: 0.4)
|
|
223
|
-
|
|
224
|
-
# Slicer configuration (for slice_stl tool)
|
|
225
|
-
# For Bambu projects, the default is orcaslicer-bambulab unless SLICER_TYPE is set.
|
|
226
|
-
SLICER_TYPE=orcaslicer-bambulab # Options: prusaslicer, cura, slic3r, orcaslicer, orcaslicer-bambulab, bambustudio
|
|
227
|
-
SLICER_PATH=/path/to/slicer/executable
|
|
228
|
-
SLICER_PROFILE=/path/to/slicer/profile
|
|
229
|
-
|
|
230
|
-
# Optional aliases for FULU OrcaSlicer-bambulab when SLICER_PATH is not set
|
|
231
|
-
FULU_ORCA_PATH=/path/to/FULU/OrcaSlicer
|
|
232
|
-
ORCASLICER_BAMBULAB_PATH=/path/to/FULU/OrcaSlicer
|
|
233
|
-
FULU_ORCA_PLUGIN_DIR=/path/to/FULU/OrcaSlicer.app/Contents/MacOS
|
|
234
|
-
ORCASLICER_BAMBULAB_PLUGIN_DIR=/path/to/FULU/OrcaSlicer.app/Contents/MacOS
|
|
235
|
-
|
|
236
|
-
# Optional FULU BambuNetwork bridge runtime
|
|
237
|
-
# macOS default runtime dir:
|
|
238
|
-
# /Users/you/Library/Application Support/OrcaSlicer/macos-bridge/runtime
|
|
239
|
-
PJARCZAK_MAC_RUNTIME_DIR=
|
|
240
|
-
FULU_BAMBU_BRIDGE_COMMAND=
|
|
241
|
-
|
|
242
|
-
# Optional: Path to Bambu Studio user config dir (for loading presets)
|
|
243
|
-
# Example macOS: /Users/your_user/Library/Application Support/BambuStudio/user/YOUR_USER_ID
|
|
244
|
-
# Example Windows: C:\Users\your_user\AppData\Roaming\BambuStudio\user\YOUR_USER_ID
|
|
245
|
-
# Example Linux: /home/your_user/.config/BambuStudio/user/YOUR_USER_ID
|
|
246
|
-
BAMBU_STUDIO_CONFIG_PATH=
|
|
247
|
-
|
|
248
|
-
# MCP transport configuration
|
|
249
|
-
MCP_TRANSPORT=stdio # Options: stdio, streamable-http
|
|
250
|
-
MCP_HTTP_HOST=127.0.0.1
|
|
251
|
-
MCP_HTTP_PORT=3000
|
|
252
|
-
MCP_HTTP_PATH=/mcp
|
|
253
|
-
MCP_HTTP_STATEFUL=true
|
|
254
|
-
MCP_HTTP_JSON_RESPONSE=true
|
|
255
|
-
MCP_HTTP_ALLOWED_ORIGINS=http://localhost
|
|
256
|
-
|
|
257
|
-
# Optional bridge command for blender_mcp_edit_model execute=true mode
|
|
258
|
-
BLENDER_MCP_BRIDGE_COMMAND=
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
## Usage
|
|
262
|
-
|
|
263
|
-
Add this server to your MCP client's config (Claude Desktop, Claude Code, Cursor, Codex, or any MCP-compatible client). Most JSON-based clients use an `mcpServers` entry with the command and env vars:
|
|
264
|
-
|
|
265
|
-
```json
|
|
266
|
-
{
|
|
267
|
-
"mcpServers": {
|
|
268
|
-
"3dprint": {
|
|
269
|
-
"command": "npx",
|
|
270
|
-
"args": ["-y", "mcp-3d-printer-server"],
|
|
271
|
-
"env": {
|
|
272
|
-
"PRINTER_HOST": "your_printer_ip",
|
|
273
|
-
"PRINTER_TYPE": "bambu",
|
|
274
|
-
"BAMBU_SERIAL": "your_printer_serial",
|
|
275
|
-
"BAMBU_TOKEN": "your_access_token",
|
|
276
|
-
"BAMBU_MODEL": "p1s",
|
|
277
|
-
"SLICER_TYPE": "orcaslicer-bambulab",
|
|
278
|
-
"SLICER_PATH": "/path/to/FULU/OrcaSlicer",
|
|
279
|
-
"FULU_ORCA_PLUGIN_DIR": "/Applications/OrcaSlicer.app/Contents/MacOS"
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
For non-Bambu printers, replace the Bambu-specific env vars with `API_KEY` and the appropriate `PRINTER_TYPE` (see [Supported Printer Management Systems](#supported-printer-management-systems)).
|
|
287
|
-
|
|
288
|
-
### FULU OrcaSlicer-bambulab
|
|
289
|
-
|
|
290
|
-
Use [`FULU-Foundation/OrcaSlicer-bambulab`](https://github.com/FULU-Foundation/OrcaSlicer-bambulab) as the first-class Bambu project slicer by setting:
|
|
291
|
-
|
|
292
|
-
```env
|
|
293
|
-
PRINTER_TYPE=bambu
|
|
294
|
-
SLICER_TYPE=orcaslicer-bambulab
|
|
295
|
-
SLICER_PATH=/path/to/FULU/OrcaSlicer
|
|
296
|
-
FULU_ORCA_PLUGIN_DIR=/path/to/FULU/runtime/payload
|
|
297
|
-
BAMBU_MODEL=p1s
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
Accepted aliases include `fulu_orca`, `fulu-orca`, `orca-studio`, and `orca_bambulab`. For Bambu printers, this is the default slicer family when `SLICER_TYPE` is not set.
|
|
301
|
-
|
|
302
|
-
What the integration does:
|
|
303
|
-
|
|
304
|
-
- `slice_stl` uses the FULU/Orca project CLI shape (`--slice 0 --export-3mf`) to produce a sliced Bambu-compatible 3MF.
|
|
305
|
-
- `print_3mf` can auto-slice an unsliced 3MF through FULU OrcaSlicer-bambulab, then upload and start the sliced project through this server's Bambu print path.
|
|
306
|
-
- `check_fulu_orca_setup` verifies the FULU executable, platform runtime payload, setup commands, and optional BambuNetwork bridge handshake.
|
|
307
|
-
- `fulu_bambu_network_rpc` can call the FULU bridge protocol for diagnostics and development. Read-only methods are allowed by default; mutating methods require `allow_mutating_method=true`; FULU print methods still require `bambu_model`.
|
|
308
|
-
|
|
309
|
-
What stays deliberately explicit:
|
|
310
|
-
|
|
311
|
-
- This MCP server's existing Bambu print path is local MQTT plus FTPS and still needs `BAMBU_SERIAL`, `BAMBU_TOKEN`, and `PRINTER_HOST`.
|
|
312
|
-
- FULU's BambuNetwork bridge is a separate runtime. The MCP can inspect it, probe it, and issue guarded bridge RPC calls, but it will not silently switch a print from local LAN control to cloud/BambuNetwork control.
|
|
313
|
-
- `BAMBU_MODEL` remains mandatory for Bambu print operations because wrong machine presets can produce dangerous G-code.
|
|
314
|
-
|
|
315
|
-
#### Current Bench Test Status
|
|
316
|
-
|
|
317
|
-
This integration has been tested against the current FULU macOS release artifacts and a local Benchy smoke test. The MCP-side bug found during that bench was real: Bambu-family project slicers must use Orca/Bambu preset JSON with `--load-settings`, not the invalid `--load-machine` flag. That is fixed here.
|
|
318
|
-
|
|
319
|
-
The old Bambu Studio fallback still works. Set:
|
|
320
|
-
|
|
321
|
-
```env
|
|
322
|
-
SLICER_TYPE=bambustudio
|
|
323
|
-
SLICER_PATH=/Applications/BambuStudio.app/Contents/MacOS/BambuStudio
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
With that fallback, the same Benchy 3MF sliced successfully through Bambu Studio's CLI into a Bambu-compatible project 3MF. This is the known-good path while FULU platform packaging settles.
|
|
327
|
-
|
|
328
|
-
macOS is not proven green yet. On this Mac, the FULU arm64 and x86_64 macOS release bundles hit the same CLI slice problem during Benchy testing: one path crashed with `SIGSEGV` inside OrcaSlicer CLI processing, and repeated attempts left uninterruptible macOS `UE` processes that ignored `SIGKILL`. The MCP now avoids pretending that is solved. `check_fulu_orca_setup` can inspect the bundle and bridge payload, but macOS users should treat FULU CLI slicing as active feedback territory until FULU ships a stable macOS CLI/runtime combination.
|
|
329
|
-
|
|
330
|
-
We need Windows testers. The WSL 2 setup path, payload checks, and bridge command shape are represented in this MCP, but the full Windows path still needs real reports from people who can validate `install_runtime.ps1`, `verify_runtime.ps1`, bridge probing, CLI slicing, and a known-safe print workflow on their own machine.
|
|
331
|
-
|
|
332
|
-
We will keep iterating with user and contributor feedback. Please report the OS, CPU architecture, FULU release asset name, `check_fulu_orca_setup` result, slicer command stderr, and whether the Bambu Studio fallback works on the same model.
|
|
333
|
-
|
|
334
|
-
#### FULU Runtime Setup By Platform
|
|
335
|
-
|
|
336
|
-
The FULU README currently says macOS is work in progress, but the source tree already ships macOS Lima runtime scripts and Windows WSL runtime scripts. This MCP knows those file layouts and returns the exact commands through `check_fulu_orca_setup`.
|
|
337
|
-
|
|
338
|
-
Windows:
|
|
339
|
-
|
|
340
|
-
```bat
|
|
341
|
-
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
|
|
342
|
-
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
Restart Windows, then run the FULU package scripts from the directory that contains `install_runtime.ps1`:
|
|
346
|
-
|
|
347
|
-
```powershell
|
|
348
|
-
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\install_runtime.ps1 -PackageDir . -PluginDir .
|
|
349
|
-
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\verify_runtime.ps1 -PackageDir . -PluginDir .
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
Linux:
|
|
353
|
-
|
|
354
|
-
Install the FULU OrcaSlicer-bambulab build normally, set `SLICER_TYPE=orcaslicer-bambulab`, and point `SLICER_PATH` at the executable. If you want bridge-level diagnostics, set `FULU_BAMBU_BRIDGE_COMMAND` to the packaged `pjarczak_bambu_linux_host`.
|
|
355
|
-
|
|
356
|
-
macOS:
|
|
357
|
-
|
|
358
|
-
Set the app payload directory, then run the scripts that FULU copies into the app bundle:
|
|
359
|
-
|
|
360
|
-
```bash
|
|
361
|
-
export FULU_ORCA_PLUGIN_DIR="/Applications/OrcaSlicer.app/Contents/MacOS"
|
|
362
|
-
bash "$FULU_ORCA_PLUGIN_DIR/install_runtime_macos.sh" -PackageDir "$FULU_ORCA_PLUGIN_DIR" -PluginDir "$FULU_ORCA_PLUGIN_DIR"
|
|
363
|
-
bash "$FULU_ORCA_PLUGIN_DIR/verify_runtime_macos.sh" -PackageDir "$FULU_ORCA_PLUGIN_DIR" -PluginDir "$FULU_ORCA_PLUGIN_DIR"
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
The default installed runtime is:
|
|
367
|
-
|
|
368
|
-
```text
|
|
369
|
-
~/Library/Application Support/OrcaSlicer/macos-bridge/runtime
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
The bridge command shape is:
|
|
373
|
-
|
|
374
|
-
```bash
|
|
375
|
-
"/Applications/OrcaSlicer.app/Contents/MacOS/pjarczak-bambu-linux-host-wrapper" "$HOME/Library/Application Support/OrcaSlicer/macos-bridge/runtime/pjarczak_bambu_linux_host"
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
If your app is named `Orca Studio.app` or lives somewhere else, pass its real `Contents/MacOS` path as `plugin_dir` or `FULU_ORCA_PLUGIN_DIR`.
|
|
379
|
-
|
|
380
|
-
#### Check The Setup Through MCP
|
|
381
|
-
|
|
382
|
-
Ask your MCP client to call `check_fulu_orca_setup`, or call it from an agent with arguments like:
|
|
383
|
-
|
|
384
|
-
```json
|
|
385
|
-
{
|
|
386
|
-
"platform": "darwin",
|
|
387
|
-
"slicer_path": "/Applications/OrcaSlicer.app/Contents/MacOS/OrcaSlicer",
|
|
388
|
-
"plugin_dir": "/Applications/OrcaSlicer.app/Contents/MacOS",
|
|
389
|
-
"run_bridge_probe": true,
|
|
390
|
-
"bridge_command": "\"/Applications/OrcaSlicer.app/Contents/MacOS/pjarczak-bambu-linux-host-wrapper\" \"$HOME/Library/Application Support/OrcaSlicer/macos-bridge/runtime/pjarczak_bambu_linux_host\""
|
|
391
|
-
}
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
The result reports missing payload files, install/verify commands, the MCP env values to use, and bridge handshake/capability/runtime info when probing is enabled.
|
|
395
|
-
|
|
396
|
-
#### FULU Bridge RPC
|
|
397
|
-
|
|
398
|
-
`fulu_bambu_network_rpc` speaks the FULU bridge frame protocol from the MCP side. The protocol is little-endian binary frames with JSON bodies, using methods such as `bridge.handshake`, `bridge.capabilities`, `bridge.runtime_info`, and `net.get_user_print_info`.
|
|
399
|
-
|
|
400
|
-
Safe diagnostic example:
|
|
401
|
-
|
|
402
|
-
```json
|
|
403
|
-
{
|
|
404
|
-
"method": "bridge.runtime_info",
|
|
405
|
-
"bridge_command": "\"/Applications/OrcaSlicer.app/Contents/MacOS/pjarczak-bambu-linux-host-wrapper\" \"$HOME/Library/Application Support/OrcaSlicer/macos-bridge/runtime/pjarczak_bambu_linux_host\""
|
|
406
|
-
}
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
Mutating methods are intentionally gated:
|
|
410
|
-
|
|
411
|
-
```json
|
|
412
|
-
{
|
|
413
|
-
"method": "net.start_print",
|
|
414
|
-
"allow_mutating_method": true,
|
|
415
|
-
"bambu_model": "p1s",
|
|
416
|
-
"payload": {
|
|
417
|
-
"client_job_id": 1,
|
|
418
|
-
"params": {
|
|
419
|
-
"dev_id": "YOUR_PRINTER_ID"
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
```
|
|
424
|
-
|
|
425
|
-
That second example is intentionally incomplete because real BambuNetwork print calls need the full FULU/Bambu print parameter payload. The important part is that the MCP exposes the bridge without pretending a cloud print can be safely inferred from a local filename.
|
|
426
|
-
|
|
427
|
-
Where this config lives depends on your client and OS:
|
|
428
|
-
|
|
429
|
-
| Client / scope | macOS / Linux location | Windows location |
|
|
430
|
-
|----------------|------------------------|------------------|
|
|
431
|
-
| Claude Desktop (macOS / Windows) | `~/Library/Application Support/Claude/claude_desktop_config.json` | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
432
|
-
| Claude Desktop (Linux) | Not officially supported for local MCP yet; Claude Desktop docs still list Linux support as coming soon. | N/A |
|
|
433
|
-
| Claude Code (project-shared MCP) | `.mcp.json` in the project root | `.mcp.json` in the project root |
|
|
434
|
-
| Claude Code (user/local MCP) | `~/.claude.json` | `%USERPROFILE%\.claude.json` |
|
|
435
|
-
| Claude Code settings (not MCP server definitions) | `~/.claude/settings.json` | `%USERPROFILE%\.claude\settings.json` |
|
|
436
|
-
| Cursor (project) | `.cursor/mcp.json` in the project root | `.cursor\mcp.json` in the project root |
|
|
437
|
-
| Cursor (global) | `~/.cursor/mcp.json` | `%USERPROFILE%\.cursor\mcp.json` |
|
|
438
|
-
| Codex (user; CLI, IDE extension, app) | `~/.codex/config.toml` | `%USERPROFILE%\.codex\config.toml` |
|
|
439
|
-
| Codex (project, trusted projects only) | `.codex/config.toml` in the project root | `.codex\config.toml` in the project root |
|
|
440
|
-
|
|
441
|
-
Codex uses TOML instead of the JSON shape above. You can manage MCP servers with `codex mcp`, or edit `config.toml` directly with a `[mcp_servers.<name>]` entry.
|
|
442
|
-
|
|
443
|
-
Restart your client after editing the config. For Codex, run `/mcp` or `codex mcp list` to confirm the server loaded.
|
|
444
|
-
|
|
445
|
-
### Recommended: use with codemode-mcp
|
|
446
|
-
|
|
447
|
-
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, codemode lets the agent write code against a two-tool interface (`search()` and `execute()`), loading only the tools it needs on demand.
|
|
448
|
-
|
|
449
|
-
Anthropic and Cloudflare independently demonstrated this pattern reduces MCP token costs by up to 98%:
|
|
450
|
-
|
|
451
|
-
- [Code execution with MCP](https://www.anthropic.com/engineering/code-execution-with-mcp) (Anthropic)
|
|
452
|
-
- [Code Mode: give agents an entire API in 1,000 tokens](https://blog.cloudflare.com/code-mode-mcp/) (Cloudflare)
|
|
453
|
-
|
|
454
|
-
This applies to all MCP servers, not just this one.
|
|
455
|
-
|
|
456
|
-
## Supported Printer Management Systems
|
|
457
|
-
|
|
458
|
-
### OctoPrint
|
|
459
|
-
|
|
460
|
-
OctoPrint is a popular web interface for 3D printers. It provides a REST API for controlling the printer.
|
|
461
|
-
|
|
462
|
-
- Default port: 80 (http) or 443 (https)
|
|
463
|
-
- Authentication: API key required
|
|
464
|
-
|
|
465
|
-
### Klipper (via Moonraker)
|
|
466
|
-
|
|
467
|
-
Klipper is a firmware for 3D printers that works with the Moonraker API server.
|
|
468
|
-
|
|
469
|
-
- Default port: 7125
|
|
470
|
-
- Authentication: Depends on your Moonraker configuration
|
|
471
|
-
|
|
472
|
-
### Duet
|
|
473
|
-
|
|
474
|
-
Duet is a control board for 3D printers with its own web interface (DuetWebControl).
|
|
475
|
-
|
|
476
|
-
- Default port: 80 (http) or 443 (https)
|
|
477
|
-
- Authentication: Depends on your Duet configuration
|
|
478
|
-
|
|
479
|
-
### Repetier
|
|
480
|
-
|
|
481
|
-
Repetier-Server is a host software for 3D printers.
|
|
482
|
-
|
|
483
|
-
- Default port: 3344
|
|
484
|
-
- Authentication: API key required
|
|
485
|
-
|
|
486
|
-
### Bambu Labs
|
|
487
|
-
|
|
488
|
-
Bambu Lab printers use MQTT for status and control and FTP for file operations.
|
|
489
|
-
|
|
490
|
-
- Authentication: Serial number and access token required (set `BAMBU_SERIAL` and `BAMBU_TOKEN`)
|
|
491
|
-
- Printer model: **Required** (set `BAMBU_MODEL`). Valid values: `p1s`, `p1p`, `x1c`, `x1e`, `a1`, `a1mini`, `h2d`. This ensures the slicer generates correct G-code for your specific printer.
|
|
492
|
-
- Requirements: Printer must be on the same network with Developer Mode and LAN Only Mode enabled
|
|
493
|
-
- Compatible with: X1C, X1E, P1S, P1P, A1, A1 Mini, H2D
|
|
494
|
-
|
|
495
|
-
#### Finding Your Bambu Printer's Serial Number and Access Token
|
|
166
|
+
<details>
|
|
167
|
+
<summary><strong>Description</strong></summary>
|
|
496
168
|
|
|
497
|
-
|
|
169
|
+
## Description
|
|
498
170
|
|
|
499
|
-
|
|
500
|
-
- Look on the back or bottom of your printer for a sticker with a serial number (typically starts with "01P" or "01A" followed by numbers/letters)
|
|
501
|
-
- Alternatively, open Bambu Studio, connect to your printer, go to Device > Device Management, and view your printer's information
|
|
171
|
+
`mcp-3d-printer-server` is a Model Context Protocol server for 3D printers. It gives an agent printer control (status, files, upload, start, cancel, and temperatures), STL mesh tools, slicer automation, Bambu Lab project printing, and an optional bridge to a Blender MCP server. One `PRINTER_TYPE` selects the default backend, and every printer tool accepts a per-call `type` and `host`, so one server can reach more than one printer.
|
|
502
172
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
173
|
+
| Backend | `PRINTER_TYPE` | Testing evidence |
|
|
174
|
+
|---|---|---|
|
|
175
|
+
| Bambu Lab | `bambu` | Most tested, including maintainer hardware testing shared with the Bambu-only fork |
|
|
176
|
+
| OctoPrint | `octoprint` | Community-reported |
|
|
177
|
+
| Klipper (Moonraker) | `klipper` | Community-reported, including a Creality K1 Max through Moonraker |
|
|
178
|
+
| PrusaLink and Prusa Connect | `prusa` | Community-reported |
|
|
179
|
+
| Duet | `duet` | Implemented; no hardware reports yet |
|
|
180
|
+
| Repetier-Server | `repetier` | Implemented; no hardware reports yet |
|
|
181
|
+
| Creality | `creality` | Implemented; no hardware reports yet |
|
|
508
182
|
|
|
509
|
-
|
|
183
|
+
What each backend reads and sends differs. See [printer backend setup](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SETUP.md#printer-backend-setup) for the exact API calls, credentials, and linked reports.
|
|
510
184
|
|
|
511
|
-
|
|
185
|
+
**Note on resource usage.** The STL tools load the entire mesh into memory. Large or complex files (over about 10 MB) can use a lot of memory. See [General Limitations and Considerations](#general-limitations-and-considerations).
|
|
512
186
|
|
|
513
|
-
|
|
514
|
-
- **FTP:** File listing and uploading currently rely on the FTP server running on the printer (via the `bambu-js` library helper). **Note:** This FTP connection might be **unsecured (plain FTP)** based on current library limitations. Use with awareness of your network security.
|
|
187
|
+
</details>
|
|
515
188
|
|
|
516
|
-
|
|
189
|
+
<details>
|
|
190
|
+
<summary><strong>FULU and open-source printing</strong></summary>
|
|
517
191
|
|
|
518
|
-
|
|
192
|
+
## FULU and open-source printing
|
|
519
193
|
|
|
520
|
-
-
|
|
521
|
-
- Authentication: API key required
|
|
522
|
-
- Compatible with: Prusa MK4, Prusa Mini, Prusa XL, and other Prusa printers with Prusa Connect
|
|
194
|
+
[FULU OrcaSlicer-bambulab](https://github.com/FULU-Foundation/OrcaSlicer-bambulab) is a first-class slicer target for Bambu Lab projects (`SLICER_TYPE=orcaslicer-bambulab`; aliases include `fulu-orca` and `orca-studio`), and the default slicer when `PRINTER_TYPE=bambu` and no slicer is configured. `slice_stl` and `print_3mf` auto-slicing use its project command line, and `check_fulu_orca_setup` inspects the install and runtime payload.
|
|
523
195
|
|
|
524
|
-
|
|
196
|
+
The optional FULU **BambuNetwork bridge** is a separate runtime. `fulu_bambu_network_rpc` can probe it and send guarded RPC calls, but the server never switches a print from its local MQTT and FTPS path to BambuNetwork or the cloud on its own.
|
|
525
197
|
|
|
526
|
-
|
|
198
|
+
**[Follow the FULU guide](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/FULU.md)** for platform runtime setup, bridge probes, and the current macOS and Windows testing status.
|
|
527
199
|
|
|
528
|
-
|
|
529
|
-
2. Connect your printer to your Wi-Fi network
|
|
530
|
-
3. Create a Prusa Connect account and register your printer
|
|
531
|
-
4. Generate an API key from the Prusa Connect web interface under Settings > API Access
|
|
200
|
+
</details>
|
|
532
201
|
|
|
533
|
-
|
|
202
|
+
<details>
|
|
203
|
+
<summary><strong>Features</strong></summary>
|
|
534
204
|
|
|
535
|
-
|
|
205
|
+
## Features
|
|
536
206
|
|
|
537
|
-
-
|
|
538
|
-
-
|
|
539
|
-
-
|
|
207
|
+
- Seven printer backends, selected with `PRINTER_TYPE`: OctoPrint, Klipper (Moonraker), Duet, Repetier-Server, Bambu Lab, PrusaLink or Prusa Connect, and Creality
|
|
208
|
+
- Per-call `type`, `host`, `port`, and `api_key` arguments for working with more than one printer
|
|
209
|
+
- Printer status, file listing, G-code upload from inline content or a local path, starting a stored file, cancelling a job, and setting bed or nozzle temperatures
|
|
210
|
+
- STL tools: inspect dimensions, scale, rotate, translate, extend the base, merge vertices, center, lay flat, transform one section of a model, and render multi-angle SVG previews
|
|
211
|
+
- A print and heating safety gate on every backend: the exact G-code is inspected, every heater target is checked against hardware and material ceilings, the printer's state is checked, and a human confirms through MCP elicitation. Heater-off and cancel are never gated
|
|
212
|
+
- Slicing through PrusaSlicer, Slic3r, OrcaSlicer, CuraEngine, FULU OrcaSlicer-bambulab, or Bambu Studio command lines, with G-code peak-temperature checks and a one-call process-and-print pipeline
|
|
213
|
+
- Bambu-compatible CLI slicing with the exact model and nozzle machine preset resolved from your slicer installation, filament slots and colours, placement options, and a local template registry
|
|
214
|
+
- Bambu Lab project printing: upload a sliced `.3mf` over FTPS and start it over MQTT with the plate's G-code path, MD5, AMS mapping, and calibration flags, after checking the plate against a fresh printer report; auto-slice unsliced projects with FULU OrcaSlicer-bambulab or Bambu Studio
|
|
215
|
+
- Required Bambu printer model for print operations, asked for through MCP elicitation when missing
|
|
216
|
+
- FULU OrcaSlicer-bambulab setup inspection and diagnostic BambuNetwork bridge RPC, with raw print methods refused
|
|
217
|
+
- Optional Blender MCP bridge: discover a standard Blender MCP server's tools, forward calls, export named scene objects to a verified STL, and run verified STL edits
|
|
218
|
+
- Slicer, bridge, and Blender executables come from server configuration unless you explicitly opt in to per-call selectors
|
|
219
|
+
- MCP resources for printer status, files, and file details
|
|
220
|
+
- Transports: stdio (default) and streamable HTTP, plus a Docker image
|
|
540
221
|
|
|
541
|
-
|
|
222
|
+
</details>
|
|
542
223
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
3. Enable local network access for your printer
|
|
546
|
-
4. Generate a token from the Creality Cloud app under Settings > Developer Options
|
|
224
|
+
<details>
|
|
225
|
+
<summary><strong>Available Tools</strong></summary>
|
|
547
226
|
|
|
548
227
|
## Available Tools
|
|
549
228
|
|
|
550
229
|
<details>
|
|
551
|
-
<summary>
|
|
230
|
+
<summary><strong>STL Manipulation Tools</strong></summary>
|
|
552
231
|
|
|
553
232
|
### STL Manipulation Tools
|
|
554
233
|
|
|
555
|
-
|
|
234
|
+
All STL tools load the full mesh into memory. Tools that change a model write a new file to the server's temporary directory, named after the input with a suffix such as `_scaled`, and return its path; the input file is not modified.
|
|
556
235
|
|
|
557
236
|
#### get_stl_info
|
|
558
237
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
```json
|
|
562
|
-
{
|
|
563
|
-
"stl_path": "/path/to/file.stl"
|
|
564
|
-
}
|
|
565
|
-
```
|
|
566
|
-
|
|
567
|
-
#### extend_stl_base
|
|
568
|
-
|
|
569
|
-
Extend the base of an STL file by a specified amount.
|
|
238
|
+
Inspect an STL file without modifying it. Returns the bounding box, dimensions, center, vertex count, and face count.
|
|
570
239
|
|
|
571
240
|
```json
|
|
572
241
|
{
|
|
573
|
-
"stl_path": "/path/to/
|
|
574
|
-
"extension_inches": 2
|
|
242
|
+
"stl_path": "/path/to/model.stl"
|
|
575
243
|
}
|
|
576
244
|
```
|
|
577
245
|
|
|
578
246
|
#### scale_stl
|
|
579
247
|
|
|
580
|
-
Scale
|
|
248
|
+
Scale a model uniformly with `scale_factor`, or per axis with `scale_x`, `scale_y`, and `scale_z`. When any axis value is given, unspecified axes stay at 1.0.
|
|
581
249
|
|
|
582
250
|
```json
|
|
583
251
|
{
|
|
584
|
-
"stl_path": "/path/to/
|
|
585
|
-
"scale_factor": 1.
|
|
252
|
+
"stl_path": "/path/to/model.stl",
|
|
253
|
+
"scale_factor": 1.2
|
|
586
254
|
}
|
|
587
255
|
```
|
|
588
256
|
|
|
589
|
-
Or for non-uniform scaling:
|
|
590
|
-
|
|
591
257
|
```json
|
|
592
258
|
{
|
|
593
|
-
"stl_path": "/path/to/
|
|
259
|
+
"stl_path": "/path/to/model.stl",
|
|
594
260
|
"scale_x": 1.2,
|
|
595
261
|
"scale_y": 1.0,
|
|
596
262
|
"scale_z": 1.5
|
|
@@ -599,12 +265,12 @@ Or for non-uniform scaling:
|
|
|
599
265
|
|
|
600
266
|
#### rotate_stl
|
|
601
267
|
|
|
602
|
-
Rotate
|
|
268
|
+
Rotate a model around the X, Y, and Z axes, in degrees. Omitted axes default to 0.
|
|
603
269
|
|
|
604
270
|
```json
|
|
605
271
|
{
|
|
606
|
-
"stl_path": "/path/to/
|
|
607
|
-
"rotate_x":
|
|
272
|
+
"stl_path": "/path/to/model.stl",
|
|
273
|
+
"rotate_x": 0,
|
|
608
274
|
"rotate_y": 0,
|
|
609
275
|
"rotate_z": 90
|
|
610
276
|
}
|
|
@@ -612,31 +278,42 @@ Rotate an STL model around specific axes (in degrees).
|
|
|
612
278
|
|
|
613
279
|
#### translate_stl
|
|
614
280
|
|
|
615
|
-
Move
|
|
281
|
+
Move a model along the X, Y, and Z axes, in millimeters. Omitted axes default to 0.
|
|
616
282
|
|
|
617
283
|
```json
|
|
618
284
|
{
|
|
619
|
-
"stl_path": "/path/to/
|
|
285
|
+
"stl_path": "/path/to/model.stl",
|
|
620
286
|
"translate_x": 10,
|
|
621
287
|
"translate_y": 5,
|
|
622
288
|
"translate_z": 0
|
|
623
289
|
}
|
|
624
290
|
```
|
|
625
291
|
|
|
292
|
+
#### extend_stl_base
|
|
293
|
+
|
|
294
|
+
Add solid geometry underneath the model to raise and widen its base. `extension_inches` is in **inches** and is converted to millimeters (25.4 mm per inch).
|
|
295
|
+
|
|
296
|
+
```json
|
|
297
|
+
{
|
|
298
|
+
"stl_path": "/path/to/model.stl",
|
|
299
|
+
"extension_inches": 0.25
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
626
303
|
#### merge_vertices
|
|
627
304
|
|
|
628
|
-
Merge vertices
|
|
305
|
+
Merge vertices closer together than `tolerance` (millimeters, default 0.01). This can close small gaps and slightly simplify the mesh.
|
|
629
306
|
|
|
630
307
|
```json
|
|
631
308
|
{
|
|
632
309
|
"stl_path": "/path/to/model.stl",
|
|
633
|
-
"tolerance": 0.01
|
|
310
|
+
"tolerance": 0.01
|
|
634
311
|
}
|
|
635
312
|
```
|
|
636
313
|
|
|
637
314
|
#### center_model
|
|
638
315
|
|
|
639
|
-
|
|
316
|
+
Move the model so the center of its bounding box is at the origin (0, 0, 0).
|
|
640
317
|
|
|
641
318
|
```json
|
|
642
319
|
{
|
|
@@ -646,7 +323,7 @@ Translate the model so the center of its bounding box is at the world origin (0,
|
|
|
646
323
|
|
|
647
324
|
#### lay_flat
|
|
648
325
|
|
|
649
|
-
|
|
326
|
+
Find the model's largest flat face and rotate the model so that face rests on the XY plane (Z = 0). Works best on models with a clearly dominant flat face.
|
|
650
327
|
|
|
651
328
|
```json
|
|
652
329
|
{
|
|
@@ -656,28 +333,28 @@ Attempt to identify the largest flat surface of the model (that isn't already fa
|
|
|
656
333
|
|
|
657
334
|
#### modify_stl_section
|
|
658
335
|
|
|
659
|
-
Apply a
|
|
336
|
+
Apply a scale, rotation, or translation to one section of a model: the `top`, `bottom`, or `center` third of its bounding box, or a `custom` box. `value_x`, `value_y`, and `value_z` are scale factors, degrees, or millimeters depending on `transformation_type`.
|
|
660
337
|
|
|
661
338
|
```json
|
|
662
339
|
{
|
|
663
|
-
"stl_path": "/path/to/
|
|
340
|
+
"stl_path": "/path/to/model.stl",
|
|
664
341
|
"section": "top",
|
|
665
342
|
"transformation_type": "scale",
|
|
666
343
|
"value_x": 1.5,
|
|
667
|
-
"value_y": 1.5,
|
|
344
|
+
"value_y": 1.5,
|
|
668
345
|
"value_z": 1.5
|
|
669
346
|
}
|
|
670
347
|
```
|
|
671
348
|
|
|
672
|
-
|
|
349
|
+
A `custom` section requires all six bounds:
|
|
673
350
|
|
|
674
351
|
```json
|
|
675
352
|
{
|
|
676
|
-
"stl_path": "/path/to/
|
|
353
|
+
"stl_path": "/path/to/model.stl",
|
|
677
354
|
"section": "custom",
|
|
678
355
|
"transformation_type": "rotate",
|
|
679
356
|
"value_x": 0,
|
|
680
|
-
"value_y": 0,
|
|
357
|
+
"value_y": 0,
|
|
681
358
|
"value_z": 45,
|
|
682
359
|
"custom_min_x": -10,
|
|
683
360
|
"custom_min_y": 0,
|
|
@@ -690,367 +367,480 @@ For custom section bounds:
|
|
|
690
367
|
|
|
691
368
|
#### generate_stl_visualization
|
|
692
369
|
|
|
693
|
-
|
|
370
|
+
Render an SVG with front, side, top, and isometric views of a model. `width` and `height` set each view's size in pixels (default 300).
|
|
694
371
|
|
|
695
372
|
```json
|
|
696
373
|
{
|
|
697
|
-
"stl_path": "/path/to/
|
|
374
|
+
"stl_path": "/path/to/model.stl",
|
|
698
375
|
"width": 400,
|
|
699
376
|
"height": 400
|
|
700
377
|
}
|
|
701
378
|
```
|
|
702
379
|
|
|
703
|
-
|
|
380
|
+
The SVG is a simplified schematic, not a photorealistic render.
|
|
381
|
+
|
|
382
|
+
</details>
|
|
383
|
+
|
|
384
|
+
<details>
|
|
385
|
+
<summary><strong>Printer Control Tools</strong></summary>
|
|
386
|
+
|
|
387
|
+
### Printer Control Tools
|
|
388
|
+
|
|
389
|
+
Every printer tool accepts `host`, `port`, `type`, and `api_key`, and Bambu printers also use `bambu_serial` and `bambu_token`. Omitted values fall back to `PRINTER_HOST`, `PRINTER_PORT`, `PRINTER_TYPE`, `API_KEY`, `BAMBU_SERIAL`, and `BAMBU_TOKEN`. Keep keys in the server configuration rather than passing them in calls.
|
|
390
|
+
|
|
391
|
+
What each call does depends on the backend; see [printer backend setup](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SETUP.md#printer-backend-setup) for the exact API routes.
|
|
392
|
+
|
|
393
|
+
Every print start and positive heating command, on every backend, goes through a [safety gate](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SETUP.md#print-and-heating-safety): the server inspects the exact G-code it will start, checks each heater target against hardware and material ceilings, checks that the printer is ready, and asks a human to confirm through MCP elicitation. Turning a heater off (`temperature: 0`) and `cancel_print` are never gated.
|
|
394
|
+
|
|
395
|
+
#### get_printer_status
|
|
704
396
|
|
|
705
|
-
|
|
397
|
+
Read the printer's current status. The response is the backend's own status data: Bambu returns temperatures, job state, progress, layers, time remaining, and AMS data; OctoPrint returns printer state and temperatures; Klipper returns the Moonraker host state only.
|
|
706
398
|
|
|
707
399
|
```json
|
|
708
400
|
{
|
|
709
|
-
"
|
|
710
|
-
"
|
|
711
|
-
"
|
|
712
|
-
"slicer_profile": "/path/to/machine.json;/path/to/process.json",
|
|
713
|
-
"filament_profile": "/path/to/flat-nylon-filament.json"
|
|
401
|
+
"type": "klipper",
|
|
402
|
+
"host": "192.168.1.50",
|
|
403
|
+
"port": "7125"
|
|
714
404
|
}
|
|
715
405
|
```
|
|
716
406
|
|
|
717
|
-
|
|
407
|
+
#### list_printer_files
|
|
718
408
|
|
|
719
|
-
|
|
409
|
+
List the files stored on the printer or its host software. On Bambu printers it lists the `cache/`, `timelapse/`, and `logs/` directories.
|
|
720
410
|
|
|
721
|
-
|
|
411
|
+
```json
|
|
412
|
+
{
|
|
413
|
+
"type": "octoprint",
|
|
414
|
+
"host": "192.168.1.100"
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
#### upload_gcode
|
|
419
|
+
|
|
420
|
+
Upload G-code to the printer, and optionally start it. Pass `gcode_path` for a local file, or `gcode` with the content (or a local path). `filename` defaults to the basename of `gcode_path`; when printing, use a plain filename so the started file is exactly the uploaded one.
|
|
722
421
|
|
|
723
422
|
```json
|
|
724
423
|
{
|
|
725
|
-
"
|
|
726
|
-
"
|
|
727
|
-
"
|
|
424
|
+
"type": "klipper",
|
|
425
|
+
"host": "192.168.1.50",
|
|
426
|
+
"port": "7125",
|
|
427
|
+
"gcode_path": "/path/to/benchy.gcode",
|
|
428
|
+
"print": true,
|
|
429
|
+
"material": "PETG"
|
|
728
430
|
}
|
|
729
431
|
```
|
|
730
432
|
|
|
731
|
-
|
|
433
|
+
- Without `print`, the file is only uploaded and nothing is inspected or started.
|
|
434
|
+
- With `print: true`, the exact uploaded bytes are inspected first (every `S` and `R` heater target, tool changes, and hardware and material ceilings), the printer's state is checked, and a human confirms before the job starts.
|
|
435
|
+
- Printing needs a declared material: slicer metadata in the file (`; filament_type = PLA`) or the `material` argument, which must not contradict the file.
|
|
436
|
+
- On Bambu printers, files go to `cache/` over FTPS, and printing also needs the model (`bambu_model` or `BAMBU_MODEL`). Automatic printing after upload supports `.gcode` only; print `.3mf` projects with `print_3mf`.
|
|
437
|
+
|
|
438
|
+
#### start_print
|
|
732
439
|
|
|
733
|
-
|
|
440
|
+
Start a G-code file that is already stored on the printer. The server downloads that exact file, inspects it, checks the printer's state, asks a human to confirm, and then starts a uniquely named checked copy. This works on Bambu Lab, OctoPrint, Klipper (Moonraker), and Duet. Repetier, Prusa, and Creality refuse, because their adapters have no verified download route; use `upload_gcode` with `print: true` instead.
|
|
734
441
|
|
|
735
442
|
```json
|
|
736
443
|
{
|
|
737
|
-
"stl_path": "/path/to/file.stl",
|
|
738
|
-
"extension_inches": 2,
|
|
739
|
-
"extruder_temp": 200,
|
|
740
|
-
"bed_temp": 60,
|
|
741
|
-
"host": "192.168.1.100",
|
|
742
444
|
"type": "octoprint",
|
|
743
|
-
"
|
|
445
|
+
"host": "192.168.1.100",
|
|
446
|
+
"filename": "benchy.gcode",
|
|
447
|
+
"material": "PLA"
|
|
744
448
|
}
|
|
745
449
|
```
|
|
746
450
|
|
|
747
|
-
|
|
451
|
+
Pass `material` when the file has no `filament_type` metadata. On Bambu printers it also needs the model and supports `.gcode` files only; bare filenames are looked up in `cache/`.
|
|
452
|
+
|
|
453
|
+
#### cancel_print
|
|
454
|
+
|
|
455
|
+
Cancel the current print job. Cancelling is never gated and also cancels checked prints still waiting to start. There is no pause or resume tool; cancelling is not resumable.
|
|
456
|
+
|
|
457
|
+
```json
|
|
458
|
+
{
|
|
459
|
+
"type": "prusa",
|
|
460
|
+
"host": "192.168.1.120"
|
|
461
|
+
}
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
#### set_printer_temperature
|
|
465
|
+
|
|
466
|
+
Set a target temperature for a printer component. Use `bed` or `extruder`; Bambu also accepts `nozzle`, `tool`, and `tool0`. OctoPrint nozzle targets are sent to `tool0`.
|
|
467
|
+
|
|
468
|
+
```json
|
|
469
|
+
{
|
|
470
|
+
"type": "klipper",
|
|
471
|
+
"host": "192.168.1.50",
|
|
472
|
+
"port": "7125",
|
|
473
|
+
"component": "extruder",
|
|
474
|
+
"temperature": 215,
|
|
475
|
+
"material": "PLA"
|
|
476
|
+
}
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
- `temperature` must be a finite number of 0 or more. `0` switches the heater off and is never gated.
|
|
480
|
+
- Positive targets are checked before connecting against independent hardware ceilings and the material's ceiling, need a ready printer, and ask a human to confirm.
|
|
481
|
+
- Positive nozzle heating needs `material` (for example PLA, PETG, or ABS), including for spools without RFID.
|
|
482
|
+
- On Bambu printers, positive heating also needs `bambu_model` (or `BAMBU_MODEL`), and nozzle heating uses `nozzle_diameter` (0.2, 0.4, 0.6, or 0.8; default `NOZZLE_DIAMETER` or 0.4). Both are checked against the live printer.
|
|
748
483
|
|
|
749
484
|
</details>
|
|
750
485
|
|
|
751
486
|
<details>
|
|
752
|
-
<summary>
|
|
487
|
+
<summary><strong>Bambu-Specific Tools</strong></summary>
|
|
753
488
|
|
|
754
|
-
###
|
|
489
|
+
### Bambu-Specific Tools
|
|
755
490
|
|
|
756
|
-
|
|
491
|
+
These tools work with `PRINTER_TYPE=bambu` (or `type: "bambu"`). Set up LAN Only Mode, the serial number, the access code, and the model as described in [Bambu Lab setup](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SETUP.md#bambu-lab).
|
|
757
492
|
|
|
758
|
-
|
|
493
|
+
#### print_3mf
|
|
494
|
+
|
|
495
|
+
Upload a sliced `.3mf` project to a Bambu printer over FTPS and start it with an MQTT `project_file` command that carries the plate's G-code path, its MD5, the AMS mapping, and the calibration flags. **`bambu_model` is required** (or `BAMBU_MODEL`); without it the server asks through MCP elicitation when the client supports it, or returns an error. The wrong model can crash the bed into the nozzle.
|
|
496
|
+
|
|
497
|
+
Before anything is uploaded, the server inspects a private copy of the selected plate (model, nozzle, bed type, materials, and every heater target). It checks them against per-model hardware limits, material ceilings, and a fresh MQTT report of the printer's model, serial, nozzle, state, errors, and loaded filament. A human then confirms, and the report is checked again before dispatch.
|
|
759
498
|
|
|
760
499
|
```json
|
|
761
500
|
{
|
|
762
|
-
"
|
|
763
|
-
"
|
|
764
|
-
"
|
|
501
|
+
"three_mf_path": "/path/to/bracket.gcode.3mf",
|
|
502
|
+
"bambu_model": "p1s",
|
|
503
|
+
"bed_type": "textured_plate",
|
|
504
|
+
"use_ams": true,
|
|
505
|
+
"ams_mapping": { "Generic PLA": 0 },
|
|
506
|
+
"bed_leveling": true,
|
|
507
|
+
"flow_calibration": true,
|
|
508
|
+
"vibration_calibration": true,
|
|
509
|
+
"layer_inspect": true,
|
|
510
|
+
"timelapse": false
|
|
765
511
|
}
|
|
766
512
|
```
|
|
767
513
|
|
|
768
|
-
|
|
514
|
+
- If the project has no plate G-code, the server tries to [auto-slice it](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SLICING.md#print_3mf-auto-slicing) with FULU OrcaSlicer-bambulab or Bambu Studio. If slicing fails, or the selected plate still has no G-code, it stops with an error and never uploads the original project.
|
|
515
|
+
- `ams_mapping` is an object whose values are AMS slot numbers. When it is omitted, the mapping embedded in the 3MF is used; with no mapping at all, the print runs without AMS. `use_ams: false` turns AMS off.
|
|
516
|
+
- After sending the command, the server watches fresh reports for up to 15 seconds (`BAMBU_DISPATCH_CHECK_MS`) and returns `dispatch: "started"` or `"unconfirmed"`. If the firmware refuses the command (HMS 0500-0500-0001-0007 on firmware 01.08.05 and later without Developer Mode), the call fails and says so; the checked file stays on the printer's storage.
|
|
517
|
+
- `nozzle_type` (`stainless_steel`, `hardened_steel`, `tungsten_carbide`, `brass`) sets the installed nozzle when the project must be auto-sliced. The job's nozzle type must match the printer's report.
|
|
518
|
+
- `bed_type` is one of `textured_plate`, `cool_plate`, `engineering_plate`, or `hot_plate` (default `BED_TYPE`, else `textured_plate`). It must match the plate's bed metadata, so a file sliced for another plate, or without bed metadata, is refused until `bed_type` matches.
|
|
519
|
+
- `nozzle_diameter` accepts 0.2, 0.4, 0.6, or 0.8 (default `NOZZLE_DIAMETER` or 0.4).
|
|
520
|
+
- Calibration flags default to on (timelapse to off) when omitted.
|
|
521
|
+
- `layer_height`, `nozzle_temperature`, `bed_temperature`, and `support_enabled` are accepted but not applied: those settings are baked into the sliced file. Change them in the slicer.
|
|
522
|
+
- A success response means the command was sent, not that the print started cleanly. Check the printer's status afterward.
|
|
769
523
|
|
|
770
|
-
####
|
|
524
|
+
#### check_fulu_orca_setup
|
|
771
525
|
|
|
772
|
-
|
|
526
|
+
Inspect a FULU OrcaSlicer-bambulab install: the executable, the platform runtime payload, the install and verify commands, and optionally a BambuNetwork bridge handshake. Paths default to the server environment; see [checking the setup](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/FULU.md#check-the-setup-through-mcp).
|
|
773
527
|
|
|
774
528
|
```json
|
|
775
529
|
{
|
|
776
|
-
"
|
|
777
|
-
"
|
|
778
|
-
"api_key": "YOUR_API_KEY"
|
|
530
|
+
"platform": "darwin",
|
|
531
|
+
"run_bridge_probe": true
|
|
779
532
|
}
|
|
780
533
|
```
|
|
781
534
|
|
|
782
|
-
|
|
535
|
+
`bridge_command`, and `slicer_path`, `plugin_dir`, or `runtime_dir` with `run_bridge_probe: true`, require `MCP_ALLOW_EXECUTABLE_ARG=1`.
|
|
783
536
|
|
|
784
|
-
####
|
|
537
|
+
#### fulu_bambu_network_rpc
|
|
785
538
|
|
|
786
|
-
|
|
539
|
+
Call one FULU BambuNetwork bridge method for diagnostics. Read-only methods such as `bridge.handshake`, `bridge.runtime_info`, and `net.get_user_print_info` are allowed by default. Agent and session setup methods require `allow_mutating_method: true`. Raw print methods (such as `net.start_print`), printer messages (`net.send_message`), file transfers, and unknown methods are refused, because they would bypass the print safety gate; print with `print_3mf`. `bambu_model` is informational only. See [bridge RPC](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/FULU.md#bridge-rpc).
|
|
787
540
|
|
|
788
541
|
```json
|
|
789
542
|
{
|
|
790
|
-
"
|
|
791
|
-
"type": "octoprint",
|
|
792
|
-
"api_key": "YOUR_API_KEY",
|
|
793
|
-
"filename": "my_print.gcode",
|
|
794
|
-
"gcode": "G28\nG1 X100 Y100 Z10 F3000\n...",
|
|
795
|
-
"print": true
|
|
543
|
+
"method": "bridge.handshake"
|
|
796
544
|
}
|
|
797
545
|
```
|
|
798
546
|
|
|
799
|
-
|
|
547
|
+
The bridge command comes from `FULU_BAMBU_BRIDGE_COMMAND`; a per-call `bridge_command` requires `MCP_ALLOW_EXECUTABLE_ARG=1`.
|
|
548
|
+
|
|
549
|
+
</details>
|
|
550
|
+
|
|
551
|
+
<details>
|
|
552
|
+
<summary><strong>Slicing Tools</strong></summary>
|
|
553
|
+
|
|
554
|
+
### Slicing Tools
|
|
555
|
+
|
|
556
|
+
See the [slicing guide](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SLICING.md) for slicer types, profiles, and troubleshooting. Slicing a file yourself in the slicer's GUI and uploading the result is the most predictable path.
|
|
557
|
+
|
|
558
|
+
#### slice_stl
|
|
559
|
+
|
|
560
|
+
Slice an STL or 3MF with the configured slicer and return the output path: G-code for PrusaSlicer, Slic3r, generic OrcaSlicer, and CuraEngine, or a sliced `.3mf` for the Bambu-compatible path.
|
|
561
|
+
|
|
562
|
+
The **Bambu-compatible path** is used for Bambu Studio, FULU OrcaSlicer-bambulab, and OrcaSlicer when the call passes `bambu_model`:
|
|
563
|
+
|
|
564
|
+
- The machine preset always comes from `bambu_model` (or `BAMBU_MODEL`, asked for when missing) and `nozzle_diameter` (default `NOZZLE_DIAMETER` or 0.4). The exact `<model> <diameter> nozzle` preset must exist in the selected slicer installation. Its `inherits` and `include` chains are resolved before the slicer runs.
|
|
565
|
+
- `slicer_profile` (or `SLICER_PROFILE`) is a process profile only. A `machine;process` list is rejected with instructions.
|
|
566
|
+
- Slicing accepts `p1s`, `p1p`, `p2s`, `x1c`, `x1e`, `a1`, `a1mini`, `h2d`, `h2s`, and `h2c` when the installed slicer has that preset. Printing still accepts only the seven models in `BAMBU_MODEL`.
|
|
567
|
+
- The output must contain a nonempty `Metadata/plate_<n>.gcode`. Failures stop with the slicer's exit code or signal, the tails of its output, and slicing-specific advice.
|
|
800
568
|
|
|
801
569
|
```json
|
|
802
570
|
{
|
|
803
|
-
"
|
|
804
|
-
"
|
|
805
|
-
"
|
|
806
|
-
"
|
|
807
|
-
"
|
|
571
|
+
"stl_path": "/path/to/phone-case.stl",
|
|
572
|
+
"slicer_type": "bambustudio",
|
|
573
|
+
"bambu_model": "p1s",
|
|
574
|
+
"nozzle_diameter": "0.4",
|
|
575
|
+
"bed_type": "textured_plate",
|
|
576
|
+
"load_filaments": "/path/to/filaments/tpu-95a-hf.json",
|
|
577
|
+
"arrange": true,
|
|
578
|
+
"orient": false
|
|
808
579
|
}
|
|
809
580
|
```
|
|
810
581
|
|
|
811
|
-
|
|
582
|
+
Options for the Bambu-compatible path:
|
|
812
583
|
|
|
813
|
-
|
|
584
|
+
| Argument | What it does |
|
|
585
|
+
|---|---|
|
|
586
|
+
| `bed_type` | Build plate: `textured_plate`, `cool_plate`, `engineering_plate`, or `hot_plate` (default `BED_TYPE` or `textured_plate`) |
|
|
587
|
+
| `nozzle_type` | Installed nozzle: `stainless_steel`, `hardened_steel`, `tungsten_carbide`, or `brass` (default `BAMBU_NOZZLE_TYPE`, else the preset's stock nozzle). Printing requires it to match the printer's reported nozzle |
|
|
588
|
+
| `load_filaments` | Filament profile JSON paths in slot order, `;`-separated. One profile applies to every slot; otherwise give one per slot. `filament_profile` is an alias |
|
|
589
|
+
| `load_filament_ids` | Comma-separated filament IDs mapping filaments to objects, such as `1,2,3,1` |
|
|
590
|
+
| `filament_colours` | One `#RRGGBB` per filament slot, `;`-separated. Defaults to the input 3MF's colours, then each profile's colour |
|
|
591
|
+
| `template_3mf_path`, `template_name`, `template_dir` | Reuse a 3MF's or profile's slicer settings as the process profile (defaults: `BAMBU_TEMPLATE_3MF_PATH`, `BAMBU_TEMPLATE_DIR`). An explicit `slicer_profile` takes precedence |
|
|
592
|
+
| `uptodate`, `min_save`, `skip_modified_gcodes` | Refresh 3MF presets to the installed slicer, write a smaller 3MF, or ignore custom G-code embedded in an input 3MF |
|
|
593
|
+
| `orient`, `arrange`, `ensure_on_bed`, `repetitions`, `clone_objects`, `skip_objects`, `slice_plate` | Placement: auto-orient, auto-arrange (set `false` to keep a layout), drop floating models onto the bed, copies, per-object clone counts, objects to skip, and which plate to slice (0 = all) |
|
|
594
|
+
| `scale`, `rotate`, `rotate_x`, `rotate_y` | Transform before slicing (uniform scale; rotations in degrees) |
|
|
595
|
+
| `enable_timelapse`, `allow_mix_temp` | Insert timelapse parking moves; allow filaments with different temperature needs on one plate |
|
|
596
|
+
|
|
597
|
+
Generic slicers keep their own profile formats: PrusaSlicer and Slic3r load one exported config, and generic OrcaSlicer takes `machine.json;process.json`, optionally followed by `|filament.json`. `slicer_type`, `slicer_profile`, and `filament_profile` fall back to `SLICER_TYPE`, `SLICER_PROFILE`, and `FILAMENT_PROFILE`. The slicer executable comes from `SLICER_PATH`; a per-call `slicer_path` requires `MCP_ALLOW_EXECUTABLE_ARG=1`. See the [slicing guide](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/SLICING.md#bambu-compatible-slicing).
|
|
598
|
+
|
|
599
|
+
#### slice_with_template
|
|
814
600
|
|
|
815
|
-
|
|
601
|
+
Slice an STL or 3MF with a named template from the local template registry. The template supplies the process settings; the machine preset still comes from `bambu_model` and `nozzle_diameter`. It takes the same arguments as `slice_stl`, and an explicit `slicer_profile` in the call overrides the template.
|
|
816
602
|
|
|
817
603
|
```json
|
|
818
604
|
{
|
|
819
|
-
"
|
|
820
|
-
"
|
|
821
|
-
"
|
|
822
|
-
"filename": "my_print.gcode"
|
|
605
|
+
"stl_path": "/path/to/bracket.stl",
|
|
606
|
+
"template_name": "p1s-petg-strong",
|
|
607
|
+
"bambu_model": "p1s"
|
|
823
608
|
}
|
|
824
609
|
```
|
|
825
610
|
|
|
826
|
-
|
|
611
|
+
#### list_templates
|
|
827
612
|
|
|
828
|
-
|
|
613
|
+
List the saved slicing templates (`.3mf`, `.json`, `.config`) in the registry directory, `BAMBU_TEMPLATE_DIR` (default `~/Sync/bambu/templates`), or in `template_dir`.
|
|
614
|
+
|
|
615
|
+
```json
|
|
616
|
+
{}
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
#### save_template
|
|
829
620
|
|
|
830
|
-
|
|
621
|
+
Copy a local `.3mf`, `.json`, or `.config` file into the template registry. `template_name` defaults to the source filename without its extension.
|
|
831
622
|
|
|
832
623
|
```json
|
|
833
624
|
{
|
|
834
|
-
"
|
|
835
|
-
"
|
|
836
|
-
"api_key": "YOUR_API_KEY"
|
|
625
|
+
"source_path": "/path/to/p1s-petg-strong.3mf",
|
|
626
|
+
"template_name": "p1s-petg-strong"
|
|
837
627
|
}
|
|
838
628
|
```
|
|
839
629
|
|
|
840
|
-
|
|
630
|
+
#### get_slice_settings
|
|
841
631
|
|
|
842
|
-
|
|
632
|
+
Read the slicer settings in a 3MF, an extracted `project_settings.config`, or a profile JSON without slicing: layer height, infill, walls, supports, brim, bed, printer, and filaments. Pass `source_path`, or `template_name` to read a saved template.
|
|
843
633
|
|
|
844
|
-
|
|
634
|
+
```json
|
|
635
|
+
{
|
|
636
|
+
"template_name": "p1s-petg-strong"
|
|
637
|
+
}
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
#### confirm_temperatures
|
|
641
|
+
|
|
642
|
+
Report every heater target in a G-code file: `S` and `R` forms, tool-addressed targets, RepRapFirmware `G10`/`M568`, and Klipper `SET_HEATER_TEMPERATURE`. An expected `extruder_temp` or `bed_temp` matches only when it equals the file's highest target, which the result returns as `peak`. It is read-only; the printing tools enforce their own safety gate.
|
|
845
643
|
|
|
846
644
|
```json
|
|
847
645
|
{
|
|
848
|
-
"
|
|
646
|
+
"gcode_path": "/path/to/model.gcode",
|
|
647
|
+
"extruder_temp": 240,
|
|
648
|
+
"bed_temp": 80
|
|
649
|
+
}
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
#### process_and_print_stl
|
|
653
|
+
|
|
654
|
+
Extend an STL's base, slice it, and print it through the same checked print gate as `upload_gcode` and `print_3mf`, including the human confirmation. If you pass `extruder_temp` or `bed_temp`, each must equal the sliced job's highest target (`S` and `R` forms, every tool); a mismatch stops before anything is uploaded. Pass `material` when the sliced G-code has no `filament_type` metadata. On a Bambu printer with a Bambu-compatible slicer, the sliced `.3mf` goes through the `print_3mf` checks, and the printer model is required.
|
|
655
|
+
|
|
656
|
+
```json
|
|
657
|
+
{
|
|
658
|
+
"stl_path": "/path/to/model.stl",
|
|
659
|
+
"extension_inches": 0.1,
|
|
660
|
+
"extruder_temp": 210,
|
|
661
|
+
"bed_temp": 60,
|
|
662
|
+
"material": "PLA",
|
|
849
663
|
"type": "octoprint",
|
|
850
|
-
"
|
|
851
|
-
"component": "extruder",
|
|
852
|
-
"temperature": 200
|
|
664
|
+
"host": "192.168.1.100"
|
|
853
665
|
}
|
|
854
666
|
```
|
|
855
667
|
|
|
856
|
-
|
|
668
|
+
Use `slice_stl`, `confirm_temperatures`, and `upload_gcode` separately when you want to review the sliced file before the print is offered for confirmation.
|
|
857
669
|
|
|
858
670
|
</details>
|
|
859
671
|
|
|
860
|
-
<details
|
|
861
|
-
<summary>
|
|
672
|
+
<details>
|
|
673
|
+
<summary><strong>Advanced Tools</strong></summary>
|
|
862
674
|
|
|
863
|
-
###
|
|
675
|
+
### Advanced Tools
|
|
864
676
|
|
|
865
|
-
####
|
|
677
|
+
#### Blender MCP
|
|
866
678
|
|
|
867
|
-
|
|
679
|
+
Connect a standard stdio Blender MCP server with `BLENDER_MCP_COMMAND` (for example, the full path to `uvx`) and `BLENDER_MCP_ARGS` (for example `["mcp-for-blender"]`). The [mcp-for-blender](https://github.com/ahujasid/mcp-for-blender) project was formerly published as `blender-mcp`, which still works as a compatibility wrapper. Install and enable its addon in Blender and start the addon's connection. Blender and this server must be able to read the same local files. Printer tools work without Blender configured. Keep Blender open while your agent works: the addon does not run in background mode. See the [Blender guide](https://github.com/DMontgomery40/mcp-3D-printer-server/blob/main/docs/BLENDER.md) for setup, units, and a worked example that refits a phone case for a new phone end to end.
|
|
680
|
+
|
|
681
|
+
#### blender_mcp_status
|
|
682
|
+
|
|
683
|
+
Inspect the Blender MCP configuration. With `connect: true`, it starts the configured server, initializes it, and lists its tools by name and summary. Pass `tool_names` to get the full input schemas of the tools you are about to call (`include_schemas: true` returns all of them, which is large). A successful connection does not prove the addon inside Blender is running; call `get_scene_info` through `blender_mcp_call` to check that.
|
|
868
684
|
|
|
869
685
|
```json
|
|
870
686
|
{
|
|
871
|
-
"
|
|
872
|
-
"
|
|
873
|
-
"plugin_dir": "/Applications/OrcaSlicer.app/Contents/MacOS",
|
|
874
|
-
"run_bridge_probe": true,
|
|
875
|
-
"bridge_command": "\"/Applications/OrcaSlicer.app/Contents/MacOS/pjarczak-bambu-linux-host-wrapper\" \"$HOME/Library/Application Support/OrcaSlicer/macos-bridge/runtime/pjarczak_bambu_linux_host\""
|
|
687
|
+
"connect": true,
|
|
688
|
+
"tool_names": ["execute_blender_code"]
|
|
876
689
|
}
|
|
877
690
|
```
|
|
878
691
|
|
|
879
|
-
####
|
|
692
|
+
#### blender_mcp_call
|
|
880
693
|
|
|
881
|
-
|
|
694
|
+
Call a tool the Blender MCP server advertises, such as `get_scene_info` or `execute_blender_code`, with arguments matching its discovered schema. The full MCP result, including images and errors, is returned. Calls can change the active Blender scene and are never retried automatically. Preserve the user's own words in `user_prompt` when the remote tool asks for it.
|
|
882
695
|
|
|
883
696
|
```json
|
|
884
697
|
{
|
|
885
|
-
"
|
|
886
|
-
"
|
|
698
|
+
"tool_name": "get_scene_info",
|
|
699
|
+
"arguments": { "user_prompt": "Inspect the scene before preparing a print." }
|
|
887
700
|
}
|
|
888
701
|
```
|
|
889
702
|
|
|
890
|
-
####
|
|
703
|
+
#### blender_mcp_export_stl
|
|
891
704
|
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
**`bambu_model` is required** -- it ensures the slicer generates G-code for the correct printer. Using the wrong model can cause the bed to crash into the nozzle and damage the printer. If not provided in the tool call and `BAMBU_MODEL` is not set in the environment, the server will ask interactively via MCP elicitation (if supported by your client) or return a clear error.
|
|
705
|
+
Export named objects from the live Blender scene to a new STL for slicing. Use it after modelling or editing through `blender_mcp_call`; Blender MCP's own `export_scene` writes GLB or FBX, not STL. The export writes world-space geometry with modifiers applied, without changing the scene, selection, or mode.
|
|
895
706
|
|
|
896
707
|
```json
|
|
897
708
|
{
|
|
898
|
-
"
|
|
899
|
-
"
|
|
900
|
-
"
|
|
901
|
-
"host": "your_bambu_ip",
|
|
902
|
-
"bambu_serial": "YOUR_SERIAL",
|
|
903
|
-
"bambu_token": "YOUR_TOKEN",
|
|
904
|
-
"slicer_type": "orcaslicer-bambulab",
|
|
905
|
-
"slicer_path": "/path/to/FULU/OrcaSlicer",
|
|
906
|
-
"use_ams": true,
|
|
907
|
-
"ams_mapping": [0, 1, 2, 3],
|
|
908
|
-
"bed_leveling": true,
|
|
909
|
-
"flow_calibration": false,
|
|
910
|
-
"vibration_calibration": false,
|
|
911
|
-
"timelapse": false
|
|
709
|
+
"object_names": ["PhoneCase"],
|
|
710
|
+
"output_path": "/path/to/phone-case.stl",
|
|
711
|
+
"user_prompt": "Make it fit my iPhone 17 Pro Max."
|
|
912
712
|
}
|
|
913
713
|
```
|
|
914
714
|
|
|
915
|
-
|
|
715
|
+
- The result reports `output_verified: true`, the triangle count, and `bounding_box.dimensions` measured from the written file. Compare the dimensions with what you expect before slicing.
|
|
716
|
+
- STL files carry no units and slicers read them as millimetres. An imported STL keeps its numbers, so the default `scale: 1` is right. If a part was modelled in metres, the result warns that it is under 1 unit across; export again with `scale: 1000`.
|
|
717
|
+
- `output_path` must be new and its parent must exist; nothing is ever overwritten. On any Blender error, mismatched receipt, or invalid file, nothing is published.
|
|
916
718
|
|
|
917
|
-
|
|
719
|
+
#### blender_mcp_edit_model
|
|
918
720
|
|
|
919
|
-
|
|
721
|
+
Import an STL into Blender, apply ordered edits, and export a new STL. Supported operations are `decimate:<ratio>` (greater than 0, up to 1), `remesh:<voxel size>` (positive, in STL units), and `boolean_union:<STL path>`. Use `blender_mcp_call` for anything else.
|
|
920
722
|
|
|
921
|
-
|
|
922
|
-
|
|
723
|
+
```json
|
|
724
|
+
{
|
|
725
|
+
"stl_path": "/path/to/model.stl",
|
|
726
|
+
"output_path": "/path/to/model-edited.stl",
|
|
727
|
+
"operations": ["decimate:0.5"],
|
|
728
|
+
"user_prompt": "Reduce the triangle count for printing.",
|
|
729
|
+
"execute": false
|
|
730
|
+
}
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
- The default (`execute: false`) validates the request and returns the plan and generated Python without launching Blender. Set `execute: true` to apply it, reusing the preview's `output_path`.
|
|
734
|
+
- Omitting `output_path` selects a unique `model-edited-<id>.stl` beside the input. Existing input and output files are never overwritten.
|
|
735
|
+
- The edit requires Object Mode, preserves existing scene objects and selection, and publishes the new STL only after checking a matching export receipt and a valid, finite triangle mesh. Binary STLs up to 256 MiB are validated in small chunks; ASCII STLs are limited to 4 MiB.
|
|
736
|
+
- Requests have connection, discovery, and call deadlines (`BLENDER_MCP_TIMEOUT_MS`, default 120000) that also cover file validation. Interrupted edits are never replayed; inspect Blender before retrying, because an edit may already have started.
|
|
737
|
+
- A valid STL is not proof of printability. Inspect the result before slicing.
|
|
923
738
|
|
|
924
|
-
|
|
739
|
+
Legacy `BLENDER_MCP_BRIDGE_COMMAND` shell commands remain supported when no standard command is configured. They receive JSON on stdin (`modelPath`, `operations`, `source`, and `stlPath`) and the same JSON in `MCP_BLENDER_PAYLOAD`, and their results report `output_verified: false`. A per-call `bridge_command` requires `MCP_ALLOW_EXECUTABLE_ARG=1`.
|
|
925
740
|
|
|
926
|
-
|
|
927
|
-
- `printer://{host}/files` - List of files available on the 3D printer (FTP for Bambu)
|
|
928
|
-
- `printer://{host}/file/{filename}` - Content of a specific G-code file (checks existence only for Bambu)
|
|
741
|
+
</details>
|
|
929
742
|
|
|
930
743
|
</details>
|
|
931
744
|
|
|
932
|
-
<details
|
|
933
|
-
<summary>
|
|
745
|
+
<details>
|
|
746
|
+
<summary><strong>Available Resources</strong></summary>
|
|
934
747
|
|
|
935
|
-
|
|
748
|
+
## Available Resources
|
|
936
749
|
|
|
937
|
-
|
|
750
|
+
Resources follow the MCP resource protocol. They use the configured `PRINTER_TYPE` and credentials; the host segment selects the printer address.
|
|
938
751
|
|
|
939
|
-
- `
|
|
940
|
-
- `
|
|
941
|
-
- `
|
|
752
|
+
- `printer://{host}/status`: the printer's current status, as returned by `get_printer_status`
|
|
753
|
+
- `printer://{host}/files`: the file list, as returned by `list_printer_files`
|
|
754
|
+
- `printer://{host}/file/{filename}`: details for one file. On Bambu printers this only reports whether the file exists.
|
|
942
755
|
|
|
943
|
-
|
|
944
|
-
"Read the content of my Bambu process preset named '0.16mm Optimal @BBL P1S'"
|
|
945
|
-
(Claude would call ReadResource with `preset://bambu/process/0.16mm%20Optimal%20%40BBL%20P1S`)
|
|
756
|
+
For example, `printer://192.168.1.100/status` reads the status of the printer at that address.
|
|
946
757
|
|
|
947
758
|
</details>
|
|
948
759
|
|
|
949
|
-
|
|
760
|
+
<details>
|
|
761
|
+
<summary><strong>Printer Limitations</strong></summary>
|
|
762
|
+
|
|
763
|
+
## Printer Limitations
|
|
764
|
+
|
|
765
|
+
1. **Status depth varies by backend.** Bambu status includes progress, layers, and time remaining. OctoPrint status comes from `/api/printer` (state and temperatures, not job progress). Klipper status comes from Moonraker's `/printer/info`, which reports the host state but not job progress or temperatures. Duet, Repetier, and Creality responses have not been verified on hardware.
|
|
766
|
+
2. **Cancel, but no pause.** There is no pause or resume tool. `cancel_print` stops the job.
|
|
767
|
+
3. **Plain HTTP for most backends.** OctoPrint, Klipper, Duet, Repetier, and Creality adapters connect over `http://`. The Prusa adapter uses HTTPS for Prusa Connect, an `https://` host, or port 443.
|
|
768
|
+
4. **Moonraker authentication is optional; Duet has no password support.** Set `API_KEY` for Moonraker hosts that require authentication. Leave it empty only when Moonraker trusts the MCP host. A password-protected Duet cannot be reached yet.
|
|
769
|
+
5. **Command sent is not print finished.** A success response means the printer or its host accepted the request. Check status, and the printer itself, before you walk away.
|
|
770
|
+
6. **Bambu prints need a sliced project and the right model.** `print_3mf` needs a `.3mf` with `Metadata/plate_<n>.gcode`, uploads it to `cache/`, and starts plate 1. Print settings such as layer height and temperatures cannot be changed at print time. `start_print` handles plain `.gcode` files only.
|
|
771
|
+
7. **Bambu AMS mapping is simple.** `ams_mapping` values are sorted and padded to five entries; real behavior still depends on firmware, loaded filament, and the project's metadata. For AMS inventory and color matching, see [bambu-printer-mcp](https://github.com/DMontgomery40/bambu-printer-mcp).
|
|
772
|
+
8. **Bambu temperatures go through G-code.** Temperature targets are sent as `M104` or `M140` over MQTT, so the printer's firmware and current state decide whether they apply.
|
|
773
|
+
9. **Bambu networking assumes a trusted LAN.** MQTT and FTPS use the printer's self-signed certificate. Uploads use TLS 1.2 with session reuse; confirmation on the X1C firmware reported in [#22](https://github.com/DMontgomery40/mcp-3D-printer-server/issues/22) is still outstanding.
|
|
774
|
+
10. **Safety checks read files and reports, not the physical printer.** A declared material cannot prove what spool is loaded, and a finished-job report cannot prove the bed is clear, which is why a human confirms. Klipper macro parameters that name a heater are checked, but macro bodies stored on the printer cannot be inspected. On Duet/RepRapFirmware, selecting a tool (`T0`) heats it to the temperature already stored on the printer; activation-only `M568` and `M144` are refused, but a plain tool change is allowed because every firmware uses it. The safety gate is tested with mocked printer transports and loopback HTTP APIs, plus one real Bambu P1S run that reached the firmware's command check; other printer systems have not been exercised on real hardware in this release.
|
|
775
|
+
11. **Remote starts need a download route.** `start_print` of a file already on the printer works on Bambu Lab, OctoPrint, Klipper, and Duet. Repetier, Prusa, and Creality refuse it; upload the local G-code with `print: true` instead.
|
|
950
776
|
|
|
951
|
-
|
|
777
|
+
</details>
|
|
952
778
|
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
- "Show me the list of files on my printer."
|
|
956
|
-
- "Upload this G-code to my printer: [G-code content]"
|
|
957
|
-
- "Start printing the file named 'benchy.gcode'."
|
|
958
|
-
- "Cancel the current print job."
|
|
959
|
-
- "Set the extruder temperature to 200°C."
|
|
960
|
-
- "Set the bed temperature to 60°C."
|
|
779
|
+
<details>
|
|
780
|
+
<summary><strong>General Limitations and Considerations</strong></summary>
|
|
961
781
|
|
|
962
|
-
|
|
963
|
-
- "Take this STL file and extend the base by 2 inches, then send to slicer and queue up in my printer."
|
|
964
|
-
- "Extend the base of model.stl by 1.5 inches."
|
|
965
|
-
- "Scale this STL file by 150% uniformly."
|
|
966
|
-
- "Scale model.stl to be twice as wide but keep the same height."
|
|
967
|
-
- "Rotate this model 90 degrees around the Z axis."
|
|
968
|
-
- "Move this STL model up by 5mm to create a gap underneath."
|
|
969
|
-
- "Can you modify just the top part of this model to make it 20% larger?"
|
|
970
|
-
- "Analyze this STL file and tell me its dimensions and details."
|
|
971
|
-
- "Generate a visualization of this STL file so I can see what it looks like."
|
|
972
|
-
- "Create SVG visualizations of my model from different angles."
|
|
973
|
-
- "Make the base of this model wider without changing its height."
|
|
974
|
-
- "Slice the modified STL file using PrusaSlicer."
|
|
975
|
-
- "Confirm that the temperatures in the G-code are 200°C for the extruder and 60°C for the bed."
|
|
976
|
-
- "Process this STL file, make the base 2 inches longer, slice it, and start printing, but confirm the temperatures first."
|
|
977
|
-
- "Print `~/Downloads/my_model.3mf` on the Bambu printer."
|
|
978
|
-
- "Upload `~/Desktop/calibration_cube.3mf` to the Bambu printer using AMS slots 0 and 2, and turn off bed leveling."
|
|
979
|
-
- "Cancel the print job on my Bambu P1S."
|
|
980
|
-
- "What are the settings in my Bambu filament preset 'Generic PETG'?"
|
|
981
|
-
- "Show me my Bambu process presets."
|
|
782
|
+
## General Limitations and Considerations
|
|
982
783
|
|
|
983
|
-
|
|
784
|
+
### Memory usage
|
|
984
785
|
|
|
985
|
-
|
|
786
|
+
- STL tools load the whole mesh into memory as Three.js geometry. Files over about 10 MB can use several hundred MB of RAM.
|
|
787
|
+
- Running several operations in a row on large files can build up memory between garbage collection cycles.
|
|
788
|
+
- There is no built-in memory cap. On constrained systems, avoid processing several large files at once.
|
|
986
789
|
|
|
987
|
-
|
|
790
|
+
### STL manipulation limitations
|
|
988
791
|
|
|
989
|
-
|
|
792
|
+
- `lay_flat` looks for the largest flat face; results on organic or rounded models can be unpredictable.
|
|
793
|
+
- `extend_stl_base` adds new geometry beneath the model. Complex or non-planar undersides can produce gaps or intersections at the join, so inspect the result.
|
|
794
|
+
- `merge_vertices` with a large tolerance can change the model's shape. The 0.01 mm default is safe for most models.
|
|
795
|
+
- `modify_stl_section` works best on simple geometry. Non-manifold meshes (holes, overlapping faces, internal geometry) can produce unexpected results for any transformation; repair them first in your slicer or a mesh tool.
|
|
990
796
|
|
|
991
|
-
|
|
797
|
+
### Visualization limitations
|
|
992
798
|
|
|
993
|
-
|
|
799
|
+
- `generate_stl_visualization` produces a simplified schematic, not a true 3D render, and very detailed models may lose detail.
|
|
994
800
|
|
|
995
|
-
|
|
801
|
+
### Performance considerations
|
|
996
802
|
|
|
997
|
-
|
|
803
|
+
- Slicing can take from seconds to several minutes, depending on the model and your CPU. Slicer runs time out after `SLICER_TIMEOUT_MS` (10 minutes by default).
|
|
804
|
+
- Large uploads depend on your network and the printer's storage speed.
|
|
805
|
+
- Bambu MQTT connections are reused. If a printer restarts or the network drops, the next call reconnects.
|
|
998
806
|
|
|
999
|
-
|
|
807
|
+
</details>
|
|
1000
808
|
|
|
1001
|
-
|
|
809
|
+
<details>
|
|
810
|
+
<summary><strong>MCP Safety Notes</strong></summary>
|
|
1002
811
|
|
|
1003
|
-
|
|
1004
|
-
- **Large STL Files**: Processing large or complex STL files can consume significant memory. The entire STL geometry is loaded into memory during operations.
|
|
1005
|
-
- **Multiple Operations**: Running multiple STL operations in sequence (especially on large files) may cause memory to accumulate if garbage collection doesn't keep up.
|
|
1006
|
-
- **MCP Environment**: Since this runs as an MCP server, be aware that Claude's MCP environment has memory constraints. Complex operations on very large STL files may cause out-of-memory issues.
|
|
812
|
+
## MCP Safety Notes
|
|
1007
813
|
|
|
1008
|
-
|
|
1009
|
-
- **Section Modification**: The section-specific modification feature works best on simpler geometries. Complex or non-manifold meshes may produce unexpected results.
|
|
1010
|
-
- **Base Extension**: The base extension algorithm works by adding a new geometry underneath the model. For models with complex undersides, results may not be perfect.
|
|
1011
|
-
- **Error Handling**: While we've added robust error handling, some edge cases in complex STL files might still cause issues.
|
|
814
|
+
Prompt injection is an open problem for tool-using agents. A downloaded model's description, a README inside an archive, 3MF metadata, or a web page can all contain instructions aimed at your agent. Practical mitigations:
|
|
1012
815
|
|
|
1013
|
-
|
|
1014
|
-
-
|
|
1015
|
-
-
|
|
816
|
+
- Treat tool output and downloaded files as untrusted input.
|
|
817
|
+
- Keep printer keys and access codes in server configuration, with the least privilege your printer software allows.
|
|
818
|
+
- Keep per-call executable selectors off. Slicer, bridge, and Blender commands come from server configuration unless `MCP_ALLOW_EXECUTABLE_ARG=1` is set.
|
|
819
|
+
- Keep print confirmation on. The server asks a human through MCP elicitation before every print start and positive heating command, and refuses clients that cannot ask. `PRINT_REQUIRE_CONFIRMATION=0` (all printers) or `BAMBU_REQUIRE_CONFIRMATION=0` (Bambu only) opts out for headless setups; the first print after a finished job still asks.
|
|
820
|
+
- Heater ceilings come only from server configuration (`PRINTER_MAX_NOZZLE_TEMP`, `PRINTER_MAX_BED_TEMP`, `PRINTER_MAX_CHAMBER_TEMP`, or Bambu's per-model limits). Tool arguments and G-code never raise them.
|
|
821
|
+
- Run the streamable HTTP transport on a trusted network. It binds to `127.0.0.1` by default and has no built-in authentication.
|
|
822
|
+
- Set `BAMBU_MODEL` correctly and never substitute a similar model.
|
|
1016
823
|
|
|
1017
|
-
|
|
1018
|
-
- **Slicing Operations**: External slicer processes can be CPU-intensive and may take considerable time for complex models.
|
|
1019
|
-
- **Progress Reporting**: For large files, progress updates may appear to stall at certain processing stages.
|
|
824
|
+
</details>
|
|
1020
825
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
- Monitor memory usage when processing large files
|
|
1024
|
-
- Test modifications on simple geometries before attempting complex ones
|
|
1025
|
-
- Consider running on a system with at least 4GB of available RAM for larger operations
|
|
826
|
+
<details>
|
|
827
|
+
<summary><strong>License</strong></summary>
|
|
1026
828
|
|
|
1027
|
-
##
|
|
829
|
+
## License
|
|
1028
830
|
|
|
1029
|
-
See [
|
|
831
|
+
GPL-2.0. See [LICENSE](./LICENSE) for the full text.
|
|
1030
832
|
|
|
1031
|
-
|
|
833
|
+
</details>
|
|
1032
834
|
|
|
1033
|
-
|
|
835
|
+
<details>
|
|
836
|
+
<summary><strong>Acknowledgements</strong></summary>
|
|
1034
837
|
|
|
1035
|
-
|
|
1036
|
-
- Strict schema validation and explicit allowlists for actions/hosts.
|
|
1037
|
-
- Human confirmation gates for destructive operations.
|
|
1038
|
-
- Execution sandboxing with resource/time limits.
|
|
1039
|
-
- Treat tool output as untrusted input by default.
|
|
838
|
+
## Acknowledgements
|
|
1040
839
|
|
|
1041
|
-
|
|
840
|
+
Thank you to the **[FULU Foundation](https://www.fulu.org/), [Louis Rossmann](https://www.youtube.com/@rossmanngroup), and the [OrcaSlicer-bambulab community](https://github.com/FULU-Foundation/OrcaSlicer-bambulab)** for advancing user choice, repair rights, and interoperable tools.
|
|
1042
841
|
|
|
1043
|
-
|
|
1044
|
-
|-------|-------------|
|
|
1045
|
-
| [](https://www.npmjs.com/package/mcp-3d-printer-server) | The current version of the package on npm |
|
|
1046
|
-
| [](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) | This project is licensed under GPL-2.0 |
|
|
1047
|
-
| [](https://www.typescriptlang.org/) | This project is written in TypeScript 4.9+ |
|
|
1048
|
-
| [](https://github.com/yourusername/mcp-3d-printer-server/graphs/commit-activity) | This project is actively maintained |
|
|
1049
|
-
| [](https://makeapullrequest.com) | We welcome contributions via Pull Requests |
|
|
1050
|
-
| [](https://nodejs.org/en/download/) | Requires Node.js 18.0.0 or higher |
|
|
1051
|
-
| [](https://www.npmjs.com/package/mcp-3d-printer-server) | Number of downloads per month from npm |
|
|
1052
|
-
| [](https://github.com/yourusername/mcp-3d-printer-server) | Number of GitHub stars this project has received |
|
|
842
|
+
Bambu Lab support builds on community protocol research, including [OpenBambuAPI](https://github.com/Doridian/OpenBambuAPI). The Bambu-only fork, [bambu-printer-mcp](https://github.com/DMontgomery40/bambu-printer-mcp), shares its Blender MCP integration and FTPS fixes with this project.
|
|
1053
843
|
|
|
1054
|
-
|
|
844
|
+
This project is listed in the [Glama MCP server directory](https://glama.ai/mcp/servers/7f6v2enbgk). See [CONTRIBUTORS.md](./CONTRIBUTORS.md) for the people whose code, reports, and printer testing shaped it.
|
|
1055
845
|
|
|
1056
|
-
|
|
846
|
+
</details>
|