home / mcp / mcp 3d printer server
Connects MCP to major 3D printer APIs (Orca, Bambu, OctoPrint, Klipper, Duet, Repetier, Prusa, Creality). Control prints, monitor status, and perform advanced STL operations like scaling, rotation, sectional editing, and base extension. Includes slicing and visualization.
Configuration
View docs{
"mcpServers": {
"dmontgomery40-mcp-3d-printer-server": {
"command": "mcp-3d-printer-server",
"args": [],
"env": {
"API_KEY": "your_api_key_here",
"PRINTER_HOST": "localhost",
"PRINTER_TYPE": "octoprint"
}
}
}
}You run a unified MCP server that lets Claude interact with multiple 3D printer management systems. This server exposes printer control, file operations, and advanced STL manipulation across OctoPrint, Klipper, Duet, Repetier, Bambu Labs, Prusa Connect, and Creality Cloud through a single MCP interface. It streamlines starting prints, uploading files, slicing, and previewing STL data while offering Bambu-specific features via MQTT and presets.
You connect your MCP client to the server using the inline command interface described in your MCP configuration. Start by defining a server entry that runs the MCP server locally and passes authentication and printer details via environment variables. With this setup you can: upload G-code to printers, start and cancel prints, read printer status, manage temperatures, and perform STL manipulations before printing. When working with Bambu Lab printers, you can also initiate prints via MQTT and access preset resources from Bambu Studio if configured.
Common workflows you can perform include: listing files on a printer, uploading G-code, starting a print, cancelling a running job, adjusting temperatures, and preparing STL files through manipulation tools before slicing and printing. The server also supports reading Bambu Studio presets as resources when you provide the proper Bambu Studio configuration path.
Follow these concrete steps to install and run the MCP server locally.
# Prerequisites
node -v
# Ensure Node.js 18 or higher is installed
# Install the MCP server globally
npm install -g mcp-3d-printer-server
# Verify installation
mcp-3d-printer-server --version
# If you prefer building from source:
# git clone https://github.com/dmontgomery40/mcp-3d-printer-server.git
# cd mcp-3d-printer-server
# npm install
# npm link # Makes the command available globally
# Run the server (example)
mcp-3d-printer-serverConfigure your environment variables to define the printers you want to manage. The example shows how Claude Desktop and MCP clients can start the server with environment-specific settings.
# Required for authentication with your printer management system
API_KEY=your_api_key_here
# Default printer connection settings
PRINTER_HOST=localhost
PRINTER_PORT=80
PRINTER_TYPE=octoprint # Options: octoprint, klipper, duet, repetier, bambu, prusa, creality
# Optional: Directory for temporary files
TEMP_DIR=/path/to/temp/dir
# Bambu Labs specific configuration (if you use Bambu)
BAMBU_SERIAL=your_printer_serial
BAMBU_TOKEN=your_access_token
# Slicer configuration (for slice_stl tool)
SLICER_TYPE=prusaslicer
SLICER_PATH=/path/to/prusaslicer
SLICER_PROFILE=/path/to/profile.ini
# Optional: Path to Bambu Studio user config dir (for presets)
BAMBU_STUDIO_CONFIG_PATH=/path/to/BambuStudio/userThe MCP server supports a rich set of tools for STL manipulation, printer control, and Bambu-specific operations. It includes options to extend the base of an STL, scale and rotate models, align them for printing, slice STL files with your preferred slicer, and generate visualizations. For Bambu printers, you can initiate prints via MQTT and load Bambu Studio presets as resources when you supply the correct configuration path.
Ensure your API keys and network access are secured. When using Bambu Studio presets or MQTT channels, verify network access and TLS settings for MQTT (TLS on port 8883 is recommended). Be aware that file transfer methods for Bambu printers may rely on FTP, which can be unsecured in some configurations. Use within trusted networks and adjust firewall rules accordingly.
If you encounter issues with printer status updates, verify that your printer management system is reachable from the MCP server host. For Bambu MQTT connections, check that the printer is on the same network or cloud-connected and that the serial and access token values are correct. For large STL files, monitor memory usage and consider processing smaller models first.
Upload a G-code file and start printing on an OctoPrint host, or prepare a .stl model by applying transforms and then slice it with PrusaSlicer before initiating a print on the target printer.
Retrieve detailed information about an STL file, including dimensions and vertex counts.
Extend the base of an STL model by a specified amount to improve adhesion or fit.
Scale an STL model uniformly or along axes, including non-uniform scaling.
Rotate an STL model around x, y, and z axes.
Translate or move an STL model along x, y, and z axes.
Merge vertices that are very close to reduce mesh complexity.
Center the model so its bounding box center aligns with the world origin.
Orient the model so a major flat surface lies on the printing plane.
Apply transformations to a specific section of an STL model.
Create SVG visualizations from multiple STL angles.
Slice an STL file using a specified slicer to generate G-code.
Verify temperature settings are correctly reflected in G-code.
Extend, slice, confirm temps, and start a print for an STL file.