Skip to main content
Glama
bambu-cloud-mcp

bambu-cloud-mcp

bambu-cloud-mcp

Control your Bambu Lab 3D printers from any MCP client — over the cloud, from anywhere, with live chamber-camera capture on your LAN.

License: MIT Node.js MCP

An MCP (Model Context Protocol) server that lets an AI assistant — Claude Code, Claude Desktop, or any MCP client — monitor and drive Bambu Lab printers. It talks to printers over MQTT, either on your LAN or through the Bambu cloud broker (us.mqtt.bambulab.com / cn.mqtt.bambulab.com), so status and control work from anywhere without putting the printer into LAN-Only mode. It ships 31 tools covering status, print control, temperatures, AMS/filament, files, and a live LAN chamber-camera snapshot.

Why this over other Bambu MCP servers

Most community Bambu MCP servers only do LAN control, or read-only cloud status. This one does two things they usually don't:

  • Full cloud control — every command (pause, resume, stop, set temp, change filament, raw G-code…) works over the internet, because the Bambu cloud MQTT broker accepts the same command topics (device/<serial>/request) as the local one. Log in once with your account and your bound printers auto-connect.

  • Live chamber camera — get_camera_frame pulls a real JPEG snapshot from A1 / A1 Mini / P1P / P1S printers over the LAN and returns it as an image your MCP client can display.

Camera is LAN-only. Bambu tunnels the cloud video feed through a proprietary P2P system (TUTK) that can't be reimplemented in the open, so the camera works only when your machine is on the same network as the printer. Status and control work from anywhere.

Related MCP server: bambu-printer-mcp

Supported printers

  • Control (LAN + cloud): A1, A1 Mini, P1P, P1S, X1C, X1E, H2D and other current models.

  • Camera (LAN only): A1, A1 Mini, P1P, P1S via the port-6000 chamber-image protocol. X1/H2 series use RTSP instead and aren't wired up yet — PRs welcome.

Tools

All 31 tools, grouped by area:

Cloud

Tool

Description

cloud_status

Login status, account, region, token expiry, connected cloud printers

sync_cloud_printers

Discover and connect printers bound to your account over the cloud

cloud_logout

Clear stored cloud credentials and disconnect cloud printers

Printer management

Tool

Description

add_printer

Add a LAN printer (IP + access code + serial) and connect

remove_printer

Remove a printer from the fleet

reconnect_printer

Re-establish MQTT connection(s)

list_printers

List configured printers and connection status

Status

Tool

Description

get_status

Print progress, temps, speed, AMS, lights, stage, etc.

get_version

Firmware / module versions

Print control

Tool

Description

pause_print / resume_print / stop_print

Control the active print

start_print

Start a .3mf / .gcode file already on the SD card (plate, AMS mapping, bed type, calibration options)

start_prints

Start the same file across multiple printers in parallel

Hardware

Tool

Description

set_speed

Print speed (profile name or percentage)

set_temperature

Nozzle / bed temperature (with safety limits)

set_light

Chamber / work light on or off

set_nozzle

Nozzle diameter (for slicer profiles)

AMS / filament

Tool

Description

change_filament

Load / switch filament from an AMS slot

unload_filament

Unload the current filament

G-code

Tool

Description

send_gcode

Send raw G-code (some dangerous commands blocked)

skip_objects

Skip objects in a multi-object print

Files (LAN, FTPS)

Tool

Description

list_files

List files on the printer's SD card

upload_file

Upload a file to the SD card

download_file

Download a file from the SD card

delete_file

Delete a file from the SD card

Camera (LAN only)

Tool

Description

get_camera_frame

Capture a live JPEG from the chamber camera, returned as an image

set_camera_access

Store a printer's LAN access code (and optional IP) for the camera

set_recording

Toggle SD-card recording

set_timelapse

Toggle timelapse

Signing

Tool

Description

sign_message

X.509 message signing for post-January-2025 firmware that requires certificate auth

Requirements

  • Node.js 18+

  • For cloud control: a Bambu Lab account (the one your printers are bound to). No developer token needed — you log in with an emailed code, password, or 2FA.

  • For the camera: your machine on the same LAN as the printer, with "LAN Mode Liveview" enabled on the printer (Settings). This is independent of full LAN-Only mode, so the Bambu Handy app keeps working.

Installation

git clone https://github.com/dylansantwani/bambu-cloud-mcp.git
cd bambu-cloud-mcp
npm install
npm run build

This compiles TypeScript to dist/. The MCP entry point is dist/index.js.

Command-line use

bambu-cli.js drives the same printers from a shell, with no MCP client and no server running. It reads the printer config and cloud credentials this server already stores, so once the MCP side is configured the CLI needs no setup.

node bambu-cli.js                 # status of every registered printer
node bambu-cli.js watch           # poll and redraw until Ctrl+C
node bambu-cli.js status -j       # JSON, for scripting
node bambu-cli.js printers        # list what is registered
node bambu-cli.js version         # firmware versions

Command

What it does

status (default)

one-shot status for all printers; -1 / --once to force single-shot

watch

continuously poll and redraw

printers

list registered printers from config

version

firmware versions

pause / resume

pause or resume the current print

stop

stop the current print, with a confirmation prompt

speed <1|2|3|4|off>

set print speed (3 = sport)

Options: -p, --printer <id\|name\|serial> targets one printer instead of all, -j, --json emits JSON, -h, --help shows usage.

Configuration

Register the server with your MCP client

Claude Code (user scope — available in every project):

claude mcp add bambu -s user -- node /absolute/path/to/bambu-cloud-mcp/dist/index.js

Claude Desktop — add to claude_desktop_config.json:

{
  "mcpServers": {
    "bambu": {
      "command": "node",
      "args": ["/absolute/path/to/bambu-cloud-mcp/dist/index.js"]
    }
  }
}

Restart the client (or start a new session) so it picks up the server.

Environment variables

All are optional:

Variable

Purpose

BAMBU_MCP_CONFIG_DIR

Directory for runtime config and credentials. Default: ~/.bambu-mcp.

BAMBU_APP_PRIVATE_KEY

Override the bundled X.509 private key used by sign_message.

BAMBU_APP_CERTIFICATE

Override the bundled X.509 certificate used by sign_message.

To set the config directory in a client, add an env block to the server entry:

{
  "mcpServers": {
    "bambu": {
      "command": "node",
      "args": ["/absolute/path/to/bambu-cloud-mcp/dist/index.js"],
      "env": {
        "BAMBU_MCP_CONFIG_DIR": "/absolute/path/to/config"
      }
    }
  }
}

Cloud login (for remote control)

Run the interactive login in your own terminal (it needs to prompt you, so it can't run inside the MCP client):

npm run login
  • Choose your region (US default).

  • Enter your account email.

  • Pick method 1 (email code) — no password needed; a one-time code is emailed to you. Password and TOTP-2FA are also supported.

Credentials are written to ~/.bambu-mcp/cloud.json (mode 0600). Your password, if you use one, is only ever sent to Bambu's login endpoint — never stored. On the next server start, your bound printers are auto-discovered and connected over the cloud; you can also trigger this anytime with the sync_cloud_printers tool.

Camera access (optional, LAN only)

The camera needs each printer's 8-character LAN access code (printer screen → Settings → WLAN). Store it once via the set_camera_access tool (or just ask your assistant to). The printer's LAN IP is auto-detected from its status, so you don't hardcode it. Then get_camera_frame returns a live snapshot.

Usage

Once the server is registered and you've logged in, talk to your assistant in plain language. Examples:

  • "List my Bambu printers and show their status."

  • "What's the progress on the print on my P1S?"

  • "Pause the print on printer mini-1."

  • "Set the nozzle temperature on my X1C to 220°C."

  • "Show me a camera snapshot of the A1."

  • "Start benchy.3mf on all my printers."

  • "Unload the filament, then load slot 2."

To add a LAN-only printer directly (no cloud account): "Add a printer at 192.168.1.50 with access code 12345678 and serial 01P00A123456789."

How it works

A printer's mode decides how its MQTT client connects:

  • LAN mode connects to the printer's IP with username bblp + the printer's access code.

  • Cloud mode connects to us.mqtt.bambulab.com (or cn. for China) with username u_<uid> + your account token.

The command topics (device/<serial>/request and /report) are identical in both, which is why every control tool works the same over the cloud as on the LAN. File operations use FTPS (basic-ftp), and the chamber camera speaks the printer's TLS port-6000 image protocol directly (camera-client.ts).

src/
  index.ts            MCP server entry; registers tools, auto-connects on startup
  fleet-manager.ts    Multi-printer connection manager (LAN + cloud branches)
  mqtt-client.ts      Bambu MQTT protocol (status + all control commands)
  bambu-cloud.ts      Cloud API: login, email-code/2FA, device discovery, refresh
  cloud-store.ts      ~/.bambu-mcp/cloud.json credential store
  login-cli.ts        Interactive `npm run login`
  camera-client.ts    LAN chamber-image capture (TLS port 6000 → JPEG)
  camera-store.ts     ~/.bambu-mcp/cameras.json access-code store
  ftp-client.ts       FTPS file operations
  tools/              One file per tool group

All credentials stay local in ~/.bambu-mcp/ (cloud.json, cameras.json, printers.json), written 0600 and git-ignored. Nothing is sent anywhere except Bambu's own API and MQTT broker.

Troubleshooting

  • Cloud login 403 — Bambu's API sits behind Cloudflare; wait a moment and retry.

  • sync_cloud_printers returns 0 printers — you're logged into an account with no bound printers. Log in with the account your Bambu Handy app uses.

  • Camera ECONNREFUSED — "LAN Mode Liveview" isn't enabled on that printer, or the printer is offline (the IP is auto-detected from status).

  • Camera timeout — your machine isn't on the same network as the printer. The camera is LAN-only.

  • connack timeout / ECONNRESET on LAN — a Bambu printer allows only one local MQTT client; close BambuStudio / OrcaSlicer / Home Assistant and retry.

Contributing

Contributions are welcome — see CONTRIBUTING.md for dev setup, build steps, and the Conventional Commits convention. If you're using an AI coding agent, AGENTS.md has repo-specific notes.

Credits

  • LAN control base: griches/bambu-mcp — the original MQTT control layer and local toolset this project forks and builds on.

  • Cloud control, passwordless login, and LAN camera capture are original additions in this fork.

  • Cloud protocol details informed by ha-bambulab / pybambu; camera protocol per community reverse-engineering documented on the Bambu Lab forums.

License

MIT. The upstream base (griches/bambu-mcp) does not publish an explicit license; this fork attributes it prominently and MIT-licenses the original additions. If you're the upstream author and would like different handling, please open an issue.

Available Tools

31 tools
add_printerA

Add a Bambu Lab printer to the fleet. Saves config and connects via MQTT.

Inputs: id (required), host (required), name (required), access_code (required), +2 more.

change_filamentB

Change to a different AMS filament tray on a printer.

Inputs: tray (required), printer, target_temp.

cloud_logoutA

Log out of Bambu cloud: delete stored cloud credentials and disconnect cloud printers. LAN printers are unaffected.

Inputs: no named parameters.

cloud_statusA

Show Bambu cloud login status: whether credentials exist, the account, region, token expiry, and how many cloud printers are connected.

Inputs: no named parameters.

delete_fileB

Delete a file from a printer's SD card via FTP.

Inputs: remote_path (required), printer.

download_fileA

Download a file from a printer's SD card to your local machine via FTP.

Inputs: local_path (required), remote_path (required), printer.

get_camera_frameA

Capture a live JPEG snapshot from a printer's chamber camera over the LAN and return it as an image. Works for A1/A1 Mini/P1P/P1S on the same network with 'LAN Mode Liveview' enabled. The printer's IP is auto-detected; the LAN access code is used for auth (set once via set_camera_access for cloud printers).

Inputs: ip, printer, access_code.

get_statusB

Get current status of a printer (or all printers). Shows print progress, temperatures, speed, AMS, lights, etc.

Inputs: format, printer, detailed.

get_versionB

Get firmware and module version information from a printer.

Inputs: printer.

list_filesA

List files on a printer's SD card via FTP. Shows cached print files, timelapse videos, etc.

Inputs: path, printer.

list_printersA

List all configured printers with their connection status.

Inputs: no named parameters.

pause_printA

Pause the current print on a printer (or all printers).

Inputs: printer.

reconnect_printerA

Reconnect a printer (or all printers) by re-reading config and re-establishing MQTT connections.

Inputs: printer.

remove_printerA

Remove a printer from the fleet. Disconnects MQTT and removes from config.

Inputs: id (required).

resume_printA

Resume a paused print on a printer (or all printers).

Inputs: printer.

send_gcodeA

Send a raw G-code command to a printer (or all printers). Some dangerous commands are blocked for safety.

Inputs: command (required), printer.

set_camera_accessA

Store the LAN access code (and optional IP) for a printer's chamber camera, so get_camera_frame can authenticate. The access code is the 8-digit code in the printer's WLAN settings.

Inputs: printer (required), access_code (required), ip.

set_lightB

Control the LED lights on a printer (or all printers). Supports chamber light and work light.

Inputs: mode (required), light, printer.

set_nozzleA

Set the nozzle diameter on a printer (for profile selection).

Inputs: diameter (required), printer.

set_recordingA

Enable or disable camera recording on a printer (or all printers).

Inputs: enabled (required), printer.

set_speedA

Set print speed on a printer (or all printers). Use a profile name or a raw percentage.

Inputs: percent, printer, profile.

set_temperatureA

Set nozzle or bed temperature on a printer. Includes safety limits (nozzle max 300C, bed max 120C).

Inputs: target (required), temperature (required), printer.

set_timelapseB

Enable or disable timelapse recording on a printer (or all printers).

Inputs: enabled (required), printer.

sign_messageA

Sign a message using the Bambu Lab X.509 certificate. Used to authenticate with printers running firmware that requires certificate-based auth (post-January 2025 firmware).

Inputs: message (required).

skip_objectsA

Skip specific objects during a multi-object print. Skipped objects will not be printed.

Inputs: object_ids (required), printer.

start_printA

Start printing a file that is already on the printer's SD card. Supports .3mf and .gcode files. Use list_files to see available files, or upload_file to add one first.

Inputs: file (required), path, plate, printer, +9 more.

start_printsA

Start multiple prints across different printers in parallel. Much faster than calling start_print multiple times.

Inputs: jobs (required).

stop_printA

Stop/cancel the current print on a printer (or all printers). WARNING: This cannot be undone.

Inputs: printer.

sync_cloud_printersA

Discover printers bound to your Bambu cloud account and connect them over the cloud MQTT broker (works remotely, off your LAN). Requires npm run login first.

Inputs: no named parameters.

unload_filamentB

Unload the current filament from the extruder on a printer (or all printers).

Inputs: printer.

upload_fileA

Upload a local file to a printer's SD card via FTP. Supports .3mf, .gcode files. Use start_print after uploading to begin printing.

Inputs: local_path (required), printer, remote_path.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 31 tools

    Disambiguation4/5

    Most tools target clearly distinct resources and actions, such as file operations, print control, settings, and camera functions. The main ambiguity is between start_print and start_prints, which overlap in intent but differ in scope.

    Naming Consistency4/5

    The vast majority of tools follow a consistent verb_noun snake_case pattern, like list_files, pause_print, and set_temperature. A few exceptions like cloud_logout and cloud_status use a noun-prefix or noun-phrase form, creating minor inconsistency.

    Tool Count2/5

    With 31 tools, the surface exceeds the 25+ threshold and feels heavy for a printer management server. While many tools are individually useful, the count could be reduced by consolidating related set_* operations and print-start variants.

    Completeness4/5

    The tool set covers the main printer lifecycle: fleet management, file upload/download/delete, print control, status, settings, camera, filament, and cloud sync. Minor gaps include no explicit printer configuration update tool and cloud login existing only as an npm prerequisite rather than an MCP tool.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers