Skip to main content
Glama
bambu-mcp

bambu-mcp

by smarthomeaf

bambu-mcp

A self-hosted MCP server for Bambu Lab printers. It lets an AI assistant check on your printers, print sliced files, slice simple STLs and edit meshes, while keeping a human in the loop for anything physical.

  • Home Assistant first. Status, AMS, camera and simple controls come from the ha-bambulab integration over one WebSocket subscription. Direct LAN (MQTT, FTPS, RTSPS) is used only for uploads and print commands, or when HA can't answer.

  • Multi-printer. Printers have ids, names and aliases; printer: auto picks one that passes every check.

  • Safe by default. Anything that moves, heats, prints or deletes returns a preview unless called with confirm: true. Temperatures are clamped, commands are rate-limited and audit-logged, and every print runs a preflight (model, nozzle, plate, AMS match, HMS errors).

  • Token-efficient. 9 grouped tools with action enums; the whole set is under ~2k tokens.

Built and tested against X1C printers (firmware 01.12). Other models are modeled in src/bambu/models.ts but less tested.

Tools

Tool

What it does

printers

List printers, capabilities probe (HA, LAN, FTPS, camera, slicer)

status

State, job, temps, HMS errors; events since a cursor; wait until a print ends

camera

Snapshot from HA or RTSPS

ams

Inventory; match a file's filaments to trays

files

SD card list / download / delete

control

Pause, resume, stop, light, speed, temps, fans, skip objects (all confirm-gated)

print_job

Inspect, preflight, upload, start a .gcode.3mf; cross-printer queue

mesh

STL info, scale, rotate, lay flat, center, extend base, repair (manifold-3d)

slice

Optional: Bambu Studio CLI slicing with flattened presets and AMS-based filament

Related MCP server: bambu-studio-mcp

Quick start

Requires Node 22.12+.

npm ci && npm run build
cp bambu-mcp.example.yaml bambu-mcp.yaml   # edit printers, HA url
export HA_TOKEN=...                          # HA long-lived token; serials and access codes also via env
node dist/index.js                           # stdio

Add it to an MCP client (e.g. Claude Desktop) as a stdio server running node /path/to/dist/index.js with BAMBU_MCP_CONFIG pointing at your config.

Streamable HTTP for a home server: MCP_TRANSPORT=streamable-http MCP_HTTP_TOKEN=... node dist/index.js (bearer token required; /healthz).

Docker:

docker build -t bambu-mcp .                           # slim image
docker build --target slicer -t bambu-mcp:slicer .    # + Bambu Studio (x86-64, ~540 MB)

Mount a volume at /data holding bambu-mcp.yaml.

Docs

  • docs/SPEC.md: architecture, tool catalog, config, safety model

  • docs/PROTOCOL.md: Bambu LAN protocol and Bambu Studio CLI notes (what's verified and what isn't)

  • docs/PRIOR-ART.md: existing projects and what this one took from them

This is a clean-room implementation: no code was copied from the GPL/AGPL projects it learned from.

Development

npm test            # unit tests, no hardware
npm run test:live   # read-only checks against real printers + HA
npm run lint && npm run format:check && npm run typecheck

Live tests that act on hardware are opt-in (BAMBU_LIVE_ACTIONS=1).

License

MIT. Not affiliated with Bambu Lab.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Provides end-to-end 3D printing automation for Bambu Lab printers, allowing users to generate, slice, and monitor prints using natural language. It features model generation from text or images, real-time camera monitoring, and automated print quality improvement.
      MIT
    • F
      license
      A
      quality
      C
      maintenance
      Integrates Bambu Studio and Bambu Lab 3D printers with Claude, enabling printer status checks, print control, file management, and slicing via natural language.
      9
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables LAN-based monitoring and control of Bambu Lab P2S/P1S printers, including confirm-gated print, pause, resume, stop, file upload, and slicing workflows.
      10
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to monitor and control Bambu Lab 3D printers over a local network via MQTT, including real-time status, AMS filament info, print control, and maintenance tracking. It supports guided setup, safety confirmations, read-only mode, and a built-in printer simulator.
      2
      80 npm
      MIT