Container image of schwarztim/bambu-mcp over streamable HTTP, with cloud_print
480
a container image of schwarztim/bambu-mcp, an
MCP server for Bambu Lab printers, served over
streamable HTTP instead of stdio, plus one extra tool: cloud_print.
Upstream publishes no image and speaks stdio only. This image builds a pinned upstream
commit and fronts it with mcp-proxy, so a client
can connect to a URL. Upstream's source stays untouched apart from the cloud_print tool.
$ docker run -d --name bambu-mcp -p 8080:8080 \
-e BAMBU_LAB_MQTT_HOST=<printer ip> \
-e BAMBU_LAB_MQTT_PASSWORD=<LAN access code> \
-e BAMBU_LAB_DEVICE_ID=<printer serial> \
-e MCP_PROXY_API_KEY=$(openssl rand -hex 32) \
-v bambu-data:/data \
visibilityspots/bambu-mcp:latest
$ claude mcp add --transport http bambu http://<host>:8080/mcp --header "X-API-Key: <key>"
With host, access code and serial present at start, upstream connects to the printer over
MQTT on boot, so no client has to call mqtt_connect.
Since the 2025 firmware a P1S refuses print.project_file over LAN MQTT from anything but
a signed Bambu app (err_code 84033545, "signature verification failed"). Upstream's
printer_print_file therefore uploads fine and the print never starts.
cloud_print submits the job through Bambu Cloud instead, via a
boocloud-bridge sidecar that wraps Bambu's own
networking library. It takes a sliced .gcode.3mf from /data and posts it to the bridge
at BOOCLOUD_BRIDGE_URL. The bridge's HTTP API has no authentication: run it in the same
network namespace as this container, listening on 127.0.0.1 only, and never publish its
port.
cloud_print is on upstream's list of dangerous tools, so it asks for the same
confirmation as printer_print_file.
MCP_PROXY_API_KEY guards /mcp: every request needs an X-API-Key header with that
value; without it the proxy answers 401. mcp-proxy reads every flag from an
MCP_PROXY_* environment variable, so the key never shows up in the process list.
Upstream gates its state-changing tools behind a confirmation flag. That guards against accidents, not against a confidently wrong agent: give a read-only client an allowlist of read tools rather than relying on it.
| variable | default | |
|---|---|---|
BAMBU_LAB_MQTT_HOST | printer address on the LAN | |
BAMBU_LAB_MQTT_PASSWORD | 8-digit LAN access code from the printer screen | |
BAMBU_LAB_DEVICE_ID | printer serial number | |
MCP_PROXY_API_KEY | required X-API-Key value for /mcp | |
MCP_PROXY_PORT | 8080 | listen port |
BOOCLOUD_BRIDGE_URL | http://127.0.0.1:8765 | boocloud-bridge for cloud_print |
Upstream reads its config as encrypted store, then environment. The encrypted store needs
BAMBU_MCP_MASTER_PASSWORD; leave it unset and the environment wins. See upstream's
README for the other variables (Bambu Cloud, MakerWorld).
The image also carries unzip (upstream uses unzip -l to tell a sliced 3MF from an
unsliced one) and curl (the implicit-FTPS upload to the printer's SD card: upstream's
first attempt with explicit TLS times out against the printer and falls back to curl).
mcp-proxy has no health route; a TCP check only proves the port is open. The MQTT
session to the printer fails independently and only shows in the log
(MQTT connection failed): verify with a real tool call.
$ docker build -t visibilityspots/bambu-mcp:latest .
The upstream commit is BAMBU_MCP_REF in the Dockerfile. The image version follows the
version in upstream's package.json at that commit: v<version>-<build>.
patches/register-cloud-print.patch is applied with git apply, so a bump that moves the
lines it touches fails the build instead of silently dropping the tool.
$ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
$ docker buildx build -t visibilityspots/bambu-mcp:latest --platform linux/amd64,linux/arm64 --push .
The tests in goss.yaml run the real entrypoint without a printer behind it: they check the
401 without an API key, and do a real MCP round trip (initialize, tools/list) that must
list upstream's tools plus cloud_print. goss_wait.yaml waits until the port listens.
$ dgoss run -e MCP_PROXY_API_KEY=goss visibilityspots/bambu-mcp:dev
...
Count: 18, Failed: 0, Skipped: 0
INFO: Deleting container
using act for local testing of the written github actions makes my life and commit history a lot easier;
Stage Job ID Job name Workflow name Workflow file Events
0 update update docker-hub-description docker-hub-description.yml push
0 main main CI main.yml push,pull_request
0 scan scan trivy trivy.yml workflow_dispatch,push,schedule
Images are built and pushed by the shared workflow in
visibilityspots/github-workflows when
a tag is pushed. Pushing to main builds nothing; a pull request only builds and runs dgoss.
Distributed under the MIT license. Upstream schwarztim/bambu-mcp is MIT licensed as well.
docker pull visibilityspots/bambu-mcp:latest