Printer Control Tools
All printer tools accept optional host, bambu_serial, and bambu_token arguments. If omitted, values fall back to the environment variables PRINTER_HOST, BAMBU_SERIAL, and BAMBU_TOKEN. Passing them explicitly is useful when working with more than one printer.
The server also accepts the alias variables BAMBU_PRINTER_HOST, BAMBU_PRINTER_SERIAL, and BAMBU_PRINTER_ACCESS_TOKEN, plus BAMBU_PRINTER_MODEL and BAMBU_STUDIO_PATH.
get_printer_status
Retrieve current printer state including temperatures, print progress, layer count, time remaining, and AMS slot data. Internally sends a push_all MQTT command to force a fresh status report before reading cached state.
{
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}Returns a structured object with fields including status (gcode_state string), temperatures.nozzle, temperatures.bed, temperatures.chamber, print.progress, print.currentLayer, print.totalLayers, print.timeRemaining, and ams (raw AMS data from the printer).
get_printer_filaments
Read the live AMS inventory and resolve each loaded tray to Bambu Studio filament profile JSON paths when bambu_model is known. The result includes a summary, per-slot display labels, profile match confidence, and a recommended load_filaments value for simple single-material CLI slicing.
{
"bambu_model": "h2d",
"nozzle_diameter": "0.4",
"host": "192.168.1.100",
"bambu_serial": "094...",
"bambu_token": "your_access_token"
}High-signal fields:
summary.loaded_slots,summary.resolved_profile_slots,summary.unresolved_loaded_slots,summary.empty_slotstrays[].display_name,trays[].tray_color,trays[].remain_percenttrays[].resolved_profile_pathtrays[].profile_resolution:exact-model-nozzle,model,generic, orunresolvedtrays[].match_confidence:high,medium,low, ornonerecommended.load_filaments: the profile path the MCP will use for auto-slicing when no explicit filament override is provided
list_printer_files
List files stored on the printer's SD card. Scans the cache/, timelapse/, and logs/ directories and returns both a flat list and a directory-grouped breakdown.
This is a read-only query: it never creates directories. Optional directories absent from a successful root listing return empty lists. Authentication, TLS, permission, and transfer failures are reported as errors rather than empty or partial results.
{
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}camera_snapshot
Capture a single JPEG frame from the printer's chamber camera. Read-only.
Two transports are wired in, picked by bambu_model:
- TCP-on-6000 for A1, A1 mini, P1S, P1P. Native protocol per OpenBambuAPI/video.md: TLS on port 6000, 80-byte auth packet (
bblp+ access token), repeating 16-byte frame header + JPEG payload. - RTSP for X1, X1 Carbon, X1E, P2S, X2D and H2, H2S, H2D, H2C, H2D Pro. Shells out to ffmpeg with
rtsps://bblp:<token>@<host>:322/streaming/live/1 -frames:v 1. The H2 series wasn't documented in OpenBambuAPI'svideo.mdbut its firmware uses the same RTSP endpoint as X1 (verified live against an H2S, 2026-04-27).
Requires ffmpeg in PATH for the RTSP path. Install with brew install ffmpeg on macOS. Configure a trusted custom binary with the server-side FFMPEG_PATH environment variable, or set MCP_ALLOW_EXECUTABLE_ARG=1 before using the ffmpeg_path tool argument. The TCP-on-6000 path uses native Node TLS and does not require ffmpeg.
{
"save_path": "/tmp/snap.jpg",
"timeout_ms": 8000,
"bambu_model": "h2s",
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}Returns { status, format: "image/jpeg", sizeBytes, base64, savedTo?, transport }. transport is "tcp-6000" or "rtsps-322" so callers can tell which path produced the frame. Pass save_path to also write the bytes to disk; otherwise only the base64 payload is returned.
delete_printer_file
Delete a single file from the printer's SD card via FTPS. Destructive. Requires confirm: true — without it the call returns status: "skipped" and does not contact the printer. Path traversal segments (..) are rejected. Only files under cache/, timelapse/, and logs/ can be deleted.
{
"filename": "old_print.gcode.3mf",
"confirm": true,
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}A bare filename defaults to cache/<filename>. To target other directories pass a relative path:
{ "filename": "timelapse/2026-04-26_12-00.mp4", "confirm": true }{ "filename": "logs/printer.log", "confirm": true }upload_gcode
Write G-code content from a string directly to the printer's cache/ directory. The content is written to a temporary file and uploaded via FTPS.
{
"filename": "calibration.gcode",
"gcode": "G28\nM104 S210\nG1 X100 Y100 Z10 F3000\n",
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}upload_file
Upload a local file (G-code or 3MF) to the printer. If print is true and the file is a .gcode file, start_print_job is called automatically after a successful upload. For .3mf files, upload completes normally but you must use print_3mf to initiate the print (which handles plate selection and metadata).
{
"file_path": "/Users/yourname/Downloads/part.3mf",
"filename": "part.3mf",
"print": false,
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}start_print_job
Start printing a .gcode file that is already on the printer's SD card. Do not use this for .3mf files -- use print_3mf instead, which handles the project_file MQTT command with proper metadata.
{
"filename": "cache/calibration.gcode",
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}If filename does not include a directory prefix, the server prepends cache/ automatically.
cancel_print
Cancel the currently running print job. Sends an UpdateState MQTT command with state: "stop". Not resumable — use pause_print if you may want to continue.
{
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}pause_print
Pause the currently running print job. Sends an UpdateState MQTT command with state: "pause". Resumable via resume_print.
{
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}resume_print
Resume a paused print job. Sends an UpdateState MQTT command with state: "resume".
{
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}clear_hms_errors
Clear HMS or print error state on the printer. Sends Bambu's clean_print_error MQTT command.
{
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}set_print_speed
Set the active print speed mode. Accepted mode values are silent, standard, sport, ludicrous, or their numeric equivalents 1, 2, 3, and 4.
{
"mode": "sport",
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}set_airduct_mode
Set H2/P2 airduct mode to cooling or heating. This is intended for supported printers only.
{
"mode": "cooling",
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}reread_ams_rfid
Trigger a Bambu AMS RFID re-read for one AMS slot. This can move AMS filament; use it only when the printer is idle and unloaded.
{
"ams_id": 0,
"slot_id": 1,
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}set_temperature
Set a checked target temperature for the bed or nozzle through MQTT. Positive targets require the printer model and fresh matching printer telemetry; nozzle heating also requires the declared loaded material and matching nozzle_diameter (default 0.4). Independent model/component and material ceilings apply. A target of zero turns the heater off without requiring material or nozzle metadata. Accepted component values are bed, nozzle, extruder, tool, and tool0.
Manual nozzle heating checks the reported currently loaded AMS tray or external spool. It refuses ambiguous active-nozzle/material selection on multi-nozzle printers; use a checked sliced job or the printer's own controls there. Stop and heater-off commands cancel pending server print/heating operations. Resuming through MCP requires the same paused job inspected and started by this server instance, with fresh matching telemetry; other paused jobs remain controllable at the printer.
{
"component": "nozzle",
"temperature": 220,
"bambu_model": "p1s",
"material": "PLA",
"nozzle_diameter": 0.4,
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}set_fan_speed
Set a printer fan speed from 0 to 100 percent. Accepted fan values are part, auxiliary, chamber, 1, 2, and 3.
{
"fan": "chamber",
"speed": 40,
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}set_light
Set a printer light node mode. Common Bambu firmware reports the chamber light as chamber_light; valid modes are on, off, and flashing.
{
"light": "chamber_light",
"mode": "on",
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}skip_objects
Skip specific object IDs during a running multi-object print. Use list_3mf_plate_objects on the sliced 3MF to find the IDs first.
{
"object_ids": [6495, 6496],
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}set_ams_drying
Start or stop the AMS filament drying cycle on heated AMS units (AMS Pro / AMS-HT). The action parameter accepts start or stop. The ams_id must be an integer from 0 to 3.
{
"action": "start",
"ams_id": 0,
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token"
}To stop drying:
{
"action": "stop",
"ams_id": 0
}print_3mf
The primary tool for starting a Bambu print. Recommended input: a pre-sliced .gcode.3mf exported from FULU OrcaSlicer-bambulab, OrcaSlicer, or Bambu Studio — see slicing guide. This tool handles the complete workflow:
- Checks whether the 3MF contains embedded G-code (
Metadata/plate_<n>.gcodeentries). - If no G-code is found, attempts to auto-slice via the configured slicer. Profile preparation or slicing failures stop the operation before upload. See the slicing guide for tested CLI versions and combinations.
- Parses the sliced 3MF to extract the correct plate file and compute its MD5 hash.
- Reads slicer metadata and any explicit AMS selection to build the filament mapping.
- Uploads via
basic-ftpto the model-specific location: SD root for H2/full-size A1,cache/for P1/X1/A1 mini/P2S. X2Dprint_3mfinstead uses its checked native eMMC route on macOS. - Sends the correct MQTT print command for the target printer family. For H2S/H2D/H2C that means
project_filewith project-lengthams_mapping, parallelams_mapping2, and H2-compatible calibration flags.
{
"three_mf_path": "/Users/yourname/Downloads/bracket.3mf",
"bambu_model": "p1s",
"bed_type": "textured_plate",
"host": "192.168.1.100",
"bambu_serial": "01P00A123456789",
"bambu_token": "your_access_token",
"bed_leveling": true,
"flow_calibration": true,
"vibration_calibration": true,
"timelapse": false,
"use_ams": true,
"ams_mapping": [0, 1]
}bambu_model is required for model-specific routing and preset selection. It does not by itself validate pre-sliced G-code. BambuStudio, FULU, and Orca CLI preparation additionally require the exact model/nozzle machine preset and reject incomplete profiles. Using the wrong model can damage hardware. If bambu_model is not provided in the tool call and BAMBU_MODEL is not set in the environment, the server will ask you interactively via MCP elicitation (if your client supports it) or return a clear error.
bed_type defaults to textured_plate if omitted. nozzle_type (stainless_steel, hardened_steel, tungsten_carbide, brass; default BAMBU_NOZZLE_TYPE) sets the installed nozzle when the project must be auto-sliced; the job's nozzle type must match the printer's report, and stock P1S/P1P/A1 presets assume stainless steel. After an MQTT print command the server listens to the printer's pushed reports for up to 15 seconds (BAMBU_DISPATCH_CHECK_MS) and returns dispatch: "started" or "unconfirmed"; if firmware 01.08.05+ refuses the command (HMS 0500-0500-0001-0007, needs LAN Only Mode and Developer Mode), the call fails and says so; clear that fatal HMS entry with clear_hms_errors before printing again. ams_slots is the preferred override input; ams_mapping remains the raw escape hatch. On AMS-equipped H2 printers, use_ams: false does not suppress mapping lookup if the sliced file declares filaments. If no mapping is provided for an H2 pre-sliced job with declared filaments, the server fails before sending; pass explicit ams_slots, raw ams_mapping, or auto_match_ams: true.
Set auto_match_ams: true to match the sliced 3MF's tray_info_idx values against the live AMS inventory and use the matching ams_slots. The matcher joins on (tray_info_idx, tray_color) and tracks already-claimed slots, so prints with two filaments of the same SKU but different colors (e.g. two GFG02 PETG HF in black and white) resolve correctly. Falls back to SKU-only when the 3MF's filament has no color set or only one tray of that SKU is loaded. Returns a structured missing report (reason: "no_loaded_match" | "color_mismatch" | "exhausted" | "no_sku") when a filament can't be resolved. Ignored when you provide ams_slots or ams_mapping explicitly.
Layer height, nozzle temperature, and other slicer parameters cannot be overridden via this tool -- they are baked into the 3MF's G-code at slice time. Apply those settings in your slicer before generating the 3MF.
For the optional FULU bridge, set connection_mode: "bambu_network" and explicitly choose connection_type: "cloud" or "lan"; see FULU setup. A successful command submission is not proof that the printer accepted it: inspect printer state, HMS errors, and the printer itself.
bambu_network_bridge_status
Inspect the configured FULU bridge without starting it using {}. Use {"connect": true} to launch the host, handshake, and initialize an agent. See bridge probes for interpreting the result.
bambu_network_call
Call an allowed read-only probe such as {"method": "net.is_user_login", "payload": {}}. The default injects the initialized agent; use with_agent: false for bridge.handshake. Raw printer mutations and unknown methods are refused; use the dedicated checked print or printer tools.
X2D native transport (macOS)
Install Bambu Studio and its networking plug-in, plus the Apple command-line developer tools (clang++). The plug-in is loaded at runtime and is not redistributed. In the installed bambu-printer-mcp package directory, run npm run build:native. For a global install, locate that directory with npm root -g; for an extracted desktop extension, run the same command in the extension directory. Rebuild after updating the package. Linux and Windows can still use status and slicing, but this native helper supports macOS only.
The npm package and desktop bundle include native/bambu-native-print.cpp and scripts/build-bambu-native.zsh, never a developer's compiled binary. The server finds the built helper relative to its installed package, regardless of the launch directory. A trusted server setting BAMBU_NATIVE_HELPER can select an alternate executable.
For X2D, print_3mf defaults to connection_mode: "bambu_native"; legacy lan_mqtt_ftps requests are redirected to it. Supply ams_slots, a complete project-level ams_mapping, or auto_match_ams: true. An external-spool job requires explicit use_ams: false. Raw ams_mapping2 and nozzle/extra-option overrides are rejected before dispatch; the server derives both AMS representations from the checked structured mapping. Model/nozzle/material inspection, fresh printer-state checks, and human preflight apply before the helper receives a private snapshot. The native helper requests fresh shared printer-state authorization immediately before each print submission, including a certificate retry, and before checked heating, resume, or error-clearing commands; custom helpers must support this handshake. Stop and heater-off remain available without preflight. Native upload-only requests use the same all-plate inspection as FTPS uploads. They accept project_name, preset_name, bed_type, and an existing plate_index; AMS, nozzle, and calibration print options are rejected. Use print_3mf for checked print settings.
The helper waits for connection/certificate exchange and retries only the initial -4030 send once. Previous hardware testing reached RUNNING on X2D; this revision is validated with mocked transport regressions and clean installs, not a new physical print. bambu_connect is an optional macOS handoff for user review in Bambu Connect and does not start a print. Native task, heater, and error controls retain the common safety checks; raw controls cannot bypass them. Request cancellation, stop, and heater-off interrupt pending native helpers; the server waits for process exit before releasing a checked file. A command already sent to the printer cannot be recalled by cancelling the request, so verify printer state before retrying.
x2d_native_control
This optional X2D metadata tool accepts ams_filament_setting and extrusion_cali_sel, plus the read-only queries extrusion_cali_get, extrusion_cali_get_result, and flowrate_get_result. It validates command fields, numeric metadata, and AMS unit/slot selection. Motion, filament loading, heating, safety-setting changes, and task control are not exposed through raw JSON; use the dedicated checked tools where available. A metadata declaration does not verify the physical spool contents.
print_3mf_bambu_network
Submit a sliced project through FULU's separately configured networking runtime. connection_type defaults to cloud. Both cloud and LAN bridge jobs require a printer IP, LAN access code, matching serial/device ID, and fresh MQTT safety telemetry. File, raw AMS/nozzle mapping, and extra-option overrides cannot replace checked parameters. See print examples and AMS requirements. A zero bridge return code confirms submission, not a physical print or direct X2D support.
resolve_3mf_ams_slots
Dry-run the AMS match without uploading or starting a print. The tool reads Metadata/plate_<n>.json and Metadata/slice_info.config, then compares required tray_info_idx values against live AMS trays.
{
"three_mf_path": "/Users/yourname/Downloads/bracket.gcode.3mf",
"bambu_model": "h2d",
"host": "192.168.1.100",
"bambu_serial": "094...",
"bambu_token": "your_access_token"
}list_3mf_plate_objects
List object IDs from a sliced 3MF plate. Use this before skip_objects so you pass real Bambu object IDs instead of display-order guesses.
{
"three_mf_path": "/Users/yourname/Downloads/bracket.gcode.3mf",
"plate_index": 0
}print_collar_charm
High-level wrapper for a prepared two-part dog-collar-charm workflow. This tool is intentionally specialized: it expects a prepared two-part charm project and applies a fixed tray policy.
- Smaller inner object -> black -> AMS 1 slot 1
- Larger outer object -> white -> AMS 2 slot 1
The tool will:
- Resolve a local
.3mfortemplate_name. - Auto-slice if the 3MF is still an unsliced project.
- Inspect
Metadata/plate_1.jsonto identify the smaller inner part and larger outer part. - Preflight the required AMS trays on the printer.
- Dispatch the print through the existing H2-safe
print3mfpath usingams_slots.
{
"template_name": "collars/letter_charm_a",
"bambu_model": "h2d",
"host": "192.168.1.100",
"bambu_serial": "03W09C123456789",
"bambu_token": "your_access_token",
"bed_leveling": true,
"flow_calibration": true,
"vibration_calibration": true,
"timelapse": false
}You can also pass source_path directly instead of template_name.
This wrapper currently assumes:
- the input is a prepared two-part charm
.3mf, not a bare STL that needs color-region generation - the selected plate has exactly 2 objects
- the selected plate has exactly 2 used filament positions
- the smaller object is the inner insert/letter and the larger object is the outer body
If the project does not match those assumptions, the tool fails fast with a structured error instead of guessing. The role-to-color and color-to-tray mapping is isolated in code so the next version can evolve toward customer-requested colors without replacing the whole wrapper.