# mcp-server-for-bambu [Health: Active]

**Category:** 🏭 Industrial & IoT  
**Repository:** https://github.com/b84330808/mcp-server-for-bambu  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mcp-server-for-bambu

## Description
Unofficial MCP server for Bambu Lab 3D printers (LAN/MQTT). Real-time status, AMS info, print control, maintenance ledger. Not affiliated with Bambu Lab.

## Tools
Capabilities this server exposes over MCP:

- **get_status** — Get real-time printer status including temperatures, print progress, and current state.
- **get_ams_info** — Get AMS (Automatic Material System) filament slot information — types, colors, and remaining amounts.
- **get_maintenance_status** — Get the maintenance ledger report — shows cumulative print time and warns when lubrication, rod cleaning, or hotend inspection is due.
- **mark_maintenance_done** — Record that a maintenance task was completed. Pass `hours_ago` if you did it earlier and forgot to log it.
- **get_recent_prints** — List recent print sessions from the maintenance ledger — names, durations, completion timestamps.
- **forecast_maintenance** — Predict when each maintenance task will become due, based on recent print rate.
- **list_active_warnings** — List currently active HMS warnings/errors from the printer with links to the official wiki page for each.
- **pause_print** — Pause the current print. Safe — the print can be resumed with `resume_print`.
- **resume_print** — Resume a paused print.
- **stop_print** — STOP and CANCEL the current print. THIS IS NOT REVERSIBLE — the partial print and any wasted filament cannot be recovered. NEVER call this tool on the user's first stop request. ALWAYS first ask the user to confirm cancellation in plain language; only call this tool with `confirm: true` after they explicitly say yes/confirm/cancel-it.
- **set_light** — Turn the printer's chamber light on or off.
- **set_speed** — Change the print speed profile. Levels: silent (1), standard (2), sport (3), ludicrous (4).
- **preheat** — Preheat the nozzle and/or bed to specified temperatures. Useful before manually loading filament or starting a print. The heaters stay on until changed, so tell the user to come back or set 0 to turn them off.
- **run_gcode** — Send raw G-code to the printer. POWER USER, can be DESTRUCTIVE: a wrong move can crash the nozzle into the bed or a print, and heater commands stay on. Multiple lines separated by \n. Common: G28 (home), M84 (disable steppers), M104 S210 (set nozzle), G0 Z50 (raise Z). ALWAYS show the user the exact G-code first and only call with `confirm: true` after they approve it.
- **change_active_tray** — Switch the AMS to feed from a different filament slot. The printer unloads the current filament and loads the new one; during a print this changes the material mid-job. Slot IDs are 0–3 within an AMS unit. Use `get_ams_info` first to see what's loaded, tell the user which slot will be loaded, and only call with `confirm: true` after they agree.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "mcp-server-for-bambu": {
    "command": "npx",
    "args": ["-y","mcp-server-for-bambu"],
    "env": {
      "BAMBU_IP": "",
      "BAMBU_SERIAL": "",
      "BAMBU_ACCESS_CODE": "",
      "BAMBU_READ_ONLY": ""
    }
  }
}
```

**Requires environment variables:** `BAMBU_IP`, `BAMBU_SERIAL`, `BAMBU_ACCESS_CODE`, `BAMBU_READ_ONLY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What mcp-server-for-bambu does

mcp-server-for-bambu gives MCP-compatible assistants access to a Bambu Lab 3D printer over the local network. It reads printer state, temperatures, progress, layer information, Wi-Fi signal, AMS contents, and active HMS warnings. It also keeps a local maintenance ledger based on print hours, including lubrication, cleaning, inspection, and other due tasks.

The control surface covers pausing or resuming a print, changing the chamber light, selecting a speed profile, setting nozzle or bed temperatures, switching the active AMS slot, and sending raw G-code. Cancelling a print is supported but cannot be undone. The project is unofficial and is not affiliated with Bambu Lab.

## How it works

The server communicates directly with the configured printer through its local MQTT service on port 8883. No Bambu cloud connection or telemetry service is used. The printer must be on the same network and have LAN Mode Liveview enabled.

On first launch, setup mode exposes `setup_printer`. You provide the printer IP address, serial number, and eight-character LAN access code. The tool validates the values and tests the connection before saving credentials. Alternatively, credentials can be supplied through environment variables. A built-in printer simulator can be started with `npm run sim` for demonstrations and tests.

Safety controls distinguish read operations from actions that can affect the printer. Stopping a print, sending G-code, and changing the active AMS tray require an explicit confirmation value. Read-only mode registers only inspection tools. The printer uses a self-signed certificate, so MQTT traffic is encrypted but the printer identity is not independently verified.

## Setup and configuration

Node.js 20 or newer is required. Install the server as a stdio MCP server with `npx -y mcp-server-for-bambu`, then add that command to an MCP client configuration. The repository includes examples for Claude Desktop, Cursor, and VS Code, as well as a Claude Code plugin installation.

For setup through the assistant, read these values from the printer:

- IP address: Settings → WLAN → the connected network
- Serial number: Settings → Device → Device Info
- Access code: Settings → WLAN → LAN Mode Liveview

The access code is not the Wi-Fi password. After successful setup, restart or reconnect the MCP server so the printer tools become available. Credentials saved on macOS and Linux use owner-only file permissions. `BAMBU_READ_ONLY=1` disables operations that can pause, cancel, heat, or move the printer.

## Tools and capabilities

- Inspect current state, temperatures, progress, layers, Wi-Fi, and HMS warnings with `get_status`.
- Review AMS slot filament type, color, remaining percentage, and active slot with `get_ams_info`.
- List active HMS warnings and their Bambu wiki links.
- Check maintenance totals, forecast upcoming tasks, review recent print sessions, and record completed maintenance.
- Pause or resume prints, change speed profiles, control the chamber light, and preheat the nozzle or bed.
- Stop a print, switch the active AMS tray, or send raw G-code with confirmation.

## Limitations and notes

The server is designed for LAN access to one configured printer and rejects addresses outside permitted private, loopback, link-local, and Tailscale ranges. Do not expose the printer’s MQTT port to the internet. Heating commands leave heaters at their requested targets until changed, so set temperatures to zero before leaving the printer unattended. The implementation was tested against the P1S; compatibility with the P1P, X1C, and A1 depends on their MQTT behavior.

_Full upstream README: https://allmcps.com/mcp/mcp-server-for-bambu/readme_

