These steps show how to run the MCP 3D printer agent and a chatbot in a Meshagent Room in the cloud. When the Room is closed, all services (tools and chatbot) are automatically removed. Environment variables required:
  • BAMBU_SERIAL: Serial number of your Bambu Lab printer.
  • PRINTER_HOST: Set to REAL.
  • PRINTER_TYPE: Set to bambu.
  • BAMBU_TOKEN: Access token for your Bambu Lab printer.

1. Install Meshagent

pip install "meshagent[all]"

2. Sign Up and Authenticate

Sign up and authenticate following this guide.

3. Start the MCP 3D Printer Agent in a Room

meshagent service test \
  --room=test \
  --role=agent \
  --image=meshagent/mcp-3d-printer:latest \
  --env MESHAGENT_PORT=8001 \
  --env BAMBU_SERIAL=YOUR_BAMBU_SERIAL \
  --env PRINTER_HOST=REAL \
  --env PRINTER_TYPE=bambu \
  --env BAMBU_TOKEN=YOUR_BAMBU_TOKEN \
  --port="num=8001 path=/webhook liveness=/ type=meshagent.callable" \
  --name=mcp-3d-printer-service-test
This command will start a Meshagent Room with the MCP server running inside it. The Room and services are removed automatically if the Room goes inactive.

4. Start the Chatbot in the Meshagent Room

meshagent chatbot join \
  --room=test \
  --agent-name=mcp-3d-printer \
  --name=mcp-3d-printer \
  --toolkit=mcp-3d-printer
  • Starts a chatbot in the specified Room, with access to the full 3D printer toolkit.
  • Multiple toolkits can be registered to the same agent in a Room.
  • You’ll receive a link to open the Room in your browser.

5. Try It Out

Visit the Room link provided in the chatbot output. You can now send messages to the chatbot/agent and interact with the MCP Server tools.

Project Level Deployment

Enable the MCP Server and a chatbot in all Rooms of your Meshagent project automatically. Ideal for production or persistent collaborative scenarios—eliminates the need for running local servers or starting up bots each time.

1. Deploy Persistent MCP 3D Printer Agent

meshagent service create \
  --role=agent \
  --image=meshagent/mcp-3d-printer:latest \
  --env MESHAGENT_PORT=8001 \
  --env BAMBU_SERIAL=YOUR_BAMBU_SERIAL \
  --env PRINTER_HOST=REAL \
  --env PRINTER_TYPE=bambu \
  --env BAMBU_TOKEN=YOUR_BAMBU_TOKEN \
  --port="num=8001 path=/webhook liveness=/ type=meshagent.callable" \
  --name=mcp-3d-printer-service

2. Deploy Persistent MCP Chatbot

meshagent service create \
  --image="meshagent/cli:latest" \
  --port="num=9001 path=/agent liveness=/ type=meshagent.callable participant_name=mcp-3d-printer-chatbot" \
  --env="MESHAGENT_PORT=9001" \
  --name="mcp-3d-printer-chatbot-service" \
  --command="meshagent chatbot service --agent-name=mcp-3d-printer-chatbot --toolkit=mcp-3d-printer"
Rooms created in this project will always have the MCP tools and chatbot ready to use.

Tools Available

Advanced 3D printer operations accessible via Meshagent and MCP chat workflows:

Summary

Tools provided by this ServerShort Description
center_modelTranslate the model so its geometric center is at the origin (0,0,0).
confirm_temperaturesConfirm temperature settings in a G-code file.
extend_stl_baseExtend the base of an STL file by a specified amount.
generate_stl_visualizationGenerate an SVG visualization of an STL file from multiple angles.
get_printer_statusGet the current status of the 3D printer.
get_stl_infoGet detailed information about an STL file.
lay_flatRotate the model so its largest flat face lies on the XY plane.
merge_verticesMerge vertices in an STL file within a given tolerance.
modify_stl_sectionApply a specific transformation to a section of an STL file.
print_3mfPrint a 3MF file on a Bambu Lab printer.
process_and_print_stlProcess an STL file, slice it, confirm temps, and print.
rotate_stlRotate an STL model around specific axes.
scale_stlScale an STL model.
slice_stlSlice an STL file to generate G-code.
translate_stlMove an STL model.

Tool Details


center_model

Translate the model so its geometric center is at the origin (0,0,0).
ParameterTypeDescription
stl_pathstringPath to the STL file

confirm_temperatures

Confirm temperature settings in a G-code file.
ParameterTypeDescription
gcode_pathstringPath to the G-code file
bed_tempnumber(Optional) Expected bed temp
extruder_tempnumber(Optional) Expected extruder temp

extend_stl_base

Extend the base of an STL file by a specified amount.
ParameterTypeDescription
extension_inchesnumberAmount to extend (inches)
stl_pathstringPath to the STL file

generate_stl_visualization

Generate an SVG visualization of an STL file from multiple angles.
ParameterTypeDescription
stl_pathstringPath to the STL file
heightnumber(Optional) Height in pixels
widthnumber(Optional) Width in pixels

get_printer_status

Get the current status of the 3D printer.
ParameterTypeDescription
api_keystring(Optional) API key
bambu_serialstring(Optional) Printer serial
bambu_tokenstring(Optional) Access token
hoststring(Optional) Printer host
portstring(Optional) Printer port
typestring(Optional) Printer system type

get_stl_info

Get detailed information about an STL file.
ParameterTypeDescription
stl_pathstringPath to the STL file

lay_flat

Rotate the model so its largest flat face lies on the XY plane.
ParameterTypeDescription
stl_pathstringPath to the STL file

merge_vertices

Merge vertices in an STL file that are closer than the specified tolerance.
ParameterTypeDescription
stl_pathstringPath to the STL file
tolerancenumber(Optional) Distance, in mm

modify_stl_section

Apply a specific transformation to a selected section of an STL file.
ParameterTypeDescription
sectionstringSection to modify
stl_pathstringPath to the STL file
transformation_typestringType of transformation
custom_max_x/y/znumber(Optional) Custom max bounds
custom_min_x/y/znumber(Optional) Custom min bounds
value_x/y/znumber(Optional) Transformation axes

Print a 3MF file on a Bambu Lab printer.
ParameterTypeDescription
three_mf_pathstringPath to the 3MF file
ams_mappingobject(Optional) AMS mapping
bambu_serialstring(Optional) Printer serial
bambu_tokenstring(Optional) Access token
bed_temperaturenumber(Optional) Bed temp (°C)
hoststring(Optional) Printer host
layer_heightnumber(Optional) Layer height (mm)
nozzle_temperaturenumber(Optional) Nozzle temp (°C)
support_enabledboolean(Optional) Enable supports

process_and_print_stl

Process an STL file (extend base), slice, confirm temps, print.
ParameterTypeDescription
extension_inchesnumberAmount to extend the base
stl_pathstringPath to the STL file
api_keystring(Optional) API key
bed_tempnumber(Optional) Bed temp
extruder_tempnumber(Optional) Extruder temp
hoststring(Optional) Printer host
portstring(Optional) Printer port
typestring(Optional) Printer type

rotate_stl

Rotate an STL model around specific axes.
ParameterTypeDescription
stl_pathstringPath to the STL file
rotate_x/y/znumber(Optional) Rotation angles

scale_stl

Scale an STL model.
ParameterTypeDescription
stl_pathstringPath to the STL file
scale_factornumber(Optional) Uniform scaling
scale_x/y/znumber(Optional) Axis scaling

slice_stl

Slice an STL file to generate G-code.
ParameterTypeDescription
stl_pathstringPath to the STL file
slicer_pathstring(Optional) Slicer executable
slicer_profilestring(Optional) Slicer profile
slicer_typestring(Optional) Slicer type

translate_stl

Move an STL model.
ParameterTypeDescription
stl_pathstringPath to the STL file
translate_x/y/znumber(Optional) Offsets