Print3D

v0.3.0
io.github.ThinkArtWork/print3d Checked 4 days ago Published 6 hours ago

Self-hosted 3D printing MCP server: CAD, mesh generation, slicing, and printer control.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

capabilities

Report what this Print3D installation can do right now: cloud image-to-3D providers (key present or not), CAD/render backends, slicer profiles and printers, plus the adapters compiled in. Never returns API keys and never writes files.

system_status

Report Print3D version, Python/platform, workspace paths, config/secrets presence and job counters. Read-only: writes_performed is always false.

reference_import

Import an image the user already has (a sketch, a photo, a screenshot) into the workspace as a concept reference, so it can be attached to a model revision with model_write(reference=...). This is the image-input half of the text/image -> model path: the client model looks at the image and writes the script; Print3D keeps the image as provenance. WRITES files: confirm must be exactly 'IMPORT <name>'.

ParameterTypeDescription
confirm *string
name *string
path *string

image_generate

Generate a concept image from a text prompt and store it as a reference in the workspace (references/<id>/). This is step one of the text -> image -> model path: pass the returned image_path to model_write as `reference`, then build and preview the model. Any OpenAI-compatible images endpoint works (config.images.<id>). WRITES files and calls a paid service: confirm must be exactly 'IMAGE <name>'. The image is also returned inline so you can see it.

ParameterTypeDescription
confirm *string
name *string
prompt *string
providerstring
sizestring

model_write

Store a build123d script as a new asset revision, without calling any LLM. The script must follow Print3D's contract (from build123d import *, a build_part() returning one solid, PARAMS in mm, base on z=0) and passes the static safety checks; nothing is executed here. Use asset_id to append to an existing asset, or name to create one. Optional `reference` attaches a concept image (the image_path returned by image_generate) to this revision so the model has a visual record of the request. Optional `spec` (or `spec_path` to a workspace JSON file) stores a task profile and named dimensions with t…

ParameterTypeDescription
confirm *string
script *string
asset_idstring
maskstring
namestring
promptstring
referencestring
spec
spec_pathstring

model_build

Execute a stored asset revision in Print3D's sandboxed build123d interpreter (CPU/time/file limits, no API keys in the environment) and attach the result to that revision. Returns real geometry checks (watertight, boundary/non-manifold edges, bbox, volume) and stores model.stl/model.step plus a self-contained interactive viewer.html. Pass `input` with a .step/.stp path to import an existing part: the file is copied into the revision as input.step and its absolute path is exposed to the script as the module global INPUT_STEP, so a script can do `part = import_step(INPUT_STEP)` and edit or re-va…

ParameterTypeDescription
asset_id *string
confirm *string
inputstring
revisionstring

model_drawing

Project a built revision's model.step into an engineering drawing: one sheet with front, top, right, iso views laid out third-angle, dashed hidden lines (orthographic views) and view labels, written as drawing.svg and drawing.dxf inside the revision. Use it after model_build when a printed sheet is wanted, or to hand the part to someone without a slicer. Returns the sheet size and per-view edge counts; export the files with asset_export(artifact='svg' or 'dxf'). WRITES files: confirm must be exactly 'DRAWING <asset_id>'.

ParameterTypeDescription
asset_id *string
confirm *string
hiddenboolean
revisionstring
scalenumber
viewsstring

model_preview

Render a built revision's model.stl to a PNG with labelled orthographic views (iso/front/top/right by default) and return it inline, together with the concept reference when the revision has one. Use this after model_build to see the real geometry and compare it with the request; then fix the script and call model_write/model_build again. Read-only for assets: the PNG is cached under cache/previews/ and nothing in the revision changes.

ParameterTypeDescription
asset_id *string
heightinteger
revisionstring
viewsstring
widthinteger

model_view

Write one self-contained interactive 3D viewer (HTML, orbit / pan / zoom, no server or CDN) per asset. The file embeds every built revision and has a revision dropdown, so only one file is ever handed to the user. Open it in a browser or pass it to `present`. WRITES one file in the asset directory: confirm must be exactly 'VIEW <asset_id>'.

ParameterTypeDescription
asset_id *string
confirm *string
revisionstring

blender_run

Turn a bpy Python script into a printable mesh by running Blender in background mode (blender -b --factory-startup --python scene.py), then exporting every mesh object to model.stl + model.glb, writing an interactive viewer.html and inspecting it. This is the Blender path for text-to-3D: the client model writes the scene (primitive_*, bmesh, solidify, remesh, ...); for image-to-3D it looks at the attached image itself and the script can read the same file from sys.argv after '--'. Pass asset_id to append a new revision to an existing Blender asset. WRITES files and executes code in Blender: co…

ParameterTypeDescription
confirm *string
script *string
asset_idstring
blender_pathstring
imagestring
namestring
timeout_sinteger

mesh_fit

Fit an existing STL/GLB/OBJ mesh to a real millimetre size and turn it into a versioned Print3D asset. This is the finishing step for image-to-3D: keep the generated shape, repair it, scale it, seat it on z=0, centre it, decimate to a preview-friendly triangle budget, then export STL/GLB and a named viewer. Sizing is explicit: pass size_mm=[x,y,z] for an exact envelope (non-uniform scale), or max_dimension_mm=<longest side> to scale uniformly and preserve the image proportions. Pass source= for a file path, or asset_id= (plus optional revision=) to use an asset's stored model.stl. WRITES files…

ParameterTypeDescription
confirm *string
name *string
asset_idstring
blender_pathstring
imagestring
max_dimension_mmnumber
max_trianglesinteger
revisionstring
size_mm
sourcestring
timeout_sinteger

generate_cloud

Generate a 3D model with a cloud provider (tripo, hunyuan_openai or hunyuan TC3) in the background. Configure it in providers.cloud.<id> (adapter, key env, scale, timeout). Print3D submits the task, polls it, downloads the result, converts it to STL, records real geometry checks and stores a versioned asset. Pass optional size_mm=[x,y,z] or max_dimension_mm=<longest side> to run the same mesh fit after generation; the raw mesh is kept as source.stl. Returns a job_id: poll job_status until succeeded, then call model_preview. WRITES files and spends provider credits: confirm must be exactly 'CLO…

ParameterTypeDescription
confirm *string
name *string
provider *string
imagestring
max_dimension_mmnumber
max_trianglesinteger
promptstring
size_mm
timeout_sinteger

generate_local

Run a user-installed local 3D generator in the background. The provider is configured in providers.local.<id> as a command + args template with {prompt}, {image}, {outdir}, {name} placeholders; it must write <outdir>/mesh.stl (or print {"mesh": path}). Print3D creates the asset from the produced STL, records real geometry checks and returns a job_id: poll job_status until succeeded, then call model_preview. No weights are downloaded and no cloud API is called. WRITES files and runs the provider command: confirm must be exactly 'LOCAL <name>'.

ParameterTypeDescription
confirm *string
name *string
provider *string
imagestring
promptstring
timeout_sinteger

printability_check

Read-only geometric printability report for a built revision: watertightness, boundary/non-manifold edges, overhang area, estimated support volume, bed contact, thin-wall estimate, bed fit, a 0-100 score and actionable issues. Pass target to include its bed size.

ParameterTypeDescription
asset_id *string
revisionstring
targetstring

orientation_plan

Read-only build-orientation ranking: evaluates 24 axis-aligned rotations (6 down axes x 4 spins), compares overhang area, estimated support volume, height and bed contact, and returns the best rotations with metrics.

ParameterTypeDescription
asset_id *string
limitinteger
revisionstring
targetstring

model_validate

Read-only named-dimension validation for a built revision. The revision may carry a spec (written by model_write) or receive one inline. Measures the real STL, compares bbox_x/bbox_y/bbox_z/bbox_max/bbox_min/volume_cm3 with declared nominal values and tolerances, and reports pass/fail/warn/needs_evidence per dimension. Only measured/user sources can block; listing/assumed values are advisory. This is not a hole, wall-thickness or assembly-fit check, and it does not make a model printable by itself.

ParameterTypeDescription
asset_id *string
revisionstring
spec
spec_pathstring

model_likeness

Read-only advisory 2D silhouette comparison for one declared view. Uses a reference mask (stored on the revision or passed as a workspace path), renders the built STL in that orthographic view and returns IoU plus an overlay PNG. With mm_per_px it preserves physical scale; without it the result is explicitly shape-only. better_pose is a diagnostic (90° rotations and mirror). Likeness is view-level evidence, not 3D truth, and never blocks slicing automatically.

ParameterTypeDescription
asset_id *string
imagestring
maskstring
mm_per_pxnumber
revisionstring
viewstring

slice_capabilities

Report the configured print targets, whether an OrcaSlicer-compatible binary is installed, and whether each target's machine/process/filament presets resolve. Read-only.

slice_plan

Dry-run a slice: resolve the target presets, report bed size and model checks, preview process/material options (material, layer_height, infill, infill_density, walls, top_shells, bottom_shells, strength, bed_temp, nozzle_temp, build_plate, flow_ratio, pressure_advance, line_width, outer_wall_line_width, inner_wall_line_width, top_surface_line_width, arc_fitting, fan_speed, aux_fan_speed, fan_first_layers), optionally pinned to a printer filament slot (printer + slot: multi-tool or AMS). Read-only: it reports the overrides and the slot material that slice_run would use.

ParameterTypeDescription
asset_id *string
target *string
arc_fittingboolean
aux_fan_speedinteger
bed_tempinteger
bottom_shellsinteger
build_platestring
fan_first_layersinteger
fan_speedinteger
flow_rationumber
infillstring
infill_densitynumber
inner_wall_line_widthnumber
layer_heightnumber
line_widthnumber
materialstring
nozzle_tempinteger
outer_wall_line_widthnumber
pressure_advancenumber
printerstring
revisionstring
slotinteger
strengthstring
top_shellsinteger
top_surface_line_widthnumber
wallsinteger

slice_run

Slice a built revision for a configured target with the external OrcaSlicer CLI, optionally with process/material options (material implies nozzle/bed temperatures; layer_height, infill, infill_density, walls, top_shells, bottom_shells, strength override the process preset; flow_ratio and pressure_advance override the filament flow/PA; line_width / outer_wall_line_width / inner_wall_line_width / top_surface_line_width override extrusion widths; arc_fitting emits G2/G3 arcs for rounder holes; fan_speed / aux_fan_speed / fan_first_layers control part and auxiliary cooling; build_plate picks the…

ParameterTypeDescription
asset_id *string
confirm *string
target *string
arc_fittingboolean
aux_fan_speedinteger
bed_tempinteger
bottom_shellsinteger
build_platestring
fan_first_layersinteger
fan_speedinteger
flow_rationumber
infillstring
infill_densitynumber
inner_wall_line_widthnumber
layer_heightnumber
line_widthnumber
materialstring
nozzle_tempinteger
outer_wall_line_widthnumber
pressure_advancenumber
printerstring
revisionstring
slotinteger
strengthstring
timeout_snumber
top_shellsinteger
top_surface_line_widthnumber
wallsinteger

slice_inspect

Read a stored slice record, its statistics, process/material options and G-code path. Read-only.

ParameterTypeDescription
slice_id *string

printer_list

List configured printers with adapter, model, address, toolheads, filament slots (material/colour) and whether an API key is available. Read-only (no network probe).

printer_probe_slots

Ask the printer which filament is loaded in each toolhead/slot (vendor, material, colour, whether a spool is present) and return it in the exact shape printers[].slots expects, plus the printer_save arguments to apply it. Read-only: nothing is written to config.json. Moonraker/Klipper printers report this; other adapters raise an adapter_unavailable error.

ParameterTypeDescription
printer_id *string

printer_status

Query one printer's live state (state, filename, progress, temperatures), configured build plate and any printer-stored flow calibration factors, through its adapter. Read-only.

ParameterTypeDescription
printer_id *string

printer_save

Add or update a printer in config.json (upsert). slots is a list of {material, color, name?, toolhead?} entries in G-code tool order (T0 first); single-nozzle AMS machines use one slot per AMS slot. build_plates restricts the plate ids this printer accepts; plate_keys lists JSON fields to auto-detect the plate; flow_calibration configures vendor calibration G-code / factors URL. WRITES the config: confirm must be exactly 'SAVE PRINTER <printer_id>'. Adapters: moonraker, octoprint, bambu_lan, prusalink, http.

ParameterTypeDescription
confirm *string
printer_id *string
access_code_envstring
adapterstring
api_key_envstring
base_urlstring
build_platestring
build_plates
enabledboolean
flow_calibration
http
modelstring
password_envstring
plate_keys
serialstring
slots
storagestring
toolheadsinteger
usernamestring

printer_remove

Remove a printer from config.json. WRITES the config: confirm must be exactly 'REMOVE PRINTER <printer_id>'.

ParameterTypeDescription
confirm *string
printer_id *string

send

Upload a successful slice's G-code to a printer and, by default, start the print. The printer must be idle and its model must match the slice target. flow_calibrate=True asks a Moonraker printer to run its own flow/pressure-advance calibration at print start (SET_PRINT_PREFERENCES FLOW_CALIBRATE=1). confirm must be exactly 'PRINT <printer_id> <slice_id>'. Runs as an async job (poll job_status).

ParameterTypeDescription
confirm *string
printer_id *string
slice_id *string
flow_calibrateboolean
startboolean

printer_cancel

Cancel the current print on a printer. WRITES to the printer: confirm must be exactly 'CANCEL PRINT <printer_id>'.

ParameterTypeDescription
confirm *string
printer_id *string

asset_export

Copy a built artifact to a workspace path the user can open. artifact is 'stl', 'step', 'script', 'svg' or 'dxf' (the last two come from model_drawing). Defaults to the workspace exports/ directory; out_path must resolve inside the workspace. WRITES the destination file: confirm must be exactly 'EXPORT <asset_id>'.

ParameterTypeDescription
asset_id *string
confirm *string
artifactstring
out_pathstring
revisionstring

model_show

Return one asset's manifest, its revision history (prompt, model, geometry summary, STEP input, drawing files, viewer availability) and the source of a stored revision (latest by default), so a client model can read, explain, compare or repair it. Read-only.

ParameterTypeDescription
asset_id *string
revisionstring

asset_list

List generated model assets with their revision counts. Read-only.

ParameterTypeDescription
limitinteger

job_status

Look up one asynchronous job by id (j_<timestamp>_<hex>). Returns state, progress, timestamps, result and artifacts. Read-only.

ParameterTypeDescription
job_id *string