MCP 3D Printer Server is a Model Context Protocol server that connects Claude AI with various 3D printer management systems. It enables interaction with 3D printers through APIs of systems like OctoPrint, Klipper, Duet, Repetier, Bambu Labs, Prusa Connect, and Creality printers, allowing for printer status monitoring, file management, print job control, and advanced 3D model manipulation.
npm install -g mcp-3d-printer-server
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
You can also use Docker for a containerized environment:
.env.example
to .env
and configure your settingsdocker-compose up --build -d
The default Docker setup cannot directly use a slicer installed on your host machine. You need to install your preferred slicer inside the Docker image by modifying the Dockerfile:
# Example: Install PrusaSlicer or OrcaSlicer
# RUN apk add --no-cache fuse # FUSE might be needed for AppImages
# RUN wget https://example.com/path/to/OrcaSlicer_Linux_Vxxxx.AppImage -O /usr/local/bin/orcaslicer && \
# chmod +x /usr/local/bin/orcaslicer
ENV SLICER_PATH=/usr/local/bin/orcaslicer
After modification, rebuild your image with docker-compose build
and ensure your environment variables point to the correct path.
Create a .env
file or set environment variables:
# Required for authentication with your printer management system
API_KEY=your_api_key_here
# Default printer connection settings
PRINTER_HOST=localhost
PRINTER_PORT=80 # Port for non-Bambu HTTP APIs
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
BAMBU_SERIAL=your_printer_serial # REQUIRED for Bambu
BAMBU_TOKEN=your_access_token # REQUIRED for Bambu
# Slicer configuration (for slice_stl tool)
SLICER_TYPE=prusaslicer # Options: prusaslicer, cura, slic3r, orcaslicer
SLICER_PATH=/path/to/slicer/executable
SLICER_PROFILE=/path/to/slicer/profile
# Optional: Path to Bambu Studio user config dir (for loading presets)
BAMBU_STUDIO_CONFIG_PATH=
{
"mcpServers": {
"3dprint": {
"command": "mcp-3d-printer-server",
"env": {
"API_KEY": "your_api_key_here",
"PRINTER_HOST": "your_printer_ip",
"PRINTER_TYPE": "octoprint"
}
}
}
}
{
"mcpServers": {
"3dprint": {
"command": "mcp-3d-printer-server",
"env": {
"PRINTER_HOST": "your_printer_ip",
"PRINTER_TYPE": "bambu",
"BAMBU_SERIAL": "your_printer_serial",
"BAMBU_TOKEN": "your_access_token"
}
}
}
}
BAMBU_SERIAL
and BAMBU_TOKEN
)Printer Serial Number:
Access Token:
Memory Usage Warning: These tools load entire 3D models into memory and can consume significant memory for large/complex STL files.
{
"three_mf_path": "/path/to/your_model.3mf",
"host": "your_bambu_ip",
"bambu_serial": "YOUR_SERIAL",
"bambu_token": "YOUR_TOKEN",
"use_ams": true,
"ams_mapping": [0, 1, 2, 3],
"bed_leveling": true,
"flow_calibration": false,
"vibration_calibration": false,
"timelapse": false
}
printer://{host}/status
- Current printer statusprinter://{host}/files
- List of available filesprinter://{host}/file/{filename}
- Content of a specific G-code fileWhen BAMBU_STUDIO_CONFIG_PATH
is set:
preset://bambu/machine/{preset_name}
- Machine presetspreset://bambu/filament/{preset_name}
- Filament presetspreset://bambu/process/{preset_name}
- Process presetsFor optimal performance, start with smaller STL files (< 10MB) and consider running on a system with at least 4GB of available RAM for larger operations.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "3dprint" '{"command":"mcp-3d-printer-server","env":{"API_KEY":"your_api_key_here","PRINTER_HOST":"your_printer_ip","PRINTER_TYPE":"octoprint"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"3dprint": {
"command": "mcp-3d-printer-server",
"env": {
"API_KEY": "your_api_key_here",
"PRINTER_HOST": "your_printer_ip",
"PRINTER_TYPE": "octoprint"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"3dprint": {
"command": "mcp-3d-printer-server",
"env": {
"API_KEY": "your_api_key_here",
"PRINTER_HOST": "your_printer_ip",
"PRINTER_TYPE": "octoprint"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect