{"id":27837058,"url":"https://github.com/DMontgomery40/mcp-3D-printer-server","last_synced_at":"2025-05-02T18:06:18.982Z","repository":{"id":279676919,"uuid":"939583958","full_name":"DMontgomery40/mcp-3D-printer-server","owner":"DMontgomery40","description":"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.","archived":false,"fork":false,"pushed_at":"2025-04-15T00:09:15.000Z","size":20802,"stargazers_count":24,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T07:59:36.475Z","etag":null,"topics":["3d-printing","3mf","bambu-lab","bambu-studio","duet","g-code","klipper","mcp","mcp-orca-slicer","mcp-server","mcp-stl-3mf","modelcontextprotocol","moonraker","octoprint","orca-slicer","repetier","repetier-server","stl-files","three-js","threejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DMontgomery40.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-26T19:19:47.000Z","updated_at":"2025-04-22T07:41:55.000Z","dependencies_parsed_at":"2025-04-14T12:15:54.006Z","dependency_job_id":null,"html_url":"https://github.com/DMontgomery40/mcp-3D-printer-server","commit_stats":null,"previous_names":["dmontgomery40/mcp-3d-printer-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DMontgomery40%2Fmcp-3D-printer-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DMontgomery40%2Fmcp-3D-printer-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DMontgomery40%2Fmcp-3D-printer-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DMontgomery40%2Fmcp-3D-printer-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DMontgomery40","download_url":"https://codeload.github.com/DMontgomery40/mcp-3D-printer-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252084833,"owners_count":21692163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-printing","3mf","bambu-lab","bambu-studio","duet","g-code","klipper","mcp","mcp-orca-slicer","mcp-server","mcp-stl-3mf","modelcontextprotocol","moonraker","octoprint","orca-slicer","repetier","repetier-server","stl-files","three-js","threejs"],"created_at":"2025-05-02T18:06:13.581Z","updated_at":"2025-05-02T18:06:18.973Z","avatar_url":"https://github.com/DMontgomery40.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","IoT and Device Control","🌐 Web Development","📚 Projects (2474 total)","Smart Home \u0026 IoT Mcp Servers","JavaScript"],"sub_categories":["MCP Servers"],"readme":"# MCP 3D Printer Server\n\n[![npm version](https://img.shields.io/npm/v/mcp-3d-printer-server.svg)](https://www.npmjs.com/package/mcp-3d-printer-server)\n[![License: GPL-2.0](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)\n[![TypeScript](https://img.shields.io/badge/TypeScript-4.9%2B-blue)](https://www.typescriptlang.org/)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/yourusername/mcp-3d-printer-server/graphs/commit-activity)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://makeapullrequest.com)\n[![Node.js Version](https://img.shields.io/badge/node-%3E%3D%2018.0.0-green.svg)](https://nodejs.org/en/download/)\n[![Downloads](https://img.shields.io/npm/dm/mcp-3d-printer-server.svg)](https://www.npmjs.com/package/mcp-3d-printer-server)\n[![GitHub stars](https://img.shields.io/github/stars/dmontgomery40/mcp-3d-printer-server.svg?style=social\u0026label=Star)](https://github.com/yourusername/mcp-3d-printer-server)\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e✨ What's New / Significant Updates (as of last session)\u003c/strong\u003e\u003c/summary\u003e\n\n- **Bambu `.3mf` Printing:** Added the `print_3mf` tool specifically for Bambu Lab printers. This uploads the `.3mf` file and sends the print command directly via MQTT based on OpenBambuAPI specs.\n- **Direct MQTT Communication (Bambu):** Refactored Bambu command handling (`print_3mf`, `cancelJob`) to use direct MQTT (TLS port 8883) instead of relying solely on `bambu-js` for commands.\n- **`.3mf` File Parsing:** Implemented a parser (`src/3mf_parser.ts`) to read metadata and Bambu-specific slicer settings (from `project_settings.config`) within `.3mf` files.\n- **Bambu Preset Resources:** Added support for reading Bambu Studio preset files (`machine`, `filament`, `process`) as MCP resources (e.g., `preset://bambu/process/MyPreset`) if `BAMBU_STUDIO_CONFIG_PATH` is set.\n- **OrcaSlicer Integration:** Added support for using OrcaSlicer via its command-line interface for the `slice_stl` tool.\n- **New STL Manipulation Tools:** Added `merge_vertices`, `center_model`, and `lay_flat` tools for basic model preparation using `three.js`.\n- **Configuration Update:** Added `BAMBU_STUDIO_CONFIG_PATH` environment variable for preset loading.\n- **FTP Usage Note:** Acknowledged in documentation that file operations for Bambu currently use potentially unsecured FTP via `bambu-js`.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003e🗺️ Roadmap / TODO\u003c/strong\u003e\u003c/summary\u003e\n\n- **Achieve Feature Parity:** Bring functionality (status detail, file operations, direct printing where possible, preset handling) for OctoPrint, Klipper, Duet, Repetier, Prusa Connect, and Creality Cloud up to the level of robustness planned for the Bambu implementation.\n- **Implement Full Bambu MQTT Status:** Refactor `getStatus` for Bambu to subscribe to MQTT reports and maintain real-time state.\n- **Implement Robust AMS Mapping:** Replace placeholder logic; correctly parse and use AMS mapping from `.3mf` slicer config or user overrides for the MQTT print command.\n- **Implement `.3mf` Print Overrides:** Add logic to the `print_3mf` tool to handle user-provided overrides (e.g., calibration flags) and potentially common slicer settings if feasible via MQTT/G-code.\n- **Calculate MD5 Hash:** Add logic to calculate and include the MD5 hash of the `.3mf` file in the MQTT print command (optional but recommended by protocol).\n- **Refactor Bambu File Ops:** Investigate replacing `bambu-js` FTP operations (`getFiles`, `uploadFile`) with direct MQTT methods if possible/stable, or contribute FTPS support to `bambu-js`.\n- **Add Preset Discovery Logic:** Improve preset resource listing (currently lists based on potential filenames, could parse index files if they exist).\n- **Expand `.3mf` Support:** Add `.3mf` printing support for other printer types where applicable.\n- **Error Handling \u0026 Reporting:** Enhance MQTT error handling and reporting of print progress/completion.\n- **Testing:** Conduct thorough runtime testing of all new Bambu features.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand Table of Contents\u003c/summary\u003e\n\n## Table of Contents\n\n- [Description](#description)\n- [Features](#features)\n- [Installation](#installation)\n  - [Prerequisites](#prerequisites)\n  - [Install from npm](#install-from-npm)\n  - [Install from source](#install-from-source)\n  - [Running with Docker](#running-with-docker)\n    - [Using Slicers with Docker](#using-slicers-with-docker)\n- [Configuration](#configuration)\n- [Usage with Claude Desktop](#usage-with-claude-desktop)\n- [Supported Printer Management Systems](#supported-printer-management-systems)\n  - [OctoPrint](#octoprint)\n  - [Klipper (via Moonraker)](#klipper-via-moonraker)\n  - [Duet](#duet)\n  - [Repetier](#repetier)\n  - [Bambu Labs](#bambu-labs)\n    - [Finding Your Bambu Printer's Serial Number and Access Token](#finding-your-bambu-printers-serial-number-and-access-token)\n    - [Bambu Communication Notes (MQTT \u0026 FTP)](#bambu-communication-notes-mqtt--ftp)\n  - [Prusa Connect](#prusa-connect)\n    - [Setting up Prusa Connect](#setting-up-prusa-connect)\n  - [Creality Cloud](#creality-cloud)\n    - [Setting up Creality Cloud](#setting-up-creality-cloud)\n- [Available Tools](#available-tools)\n  - [STL Manipulation Tools](#stl-manipulation-tools)\n  - [Printer Control Tools](#printer-control-tools)\n  - [Bambu-Specific Tools](#bambu-specific-tools)\n- [Available Resources](#available-resources)\n  - [Printer Resources](#printer-resources)\n  - [Bambu Preset Resources](#bambu-preset-resources)\n- [Example Commands for LLM](#example-commands-for-claude)\n- [Bambu Lab Printer Limitations](#bambu-lab-printer-limitations)\n- [Limitations and Considerations](#limitations-and-considerations)\n  - [Memory Usage](#memory-usage)\n  - [STL Manipulation Limitations](#stl-manipulation-limitations)\n  - [Visualization Limitations](#visualization-limitations)\n  - [Performance Considerations](#performance-considerations)\n  - [Testing Recommendations](#testing-recommendations)\n- [Badges](#badges)\n- [License](#license)\n\n\u003c/details\u003e\n\n## Description\n\nThis is a server that allows MCP users to connect with the API endpoints of these 3D Printers: \n\n- OctoPrint\n- Klipper (Moonraker)\n- Duet\n- Repetier\n- Bambu Labs\n- Prusa Connect\n- Creality/Ender\n\nThis server is a Model Context Protocol (MCP) server for connecting Claude with 3D printer management systems. It allows MCP to interact with 3D printers through the APIs of various printer management systems such as OctoPrint, Klipper (via Moonraker), Duet, Repetier, and Bambu Labs printers.\n\n**Note on Resource Usage**: This MCP server includes advanced 3D model manipulation features that can be memory-intensive when working with large STL files. Please see the \"Limitations and Considerations\" section for important information about memory usage and performance.\n\n## Features\n\n- Get printer status (temperatures, print progress, etc.)\n- List files on the printer\n- Upload G-code files to the printer\n- Start, cancel, and monitor print jobs\n- Set printer temperatures\n- Advanced STL file manipulation:\n  - Extend base for better adhesion\n  - Scale models uniformly or along specific axes\n  - Rotate models around any axis\n  - Translate (move) models\n  - Modify specific sections of STL files (top, bottom, center, or custom)\n- Comprehensive STL analysis with detailed model information\n- Generate multi-angle SVG visualizations of STL files\n- Real-time progress reporting for long operations\n- Error handling with detailed diagnostics\n- Slice STL files to generate G-code\n- Confirm temperature settings in G-code files\n- Complete end-to-end workflow from STL modification to printing\n- Print `.3mf` files directly on Bambu Lab printers (via MQTT command)\n- Read Bambu Studio preset files (printer, filament, process) as resources\n\n## Installation\n\n### Prerequisites\n\n- Node.js 18 or higher\n- npm or yarn\n\n### Install from npm\n\n```bash\nnpm install -g mcp-3d-printer-server\n```\n\n### Install from source\n\n```bash\ngit clone https://github.com/dmontgomery40/mcp-3d-printer-server.git\ncd mcp-3d-printer-server\nnpm install\nnpm link  # Makes the command available globally\n```\n\n### Running with Docker\n\nYou can also run the server using Docker and Docker Compose for a containerized environment.\n\n1.  Ensure you have Docker and Docker Compose installed.\n2.  Copy `.env.example` to `.env` and configure your settings.\n3.  Build and run the container:\n    ```bash\n    docker-compose up --build -d\n    ```\n\n#### Using Slicers with Docker\n\nPlease note that the default Docker setup **cannot directly use a slicer installed on your host machine**. Mounting the slicer executable directly from the host into the container is unreliable due to operating system and library differences between your host and the container.\n\nThe recommended approach is to **install your preferred slicer *inside* the Docker image**. This makes the container self-sufficient.\n\nTo do this, you will need to modify the `Dockerfile`. Here's a conceptual example of how you might add PrusaSlicer or OrcaSlicer (specific commands may vary depending on the slicer, its dependencies, and current Alpine packages):\n\n```dockerfile\n# ... other Dockerfile commands ...\n\n# Example: Install PrusaSlicer or OrcaSlicer (adjust command as needed)\n# Check Alpine package repositories first (e.g., apk add prusaslicer or apk add orcaslicer)\n# If not available, download and install manually (e.g., AppImage):\n# RUN apk add --no-cache fuse # FUSE might be needed for AppImages\n# RUN wget https://example.com/path/to/OrcaSlicer_Linux_Vxxxx.AppImage -O /usr/local/bin/orcaslicer \u0026\u0026 \\\n#     chmod +x /usr/local/bin/orcaslicer\n\n# Set the SLICER_PATH env var accordingly in docker-compose.yml or when running\n# Example for installed executable:\nENV SLICER_PATH=/usr/local/bin/orcaslicer \n\n# ... rest of Dockerfile ...\n```\n\nAfter modifying the `Dockerfile`, rebuild your image (`docker-compose build`). You'll also need to ensure the `SLICER_PATH` environment variable in your `.env` file or `docker-compose.yml` points to the correct path *inside the container* (e.g., `/usr/local/bin/orcaslicer`). Set `SLICER_TYPE` to `orcaslicer` as well.\n\nApologies for not including a specific slicer out-of-the-box, but given the wide variety of slicers (PrusaSlicer, OrcaSlicer, Cura, etc.) and configurations available, pre-installing one would unnecessarily bloat the image for many users. If a particular slicer becomes a very common request, I can certainly look into adding official support for it in a future version.\n\n## Configuration\n\nCreate a `.env` file in the directory where you'll run the server or set environment variables:\n\n```env\n# Required for authentication with your printer management system\nAPI_KEY=your_api_key_here\n\n# Default printer connection settings\nPRINTER_HOST=localhost\nPRINTER_PORT=80 # Port for non-Bambu HTTP APIs\nPRINTER_TYPE=octoprint  # Options: octoprint, klipper, duet, repetier, bambu, prusa, creality\n\n# Optional: Directory for temporary files\nTEMP_DIR=/path/to/temp/dir\n\n# Bambu Labs specific configuration\nBAMBU_SERIAL=your_printer_serial # REQUIRED for Bambu\nBAMBU_TOKEN=your_access_token    # REQUIRED for Bambu\n\n# Slicer configuration (for slice_stl tool)\nSLICER_TYPE=prusaslicer  # Options: prusaslicer, cura, slic3r, orcaslicer\nSLICER_PATH=/path/to/slicer/executable\nSLICER_PROFILE=/path/to/slicer/profile\n\n# Optional: Path to Bambu Studio user config dir (for loading presets)\n# Example macOS: /Users/your_user/Library/Application Support/BambuStudio/user/YOUR_USER_ID\n# Example Windows: C:\\Users\\your_user\\AppData\\Roaming\\BambuStudio\\user\\YOUR_USER_ID\n# Example Linux: /home/your_user/.config/BambuStudio/user/YOUR_USER_ID\nBAMBU_STUDIO_CONFIG_PATH=\n```\n\n## Usage with Claude Desktop\n\n1. Edit your Claude Desktop configuration file:\n\n```json\n{\n  \"mcpServers\": {\n    \"3dprint\": {\n      \"command\": \"mcp-3d-printer-server\",\n      \"env\": {\n        \"API_KEY\": \"your_api_key_here\",\n        \"PRINTER_HOST\": \"your_printer_ip\",\n        \"PRINTER_TYPE\": \"octoprint\"\n      }\n    }\n  }\n}\n```\n\n2. For Bambu Labs printers:\n\n```json\n{\n  \"mcpServers\": {\n    \"3dprint\": {\n      \"command\": \"mcp-3d-printer-server\",\n      \"env\": {\n        \"PRINTER_HOST\": \"your_printer_ip\",\n        \"PRINTER_TYPE\": \"bambu\",\n        \"BAMBU_SERIAL\": \"your_printer_serial\",\n        \"BAMBU_TOKEN\": \"your_access_token\"\n      }\n    }\n  }\n}\n```\n\n3. Restart Claude Desktop\n4. Connect to your printer through Claude\n\n## Supported Printer Management Systems\n\n### OctoPrint\n\nOctoPrint is a popular web interface for 3D printers. It provides a REST API for controlling the printer.\n\n- Default port: 80 (http) or 443 (https)\n- Authentication: API key required\n\n### Klipper (via Moonraker)\n\nKlipper is a firmware for 3D printers that works with the Moonraker API server.\n\n- Default port: 7125\n- Authentication: Depends on your Moonraker configuration\n\n### Duet\n\nDuet is a control board for 3D printers with its own web interface (DuetWebControl).\n\n- Default port: 80 (http) or 443 (https)\n- Authentication: Depends on your Duet configuration\n\n### Repetier\n\nRepetier-Server is a host software for 3D printers.\n\n- Default port: 3344\n- Authentication: API key required\n\n### Bambu Labs\n\nBambu Lab printers use MQTT for status and control and FTP for file operations.\n\n- Authentication: Serial number and access token required (set `BAMBU_SERIAL` and `BAMBU_TOKEN`)\n- Requirements: Printer must be on the same network or have cloud connection enabled\n- Compatible with: X1C, P1S, P1P, A1, and other Bambu Lab printers\n\n#### Finding Your Bambu Printer's Serial Number and Access Token\n\nTo connect to your Bambu Lab printer, you need two things:\n\n1. **Printer Serial Number**: \n   - Look on the back or bottom of your printer for a sticker with a serial number (typically starts with \"01P\" or \"01A\" followed by numbers/letters)\n   - Alternatively, open Bambu Studio, connect to your printer, go to Device \u003e Device Management, and view your printer's information\n\n2. **Access Token**: \n   - The access token is a security code needed to connect directly to your printer\n   - For P1 Series printers: Go to the touchscreen, select Settings \u003e Network \u003e LAN Mode, and you'll see the access code\n   - For X1 Series printers: Go to the touchscreen, select Settings \u003e Network \u003e LAN Mode, and enable LAN Mode to see the access code\n   - For A1 Mini: Use the Bambu Handy app to connect to your printer, then go to Settings \u003e Network \u003e LAN Mode\n\n**Note**: If your printer is not on the same local network or you can't find the access token, you may need to update your printer's firmware to the latest version to enable LAN Mode.\n\n#### Bambu Communication Notes (MQTT \u0026 FTP)\n\n- **MQTT:** This server uses the local MQTT protocol (port 8883, TLS) based on community findings (e.g., [OpenBambuAPI](https://github.com/Doridian/OpenBambuAPI)) to send commands like starting prints and cancelling jobs.\n- **FTP:** File listing and uploading currently rely on the FTP server running on the printer (via the `bambu-js` library helper). **Note:** This FTP connection might be **unsecured (plain FTP)** based on current library limitations. Use with awareness of your network security.\n\n### Prusa Connect\n\nPrusa Connect is Prusa's own cloud-based solution for managing their printers.\n\n- Default port: 80 (http) or 443 (https)\n- Authentication: API key required\n- Compatible with: Prusa MK4, Prusa Mini, Prusa XL, and other Prusa printers with Prusa Connect\n\n#### Setting up Prusa Connect\n\n1. Make sure your Prusa printer is updated to the latest firmware\n2. Connect your printer to your Wi-Fi network\n3. Create a Prusa Connect account and register your printer\n4. Generate an API key from the Prusa Connect web interface under Settings \u003e API Access\n\n### Creality Cloud\n\nCreality Cloud is Creality's management system for their printers.\n\n- Default port: 80 (http) or 443 (https)\n- Authentication: Bearer token required\n- Compatible with: Ender series, CR series, and other Creality printers with network capabilities\n\n#### Setting up Creality Cloud\n\n1. Install the Creality Cloud app on your mobile device\n2. Create an account and add your printer\n3. Enable local network access for your printer\n4. Generate a token from the Creality Cloud app under Settings \u003e Developer Options\n\n## Available Tools\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand STL Manipulation Tools\u003c/summary\u003e\n\n### STL Manipulation Tools\n\n\u003e **Memory Usage Warning**: The following STL manipulation tools load entire 3D models into memory. For large or complex STL files (\u003e10MB), these operations can consume significant memory. When using these tools within the MCP environment, be mindful of memory constraints.\n\n#### get_stl_info\n\nGet detailed information about an STL file, including dimensions, vertex count, and bounding box.\n\n```json\n{\n  \"stl_path\": \"/path/to/file.stl\"\n}\n```\n\n#### extend_stl_base\n\nExtend the base of an STL file by a specified amount.\n\n```json\n{\n  \"stl_path\": \"/path/to/file.stl\",\n  \"extension_inches\": 2\n}\n```\n\n#### scale_stl\n\nScale an STL model uniformly or along specific axes.\n\n```json\n{\n  \"stl_path\": \"/path/to/file.stl\",\n  \"scale_factor\": 1.5\n}\n```\n\nOr for non-uniform scaling:\n\n```json\n{\n  \"stl_path\": \"/path/to/file.stl\",\n  \"scale_x\": 1.2,\n  \"scale_y\": 1.0,\n  \"scale_z\": 1.5\n}\n```\n\n#### rotate_stl\n\nRotate an STL model around specific axes (in degrees).\n\n```json\n{\n  \"stl_path\": \"/path/to/file.stl\",\n  \"rotate_x\": 45,\n  \"rotate_y\": 0,\n  \"rotate_z\": 90\n}\n```\n\n#### translate_stl\n\nMove an STL model along specific axes (in millimeters).\n\n```json\n{\n  \"stl_path\": \"/path/to/file.stl\",\n  \"translate_x\": 10,\n  \"translate_y\": 5,\n  \"translate_z\": 0\n}\n```\n\n#### merge_vertices\n\nMerge vertices that are closer than a specified tolerance. Helps close small gaps and can slightly simplify the mesh.\n\n```json\n{\n  \"stl_path\": \"/path/to/model.stl\",\n  \"tolerance\": 0.01 // Optional, default = 0.01mm\n}\n```\n\n#### center_model\n\nTranslate the model so the center of its bounding box is at the world origin (0,0,0).\n\n```json\n{\n  \"stl_path\": \"/path/to/model.stl\"\n}\n```\n\n#### lay_flat\n\nAttempt to identify the largest flat surface of the model (that isn't already facing directly up or down) and rotate the model so this face is oriented downwards on the XY plane (Z=0). Useful for orienting models for printing.\n\n```json\n{\n  \"stl_path\": \"/path/to/model.stl\"\n}\n```\n\n#### modify_stl_section\n\nApply a specific transformation to a selected section of an STL file. This allows for detailed modifications of specific parts of a model.\n\n```json\n{\n  \"stl_path\": \"/path/to/file.stl\",\n  \"section\": \"top\",\n  \"transformation_type\": \"scale\",\n  \"value_x\": 1.5,\n  \"value_y\": 1.5, \n  \"value_z\": 1.5\n}\n```\n\nFor custom section bounds:\n\n```json\n{\n  \"stl_path\": \"/path/to/file.stl\",\n  \"section\": \"custom\",\n  \"transformation_type\": \"rotate\",\n  \"value_x\": 0,\n  \"value_y\": 0, \n  \"value_z\": 45,\n  \"custom_min_x\": -10,\n  \"custom_min_y\": 0,\n  \"custom_min_z\": -10,\n  \"custom_max_x\": 10,\n  \"custom_max_y\": 20,\n  \"custom_max_z\": 10\n}\n```\n\n#### generate_stl_visualization\n\nGenerate an SVG visualization of an STL file from multiple angles (front, side, top, and isometric views).\n\n```json\n{\n  \"stl_path\": \"/path/to/file.stl\",\n  \"width\": 400,\n  \"height\": 400\n}\n```\n\n#### slice_stl\n\nSlice an STL file to generate G-code.\n\n```json\n{\n  \"stl_path\": \"/path/to/file.stl\",\n  \"slicer_type\": \"prusaslicer\",\n  \"slicer_path\": \"/path/to/prusaslicer\",\n  \"slicer_profile\": \"/path/to/profile.ini\"\n}\n```\n\n#### confirm_temperatures\n\nConfirm temperature settings in a G-code file.\n\n```json\n{\n  \"gcode_path\": \"/path/to/file.gcode\",\n  \"extruder_temp\": 200,\n  \"bed_temp\": 60\n}\n```\n\n#### process_and_print_stl\n\nProcess an STL file (extend base), slice it, confirm temperatures, and start printing.\n\n```json\n{\n  \"stl_path\": \"/path/to/file.stl\",\n  \"extension_inches\": 2,\n  \"extruder_temp\": 200,\n  \"bed_temp\": 60,\n  \"host\": \"192.168.1.100\",\n  \"type\": \"octoprint\",\n  \"api_key\": \"YOUR_API_KEY\"\n}\n```\n\n**Note:** Automatic orientation for optimal printing (minimizing supports, etc.) is a complex task typically handled by slicer GUIs (like OrcaSlicer or PrusaSlicer) and is not implemented in this server.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand Printer Control Tools\u003c/summary\u003e\n\n### Printer Control Tools\n\n#### get_printer_status\n\nGet the current status of the 3D printer.\n\n```json\n{\n  \"host\": \"192.168.1.100\",\n  \"type\": \"octoprint\",\n  \"api_key\": \"YOUR_API_KEY\"\n}\n```\n\nFor Bambu printers, this currently only confirms MQTT connection.\n\n#### list_printer_files\n\nList files available on the printer.\n\n```json\n{\n  \"host\": \"192.168.1.100\",\n  \"type\": \"octoprint\",\n  \"api_key\": \"YOUR_API_KEY\"\n}\n```\n\nFor Bambu printers, lists files in the `gcodes` directory via FTP.\n\n#### upload_gcode\n\nUpload a G-code file to the printer.\n\n```json\n{\n  \"host\": \"192.168.1.100\",\n  \"type\": \"octoprint\",\n  \"api_key\": \"YOUR_API_KEY\",\n  \"filename\": \"my_print.gcode\",\n  \"gcode\": \"G28\\nG1 X100 Y100 Z10 F3000\\n...\",\n  \"print\": true\n}\n```\n\nFor Bambu printers, uploads to the `gcodes` directory via FTP. Cannot start print automatically.\n\n#### start_print\n\nStart printing a file that is already on the printer.\n\n```json\n{\n  \"host\": \"192.168.1.100\",\n  \"type\": \"octoprint\",\n  \"api_key\": \"YOUR_API_KEY\",\n  \"filename\": \"my_print.gcode\"\n}\n```\n\n**Not recommended for Bambu printers.** Use `print_3mf` for Bambu `.3mf` files.\n\n#### cancel_print\n\nCancel the current print job.\n\n```json\n{\n  \"host\": \"192.168.1.100\",\n  \"type\": \"octoprint\",\n  \"api_key\": \"YOUR_API_KEY\"\n}\n```\n\nFor Bambu printers, sends the `stop_print` command via MQTT.\n\n#### set_printer_temperature\n\nSet the temperature of a printer component.\n\n```json\n{\n  \"host\": \"192.168.1.100\",\n  \"type\": \"octoprint\",\n  \"api_key\": \"YOUR_API_KEY\",\n  \"component\": \"extruder\",\n  \"temperature\": 200\n}\n```\n\n**Not supported for Bambu printers** via direct MQTT commands.\n\n\u003c/details\u003e\n\n\u003cdetails open\u003e\n\u003csummary\u003eClick to expand Bambu-Specific Tools\u003c/summary\u003e\n\n### Bambu-Specific Tools\n\n#### print_3mf\n\nUploads a `.3mf` file to a Bambu printer via FTP and initiates the print job via an MQTT command. Allows overriding some print parameters like AMS mapping.\n\n```json\n{\n  \"three_mf_path\": \"/path/to/your_model.3mf\",\n  \"host\": \"your_bambu_ip\", // Optional if default is set\n  \"bambu_serial\": \"YOUR_SERIAL\", // Optional if default is set\n  \"bambu_token\": \"YOUR_TOKEN\", // Optional if default is set\n  // Optional Overrides:\n  \"use_ams\": true, // Default: true\n  \"ams_mapping\": [0, 1, 2, 3], // Array of AMS slot indices to use\n  \"bed_leveling\": true, // Default: true\n  \"flow_calibration\": false, // Default: false\n  \"vibration_calibration\": false, // Default: false\n  \"timelapse\": false // Default: false\n}\n```\n\n**Note:** Overriding slicer settings like layer height or temperature via this tool is not supported by the printer's MQTT command. Apply those changes before generating the `.3mf` file.\n\n\u003c/details\u003e\n\n## Available Resources\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand Printer Resources\u003c/summary\u003e\n\n### Printer Resources\n\n- `printer://{host}/status` - Current status of the 3D printer (limited for Bambu currently)\n- `printer://{host}/files` - List of files available on the 3D printer (FTP for Bambu)\n- `printer://{host}/file/{filename}` - Content of a specific G-code file (checks existence only for Bambu)\n\n\u003c/details\u003e\n\n\u003cdetails open\u003e\n\u003csummary\u003eClick to expand Bambu Preset Resources\u003c/summary\u003e\n\n### Bambu Preset Resources\n\nIf the `BAMBU_STUDIO_CONFIG_PATH` environment variable is set to your Bambu Studio user settings directory, you can read your saved presets.\n\n- `preset://bambu/machine/{preset_name}` - Reads a machine preset file (e.g., `Bambu Lab P1S 0.4 nozzle.json`)\n- `preset://bambu/filament/{preset_name}` - Reads a filament preset file (e.g., `Generic PLA.json`)\n- `preset://bambu/process/{preset_name}` - Reads a process preset file (e.g., `0.20mm Standard @BBL P1S.json`)\n\n**Example Usage:**\n\"Read the content of my Bambu process preset named '0.16mm Optimal @BBL P1S'\"\n(Claude would call ReadResource with `preset://bambu/process/0.16mm%20Optimal%20%40BBL%20P1S`)\n\n\u003c/details\u003e\n\n## Example Commands for Claude\n\nHere are some example commands you can give to Claude after connecting the MCP server:\n\n### Printer Control\n- \"What's the current status of my 3D printer?\"\n- \"Show me the list of files on my printer.\"\n- \"Upload this G-code to my printer: [G-code content]\"\n- \"Start printing the file named 'benchy.gcode'.\"\n- \"Cancel the current print job.\"\n- \"Set the extruder temperature to 200°C.\"\n- \"Set the bed temperature to 60°C.\"\n\n### STL Manipulation and Printing\n- \"Take this STL file and extend the base by 2 inches, then send to slicer and queue up in my printer.\"\n- \"Extend the base of model.stl by 1.5 inches.\"\n- \"Scale this STL file by 150% uniformly.\"\n- \"Scale model.stl to be twice as wide but keep the same height.\"\n- \"Rotate this model 90 degrees around the Z axis.\"\n- \"Move this STL model up by 5mm to create a gap underneath.\"\n- \"Can you modify just the top part of this model to make it 20% larger?\"\n- \"Analyze this STL file and tell me its dimensions and details.\"\n- \"Generate a visualization of this STL file so I can see what it looks like.\"\n- \"Create SVG visualizations of my model from different angles.\"\n- \"Make the base of this model wider without changing its height.\"\n- \"Slice the modified STL file using PrusaSlicer.\"\n- \"Confirm that the temperatures in the G-code are 200°C for the extruder and 60°C for the bed.\"\n- \"Process this STL file, make the base 2 inches longer, slice it, and start printing, but confirm the temperatures first.\"\n- \"Print `~/Downloads/my_model.3mf` on the Bambu printer.\"\n- \"Upload `~/Desktop/calibration_cube.3mf` to the Bambu printer using AMS slots 0 and 2, and turn off bed leveling.\"\n- \"Cancel the print job on my Bambu P1S.\"\n- \"What are the settings in my Bambu filament preset 'Generic PETG'?\"\n- \"Show me my Bambu process presets.\"\n\n## Bambu Lab Printer Limitations\n\nDue to the nature of the Bambu Lab printer API, there are some limitations:\n\n1. **Starting prints**: Starting a print requires the 3MF project file path, gcode file name, print name, and MD5 hash. The simplified API in this server doesn't support this fully yet.\n\n2. **Temperature control**: The Bambu API doesn't provide direct methods to set temperatures. This would require custom G-code commands.\n\n3. **File management**: Files must be uploaded to the \"gcodes\" directory on the printer.\n\n4. **FTP Security:** File operations currently use the printer's FTP server, which may be unsecured (plain FTP).\n\n5. **Parameter Overrides:** Only parameters supported by the MQTT `project_file` command can be overridden via the `print_3mf` tool (e.g., AMS usage, calibration flags). Slicer settings like layer height or temperature cannot be changed at print time via this command.\n\n6. **Status Updates:** Full real-time status monitoring via MQTT needs further implementation.\n\n## Limitations and Considerations\n\n### Memory Usage\n- **Large STL Files**: Processing large or complex STL files can consume significant memory. The entire STL geometry is loaded into memory during operations.\n- **Multiple Operations**: Running multiple STL operations in sequence (especially on large files) may cause memory to accumulate if garbage collection doesn't keep up.\n- **MCP Environment**: Since this runs as an MCP server, be aware that Claude's MCP environment has memory constraints. Complex operations on very large STL files may cause out-of-memory issues.\n\n### STL Manipulation Limitations\n- **Section Modification**: The section-specific modification feature works best on simpler geometries. Complex or non-manifold meshes may produce unexpected results.\n- **Base Extension**: The base extension algorithm works by adding a new geometry underneath the model. For models with complex undersides, results may not be perfect.\n- **Error Handling**: While we've added robust error handling, some edge cases in complex STL files might still cause issues.\n\n### Visualization Limitations\n- **SVG Representation**: The SVG visualization is a simplified schematic representation, not a true 3D render.\n- **Complex Models**: For very complex models, the visualization may not accurately represent all details.\n\n### Performance Considerations\n- **Slicing Operations**: External slicer processes can be CPU-intensive and may take considerable time for complex models.\n- **Progress Reporting**: For large files, progress updates may appear to stall at certain processing stages.\n\n### Testing Recommendations\n- Start with smaller STL files (\u003c 10MB) to test functionality\n- Monitor memory usage when processing large files\n- Test modifications on simple geometries before attempting complex ones\n- Consider running on a system with at least 4GB of available RAM for larger operations\n\n## Badges\n\n| Badge | Description |\n|-------|-------------|\n| [![npm version](https://img.shields.io/npm/v/mcp-3d-printer-server.svg)](https://www.npmjs.com/package/mcp-3d-printer-server) | The current version of the package on npm |\n| [![License: GPL-2.0](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) | This project is licensed under GPL-2.0 |\n| [![TypeScript](https://img.shields.io/badge/TypeScript-4.9%2B-blue)](https://www.typescriptlang.org/) | This project is written in TypeScript 4.9+ |\n| [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/yourusername/mcp-3d-printer-server/graphs/commit-activity) | This project is actively maintained |\n| [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://makeapullrequest.com) | We welcome contributions via Pull Requests |\n| [![Node.js Version](https://img.shields.io/badge/node-%3E%3D%2018.0.0-green.svg)](https://nodejs.org/en/download/) | Requires Node.js 18.0.0 or higher |\n| [![Downloads](https://img.shields.io/npm/dm/mcp-3d-printer-server.svg)](https://www.npmjs.com/package/mcp-3d-printer-server) | Number of downloads per month from npm |\n| [![GitHub stars](https://img.shields.io/github/stars/dmontgomery40/mcp-3d-printer-server.svg?style=social\u0026label=Star)](https://github.com/yourusername/mcp-3d-printer-server) | Number of GitHub stars this project has received |\n\n## License\n\nGPL-2.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDMontgomery40%2Fmcp-3D-printer-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDMontgomery40%2Fmcp-3D-printer-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDMontgomery40%2Fmcp-3D-printer-server/lists"}