Skip to content

AMS (Automatic Material System) Setup ​

The Bambu AMS is a multi-spool feeder that lets you assign different filaments to different parts of a multi-color or multi-material print. This section explains how AMS slot mapping works with this MCP server.

How AMS slots work ​

The AMS has 4 slots per unit, numbered 0 through 3. If you have multiple AMS units chained together, the second unit's slots are 4 through 7, and so on. When you slice a model in Bambu Studio or OrcaSlicer, each color/material in the print is assigned to a specific AMS slot.

Automatic AMS mapping from the 3MF ​

When you slice a model in Bambu Studio, the slicer embeds AMS mapping information inside the 3MF file at Metadata/project_settings.config. The print_3mf tool reads this file automatically and extracts the correct mapping. In most cases, you do not need to specify ams_mapping manually -- the tool handles it.

Manual AMS mapping ​

If you need to override the embedded mapping (for example, you swapped filament positions since slicing), pass the ams_mapping array to print_3mf:

json
{
  "three_mf_path": "/path/to/model.3mf",
  "ams_mapping": [0, 2],
  "use_ams": true
}

Each element in the array corresponds to a filament slot used in the print file, in the order they appear in the slicer. The value is the physical AMS slot number (0-based) where that filament is currently loaded. In the example above, the first filament in the print uses AMS slot 0, and the second uses AMS slot 2.

Mapping is positional: each entry corresponds to a project filament, and -1 means unused. H2/P2S project-file commands use project-length mapping plus a parallel ams_mapping2; other project-file routes retain at least five positions without truncating longer projects. Prefer ams_slots in plate filament order or auto_match_ams: true when you do not already have the full project mapping.

Single-material prints ​

For a single-material plate, explicitly select its loaded tray. For example, use AMS slot 2:

json
{
  "three_mf_path": "/path/to/model.3mf",
  "ams_slots": [2]
}

This expands slot 2 into the correct project filament position. There is no universal fixed default mapping for every model and project.

Printing without AMS ​

If you are using the direct-feed spool holder (no AMS attached) or want to bypass the AMS entirely, set use_ams to false:

json
{
  "three_mf_path": "/path/to/model.3mf",
  "use_ams": false
}

For H2 projects with declared filaments, also provide the required mapping; use_ams: false alone does not remove the firmware's mapping requirement. See print_3mf.

Auto-match AMS by RFID ​

For pre-sliced 3MFs that declare filament types, the auto_match_ams flag on print_3mf (or the standalone resolve_3mf_ams_slots dry-run tool) automatically resolves the required filaments against your live AMS inventory. The matcher works as follows:

  1. Reads the required tray_info_idx values from the 3MF's Metadata/slice_info.config and Metadata/plate_<n>.json
  2. Reads your live AMS trays from the printer's MQTT status push
  3. Matches on (tray_info_idx, tray_color) — so two filaments of the same SKU but different colors (e.g. two GFG02 PETG HF spools in black and white) resolve to different slots
  4. Tracks already-claimed slots so two requirements can't collapse onto the same physical position
  5. Falls back to SKU-only matching when the 3MF carries no color data or only one tray of that SKU is loaded

If resolution fails, returns a structured missing report with per-requirement reasons:

  • no_loaded_match — no AMS tray of that SKU is loaded
  • color_mismatch — the SKU matches but the loaded color differs
  • exhausted — all matching trays are already claimed by other requirements
  • no_sku — the 3MF doesn't declare a tray_info_idx for this filament

Dry-run with resolve_3mf_ams_slots before printing to preview the match without uploading or starting a job.

AMS settle-time handling ​

The first MQTT status push from an idle printer is often sparse (model/module info only) — AMS slot data arrives on a second push. The server's filament inventory and HMS handlers both retry after a 1.5-second settle window when the expected data isn't present in the first response. This is transparent to the caller.

Checking AMS status ​

Use get_printer_filaments for the parsed, enriched view (profile paths, display names, match confidence) or get_printer_status for the raw AMS data from the printer:

"What filaments are loaded in my AMS right now?"

Released under the GPL-2.0 license. An independent open-source project, not affiliated with Bambu Lab.