bambu-gateway-mcp
by leolobato
README.md
# bambu-gateway-mcp
An MCP server that exposes the [bambu-gateway](https://github.com/leolobato/bambu-gateway) print-session HTTP API to an LLM agent, enabling agent-driven Bambu Lab 3D printer control.
## Setup
```bash
pip install -e .
cp .env.example .env
# Edit .env and set GATEWAY_BASE_URL to your bambu-gateway instance
```
## Configuration
| Variable | Default | Description |
|---|---|---|
| `GATEWAY_BASE_URL` | — | URL of the bambu-gateway instance, e.g. `http://10.0.1.9:4844` |
| `REQUIRE_PRINT_CONFIRMATION` | `true` | Whether `start_print` asks for confirmation via elicitation. Set `false` for clients that don't support elicitation (prints directly). |
## Running
```bash
bambu-gateway-mcp
```
The server listens on stdio and is ready for an MCP client (Claude Code, Cursor, etc.) to connect.
## Tools
The MCP server exposes the following tools:
- **`list_printers`** — List configured printers (id, name, machine, online status)
- **`get_ams(printer_id)`** — Get AMS tray/filament state for filament selection
- **`set_ams_filament(printer_id, ams_id, tray_id, setting_id, tray_color="")`** — Assign a slicer filament profile to one AMS tray (`tray_id` is the per-AMS slot 0..3; `ams_id=255`/`tray_id=254` for the external spool)
- **`list_filaments`** — Available slicer filament profiles
- **`list_processes`** — Available slicer process profiles
- **`create_print_session(model_path, printer_id, ...)`** — Configure a print from a local 3MF/STL file. Returns `job_id`, `sliced` status, and `handoff_url` to review/tweak in the browser.
- **`get_print_session(session_id)`** — Poll session status and `handoff_url`
- **`start_print(session_id)`** — Start printing a configured, sliced session (elicitation-gated — asks for approval first)
## Typical Flow
1. Call `list_printers` to pick a target printer
2. Call `get_ams(printer_id)` to see filament availability
3. Call `create_print_session(model_path, printer_id, ...)` with your 3MF/STL and desired profiles
4. Share the returned `handoff_url` with the user to review/adjust in the browser
5. Once ready, call `start_print(session_id)` — the server asks for confirmation before printing
## Safety
**`start_print` asks for explicit user approval in the conversation by default.** No print starts silently; the tool prompts for elicitation and only proceeds if the user confirms. Clients that don't support elicitation fail safe (no print).
If your client can't elicit, set `REQUIRE_PRINT_CONFIRMATION=false` to let `start_print` print directly (the not-sliced guard still applies). Only do this when you trust the agent driving the printer.
TDQS
A3.7/5.0
Scored across 7 tools
Disambiguation5/5
Each tool has a clearly distinct purpose: creating sessions, retrieving status, listing resources, and starting prints. No overlap in functionality.
Naming Consistency5/5
All tools follow a consistent verb_noun snake_case pattern (e.g., create_print_session, list_printers) with no deviations.
Tool Count5/5
Seven tools is well-scoped for a 3D printing gateway, covering printer listing, profile selection, session creation, status, and starting prints.
Completeness4/5
Core workflow is covered (list, configure, start), but missing cancel/delete operations for sessions or prints, and no error recovery tools.
Maintenance
ActivityInactive
ResponsivenessNo issues