home / mcp / mcp 3d printer server

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.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "dmontgomery40-mcp-3d-printer-server": {
      "url": "https://mcp.example.com/mcp",
      "headers": {
        "API_KEY": "YOUR_API_KEY",
        "TEMP_DIR": "/tmp",
        "BAMBU_TOKEN": "YOUR_TOKEN",
        "SLICER_PATH": "/usr/bin/prusaslicer",
        "SLICER_TYPE": "prusaslicer",
        "BAMBU_SERIAL": "01P...",
        "PRINTER_HOST": "localhost",
        "PRINTER_PORT": "80",
        "PRINTER_TYPE": "octoprint",
        "MCP_HTTP_HOST": "127.0.0.1",
        "MCP_HTTP_PATH": "/mcp",
        "MCP_HTTP_PORT": "3000",
        "MCP_TRANSPORT": "stdio",
        "SLICER_PROFILE": "/path/to/profile.ini",
        "MCP_HTTP_STATEFUL": "true",
        "MCP_HTTP_JSON_RESPONSE": "true",
        "BAMBU_STUDIO_CONFIG_PATH": "/path/to/config",
        "MCP_HTTP_ALLOWED_ORIGINS": "http://localhost",
        "BLENDER_MCP_BRIDGE_COMMAND": "<BLENDER_MCP_BRIDGE_COMMAND>"
      }
    }
  }
}

You can run a dedicated MCP 3D Printer Server that bridges Claude’s MCP capabilities to multiple 3D printer management systems. This server lets you check printer status, manage files and prints, and perform STL manipulations and 3MF printing workflows across supported platforms, all through a consistent MCP interface.

How to use

To use the MCP 3D Printer Server, install the server globally, run it locally, and connect your MCP client to its command interface. Start by ensuring your environment provides Node.js 18+ and an appropriate package manager. Once the server is running, you can perform operations such as querying printer status, listing printer files, uploading G-code, starting and canceling prints, adjusting temperatures, and performing STL model modifications or 3MF prints on Bamboo printers via MQTT.

How to install

Prerequisites: Install Node.js 18 or higher and a package manager such as npm or yarn.

# Install the MCP 3D Printer Server globally
npm install -g mcp-3d-printer-server

# Alternative: 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

Configuration and running locally

Configure environment variables for your printer and MCP transport in a .env file or your shell environment. The server supports both HTTP-based MCP transport and a local stdio transport. Typical essentials include authentication, printer connection details, and transport 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
BAMBU_SERIAL=your_printer_serial
BAMBU_TOKEN=your_access_token

# Slicer (if using slice_stl tool)
SLICER_TYPE=prusaslicer
SLICER_PATH=/path/to/slicer/executable
SLICER_PROFILE=/path/to/profile.ini

# Bambu Studio presets path (optional)
BAMBU_STUDIO_CONFIG_PATH=

# MCP transport configuration
MCP_TRANSPORT=stdio             # options: stdio, streamable-http
MCP_HTTP_HOST=127.0.0.1
MCP_HTTP_PORT=3000
MCP_HTTP_PATH=/mcp
MCP_HTTP_STATEFUL=true
MCP_HTTP_JSON_RESPONSE=true
MCP_HTTP_ALLOWED_ORIGINS=http://localhost

# Blender bridge (optional)
BLENDER_MCP_BRIDGE_COMMAND=

Starting with Claude Desktop integration

If you use Claude Desktop, provide a server configuration that points to the MCP 3D Printer Server and include necessary environment variables for authentication and printer access.

{
  "mcpServers": {
    "3dprint": {
      "command": "mcp-3d-printer-server",
      "env": {
        "API_KEY": "your_api_key_here",
        "PRINTER_HOST": "your_printer_ip",
        "PRINTER_TYPE": "octoprint"
      }
    }
  }
}

Supported Printer Management Systems

The server interfaces with multiple printer management ecosystems, including OctoPrint, Klipper (via Moonraker), Duet, Repetier, Bambu Labs, Prusa Connect, and Creality Cloud. Each integration provides access to status, files, and print controls through the MCP channel.

Available Tools

The MCP 3D Printer Server exposes a rich set of tools for STL manipulation, printer control, and Bambu-specific printing workflows. These tools are described in detail within their respective sections and can be invoked via MCP commands from your client.

Bambu Lab printer workflow notes

Bambu printers can be controlled via MQTT for status and commands, and files are transferred over FTPS. When printing 3MF files, you can leverage AMS mapping and other options through the 3MF printing workflow. Ensure you provide the printer serial and access token to enable secure communication.

Security and reliability considerations

Treat credentials and network access with care. Use short-lived tokens where possible, enable TLS for MQTT if available, and validate all tool outputs before acting on them. Enable logging to audit printer actions and MCP interactions.

Troubleshooting tips

If the MCP server fails to start, verify Node.js is installed and that the global command is accessible in your shell. Confirm that environment variables are set correctly, especially API keys and printer connection details. Check network connectivity to the printer and transport endpoints.

Notes on memory and performance

Advanced STL model manipulation loads full models into memory. For large files, monitor memory usage and consider running on a system with sufficient RAM. Slicing operations can be CPU-intensive and may take time for complex models.

Appendix: MCP in practice

This guide focuses on practical usage patterns for operating the MCP 3D Printer Server as part of your printing workflow. Use the command surface that best fits your integration, and compose complex tasks by combining STL manipulation, slicing, and print control steps.

Available tools

get_stl_info

Retrieve detailed information about an STL file such as dimensions, vertex count, and bounding box.

extend_stl_base

Extend the base of an STL model by a specified amount to improve adhesion.

scale_stl

Scale an STL model uniformly or along specific axes, including non-uniform scaling.

rotate_stl

Rotate an STL model around specified axes by given degrees.

translate_stl

Translate an STL model along X, Y, and Z axes.

merge_vertices

Merge vertices below a specified tolerance to close gaps and simplify the mesh.

center_model

Center the model so its bounding box center aligns with the world origin.

lay_flat

Identify the largest flat surface and orient the model with that face down for printing.

modify_stl_section

Apply targeted transformations to a specific section of an STL file.

generate_stl_visualization

Create an SVG visualization of the STL from multiple viewpoints.

slice_stl

Slice an STL using a chosen slicer to produce G-code.

confirm_temperatures

Verify temperatures are correctly set in a G-code file.

process_and_print_stl

Process an STL file (extend base), slice it, confirm temperatures, and start printing.

get_printer_status

Query the current status of the connected printer.

list_printer_files

List files stored on the printer, including G-code and other assets.

upload_gcode

Upload G-code to the printer, with an option to start printing.

start_print

Start a print from an already available file on the printer.

cancel_print

Cancel the currently running print job.

set_printer_temperature

Set the target temperature for a printer component such as the extruder or bed.

print_3mf

Upload a .3mf file to a Bamboo printer via FTP and start the print via MQTT, with optional overrides.