3D Printer Manager MCP server

Integrates with multiple 3D printer management systems to enable remote control, file handling, and advanced STL manipulation for automated print job management and custom model modifications.
Back to servers
Setup instructions
Provider
DMontgomery40
Release date
Feb 27, 2025
Language
TypeScript
Package
Stats
2.7K downloads
82 stars

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.

Installation

Prerequisites

  • Node.js 18 or higher
  • npm or yarn

Install from npm

npm install -g mcp-3d-printer-server

Install 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

Running with Docker

You can also use Docker for a containerized environment:

  1. Ensure you have Docker and Docker Compose installed
  2. Copy .env.example to .env and configure your settings
  3. Build and run the container:
docker-compose up --build -d

Using Slicers with Docker

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.

Configuration

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=

Usage with Claude Desktop

  1. Edit your Claude Desktop configuration file:
{
  "mcpServers": {
    "3dprint": {
      "command": "mcp-3d-printer-server",
      "env": {
        "API_KEY": "your_api_key_here",
        "PRINTER_HOST": "your_printer_ip",
        "PRINTER_TYPE": "octoprint"
      }
    }
  }
}
  1. For Bambu Labs printers:
{
  "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"
      }
    }
  }
}
  1. Restart Claude Desktop
  2. Connect to your printer through Claude

Supported Printer Management Systems

OctoPrint

  • Default port: 80 (http) or 443 (https)
  • Authentication: API key required

Klipper (via Moonraker)

  • Default port: 7125
  • Authentication: Depends on your Moonraker configuration

Duet

  • Default port: 80 (http) or 443 (https)
  • Authentication: Depends on your Duet configuration

Repetier

  • Default port: 3344
  • Authentication: API key required

Bambu Labs

  • Authentication: Serial number and access token required (set BAMBU_SERIAL and BAMBU_TOKEN)
  • Requirements: Printer must be on the same network or have cloud connection enabled
  • Compatible with: X1C, P1S, P1P, A1, and other Bambu Lab printers

Finding Your Bambu Printer's Serial Number and Access Token

  1. Printer Serial Number:

    • Look on the back/bottom of your printer for a sticker with a serial number
    • Or open Bambu Studio, connect to your printer, go to Device > Device Management
  2. Access Token:

    • For P1 Series: Touchscreen > Settings > Network > LAN Mode
    • For X1 Series: Touchscreen > Settings > Network > LAN Mode (enable LAN Mode first)
    • For A1 Mini: Bambu Handy app > Settings > Network > LAN Mode

Prusa Connect

  • Default port: 80 (http) or 443 (https)
  • Authentication: API key required
  • Compatible with: Prusa MK4, Mini, XL, and other Prusa printers with Prusa Connect

Creality Cloud

  • Default port: 80 (http) or 443 (https)
  • Authentication: Bearer token required
  • Compatible with: Ender series, CR series, and other Creality printers with network capabilities

Available Tools

STL Manipulation Tools

Memory Usage Warning: These tools load entire 3D models into memory and can consume significant memory for large/complex STL files.

  • get_stl_info: Get detailed information about an STL file
  • extend_stl_base: Extend the base of an STL file
  • scale_stl: Scale an STL model uniformly or along specific axes
  • rotate_stl: Rotate an STL model around specific axes
  • translate_stl: Move an STL model along specific axes
  • merge_vertices: Merge vertices that are closer than a specified tolerance
  • center_model: Center the model at the origin
  • lay_flat: Orient the model for optimal printing
  • modify_stl_section: Apply transformations to specific sections of a model
  • generate_stl_visualization: Generate SVG visualizations from multiple angles
  • slice_stl: Slice an STL file to generate G-code
  • confirm_temperatures: Verify temperature settings in G-code
  • process_and_print_stl: Process, slice, and print an STL file

Printer Control Tools

  • get_printer_status: Get current printer status
  • list_printer_files: List files on the printer
  • upload_gcode: Upload G-code to the printer
  • start_print: Start printing a file already on the printer
  • cancel_print: Cancel the current print job
  • set_printer_temperature: Set component temperatures

Bambu-Specific Tools

  • print_3mf: Upload and print a .3mf file on a Bambu printer
{
  "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
}

Available Resources

Printer Resources

  • printer://{host}/status - Current printer status
  • printer://{host}/files - List of available files
  • printer://{host}/file/{filename} - Content of a specific G-code file

Bambu Preset Resources

When BAMBU_STUDIO_CONFIG_PATH is set:

  • preset://bambu/machine/{preset_name} - Machine presets
  • preset://bambu/filament/{preset_name} - Filament presets
  • preset://bambu/process/{preset_name} - Process presets

Limitations and Considerations

  • Memory Usage: Processing large STL files can consume significant memory
  • Bambu Lab Limitations: Limited direct temperature control and status monitoring
  • Visualization Limitations: SVG visualizations are simplified representations
  • Performance: Slicing operations can be CPU-intensive for complex models

For optimal performance, start with smaller STL files (< 10MB) and consider running on a system with at least 4GB of available RAM for larger operations.

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            }
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later