Formlabs print preparation
You orchestrate the formlabs MCP server to take a user from raw STL/OBJ files
to a printable .form file or a queued print job.
Precondition (always)
First action: call health_check. If it errors:
If health_check returns a version, proceed.
Required inputs
Confirm before you start:
- Model file(s) — must be absolute paths (PreFormServer rejects
relative paths, env vars, and URLs). If the user gives a relative path,
resolve it against the current working directory and confirm.
- Printer + material — either:
machine_type + material_code + layer_thickness_mm. If the user
names a printer but not a material, call list_printer_types to
confirm the code, then list_materials and pick the matching material's
first material_settings entry.
- or an
.fps print-settings file the user already has.
- Destination — save to a
.form file, or send to a printer? If sending
to a printer, get the printer serial or local IP, and a job name.
If any of these are missing, ask once with all the unknowns batched into a
single question. Do not interrogate the user step by step.
Standard workflow
create_scene with the printer + material settings.
- For each model:
import_model with the absolute path. The MCP server defaults
repair_behavior="REPAIR" and units="MILLIMETERS" — that's correct for
~all CAD-exported STLs. Only override if the user explicitly mentions
non-mm units or insists on preserving an unrepaired mesh. Collect the
returned model IDs from the responses.
auto_orient (defaults to models: "ALL").
auto_support. For dental / jewelry / very small parts the user may want
higher density — only set it if the user mentions it.
- Printer-type branch:
- SLA printers (anything starting with
FORM-): auto_layout.
- SLS printers (anything starting with
FS): auto_pack.
The server will error if you call the wrong one. If unsure, check the
machine_type on the scene first.
get_print_validation. If there are errors, surface them and stop.
If there are warnings, surface them and ask whether to continue.
- Auto drain holes (SLA only). After
auto_support, call
auto_add_drain_holes. It checks get_print_validation for cups per model
and places holes using bounding-box sampling plus PreForm's own surface
projection — no XYZ prompts to the user. Surface the per-model summary
(cups_detected, holes_requested, warnings). If PreForm reports a
"no surface found" warning for a model, tell the user that auto-placement
couldn't find a spot and offer either to skip drain holes or to hand-place
them via add_drain_holes.
estimate_print_time. Report time and material usage to the user.
- Confirm with the user before the final destructive step (saving over an
existing file, or sending a print).
- Either
save_form (with absolute path) or print_to_printer. For remote
printing the user must have been login'd already — surface the error
clearly if not.
- Optionally
save_screenshot to a .png next to the .form so the user
has a preview.
Things to do and things to avoid
- Do report progress between major steps.
auto_support on a complex
model can take a minute or two.
- Do show the printer's
machine_type and material_code on confirmation
— the single most common source of user error.
- Do trust the post-import verification baked into
import_model. If it
raises IMPORT_PRODUCED_EMPTY_SCENE, the STL really is malformed; tell the
user and stop. Don't loop retries.
- Don't call
auto_layout for SLS printers or auto_pack for SLA
printers; the server will error.
- Don't silently overwrite a
.form file the user didn't name explicitly.
- Don't invent
machine_type or material_code values. If unsure, call
list_materials and pick from real values.
- Don't retry a
print_to_printer call after a 4xx — the printer probably
isn't reachable. Ask the user to check.
- Don't use TaskCreate for this flow. It's a short linear pipeline; task
tracking is overhead.
Examples
Single part, save to file
"Prep ~/parts/bracket.stl for the Form 4 in Black V5 and save it as
~/jobs/bracket.form."
Resolve paths → health_check → create_scene(FORM-4-0, FLGPBK05, 0.025) →
import_model → auto_orient → auto_support → auto_layout →
get_print_validation → check cups → estimate_print_time → report
time/material → save_form.
Multiple parts, send to printer
"Pack these five parts onto my Fuse 1+ and send to printer Fuse-Loud-Otter."
health_check → create_scene(FS30-1-0, …) → loop import_model →
auto_orient → auto_support → auto_pack → validate → estimate → confirm
→ print_to_printer.
1---2name: formlabs-print3description: End-to-end Formlabs print job preparation. Takes one or more STL/OBJ files, sets up a scene for a specific printer + material, auto-orients, generates supports, estimates time and material, and either saves a .form file or uploads the job to a printer. Use when the user wants to prepare or run a Formlabs print from natural language.4---56# Formlabs print preparation78You orchestrate the `formlabs` MCP server to take a user from raw STL/OBJ files9to a printable `.form` file or a queued print job.1011## Precondition (always)1213**First action: call `health_check`.** If it errors:14- The `formlabs` MCP server is not installed or PreFormServer failed to start.15- Surface the error to the user, link them to https://github.com/mkebiclioglu/formlabs-local-mcp,16 and STOP. Don't attempt the workflow.1718If `health_check` returns a version, proceed.1920## Required inputs2122Confirm before you start:231. **Model file(s)** — must be **absolute** paths (PreFormServer rejects24 relative paths, env vars, and URLs). If the user gives a relative path,25 resolve it against the current working directory and confirm.262. **Printer + material** — either:27 - `machine_type` + `material_code` + `layer_thickness_mm`. If the user28 names a printer but not a material, call `list_printer_types` to29 confirm the code, then `list_materials` and pick the matching material's30 first `material_settings` entry.31 - or an `.fps` print-settings file the user already has.323. **Destination** — save to a `.form` file, or send to a printer? If sending33 to a printer, get the printer serial or local IP, and a job name.3435If any of these are missing, ask **once** with all the unknowns batched into a36single question. Do not interrogate the user step by step.3738## Standard workflow39401. `create_scene` with the printer + material settings.412. For each model: `import_model` with the absolute path. The MCP server defaults42 `repair_behavior="REPAIR"` and `units="MILLIMETERS"` — that's correct for43 ~all CAD-exported STLs. Only override if the user explicitly mentions44 non-mm units or insists on preserving an unrepaired mesh. Collect the45 returned model IDs from the responses.463. `auto_orient` (defaults to `models: "ALL"`).474. `auto_support`. For dental / jewelry / very small parts the user may want48 higher `density` — only set it if the user mentions it.495. **Printer-type branch:**50 - **SLA** printers (anything starting with `FORM-`): `auto_layout`.51 - **SLS** printers (anything starting with `FS`): `auto_pack`.52 The server will error if you call the wrong one. If unsure, check the53 `machine_type` on the scene first.546. `get_print_validation`. If there are errors, surface them and stop.55 If there are warnings, surface them and ask whether to continue.567. **Auto drain holes (SLA only).** After `auto_support`, call57 `auto_add_drain_holes`. It checks `get_print_validation` for cups per model58 and places holes using bounding-box sampling plus PreForm's own surface59 projection — no XYZ prompts to the user. Surface the per-model summary60 (`cups_detected`, `holes_requested`, warnings). If PreForm reports a61 "no surface found" warning for a model, tell the user that auto-placement62 couldn't find a spot and offer either to skip drain holes or to hand-place63 them via `add_drain_holes`.648. `estimate_print_time`. Report time and material usage to the user.659. Confirm with the user before the final destructive step (saving over an66 existing file, or sending a print).6710. Either `save_form` (with absolute path) or `print_to_printer`. For remote68 printing the user must have been `login`'d already — surface the error69 clearly if not.7011. Optionally `save_screenshot` to a `.png` next to the `.form` so the user71 has a preview.7273## Things to do and things to avoid7475- **Do** report progress between major steps. `auto_support` on a complex76 model can take a minute or two.77- **Do** show the printer's `machine_type` and `material_code` on confirmation78 — the single most common source of user error.79- **Do** trust the post-import verification baked into `import_model`. If it80 raises `IMPORT_PRODUCED_EMPTY_SCENE`, the STL really is malformed; tell the81 user and stop. Don't loop retries.82- **Don't** call `auto_layout` for SLS printers or `auto_pack` for SLA83 printers; the server will error.84- **Don't** silently overwrite a `.form` file the user didn't name explicitly.85- **Don't** invent `machine_type` or `material_code` values. If unsure, call86 `list_materials` and pick from real values.87- **Don't** retry a `print_to_printer` call after a 4xx — the printer probably88 isn't reachable. Ask the user to check.89- **Don't** use TaskCreate for this flow. It's a short linear pipeline; task90 tracking is overhead.9192## Examples9394### Single part, save to file95> "Prep `~/parts/bracket.stl` for the Form 4 in Black V5 and save it as96> `~/jobs/bracket.form`."9798Resolve paths → `health_check` → `create_scene(FORM-4-0, FLGPBK05, 0.025)` →99`import_model` → `auto_orient` → `auto_support` → `auto_layout` →100`get_print_validation` → check cups → `estimate_print_time` → report101time/material → `save_form`.102103### Multiple parts, send to printer104> "Pack these five parts onto my Fuse 1+ and send to printer Fuse-Loud-Otter."105106`health_check` → `create_scene(FS30-1-0, …)` → loop `import_model` →107`auto_orient` → `auto_support` → `auto_pack` → validate → estimate → confirm108→ `print_to_printer`.