
MCP 3D Printer Server

2025.03.23
0
TypeScript3D打印服务打印机管理其它
MCP 3D Printer Server 是一个用于连接和管理多种3D打印机的服务器,支持通过API与OctoPrint、Klipper (Moonraker)、Duet、Repetier、Bambu Labs等打印机管理系统交互。它提供了丰富的功能,包括打印机状态监控、文件管理、打印任务控制、STL文件操作(如缩放、旋转、平移等)、STL文件分析、可视化生成以及切片功能。
View on GitHub
Overview
基本能力
产品定位
MCP 3D Printer Server 是一个用于连接和管理多种3D打印机的服务器,支持通过API与多种打印机管理系统交互。
核心功能
- 获取打印机状态(温度、打印进度等)
- 列出打印机上的文件
- 上传G-code文件到打印机
- 开始、取消和监控打印任务
- 设置打印机温度
- 高级STL文件操作(扩展底座、缩放、旋转、平移等)
- 全面的STL分析,包括详细模型信息
- 生成多角度SVG可视化
- 实时进度报告
- 错误处理和详细诊断
- 切片STL文件生成G-code
- 确认G-code文件中的温度设置
- 完整的从STL修改到打印的工作流程
适用场景
- 远程监控和管理3D打印机
- 自动化3D打印流程
- 批量处理STL文件
- 教育和研究环境中的3D打印教学
工具列表
- STL Manipulation Tools:
get_stl_info
: 获取STL文件的详细信息extend_stl_base
: 扩展STL文件的底座scale_stl
: 缩放STL模型rotate_stl
: 旋转STL模型translate_stl
: 平移STL模型modify_stl_section
: 修改STL文件的特定部分generate_stl_visualization
: 生成STL文件的可视化slice_stl
: 切片STL文件生成G-codeconfirm_temperatures
: 确认G-code文件中的温度设置-
process_and_print_stl
: 处理STL文件并打印 -
Printer Control Tools:
get_printer_status
: 获取打印机状态list_printer_files
: 列出打印机上的文件upload_gcode
: 上传G-code文件start_print
: 开始打印cancel_print
: 取消打印set_printer_temperature
: 设置打印机温度
常见问题解答
- 内存使用: 处理大型或复杂的STL文件可能会消耗大量内存。
- STL操作限制: 部分操作在复杂几何体上可能产生意外结果。
- 可视化限制: SVG可视化是简化的示意图,不是真正的3D渲染。
- 性能考虑: 切片操作可能占用大量CPU资源。
使用教程
使用依赖
- Node.js 18或更高版本
- npm或yarn
安装教程
- 从npm安装:
npm install -g mcp-3d-printer-server
- 从源代码安装:
git clone https://github.com/yourusername/mcp-3d-printer-server.git
cd mcp-3d-printer-server
npm install
npm link
配置
创建.env
文件或设置环境变量:
API_KEY=your_api_key_here
PRINTER_HOST=localhost
PRINTER_PORT=80
PRINTER_TYPE=octoprint
TEMP_DIR=/path/to/temp/dir
调试方式
- 确保环境变量正确设置
- 运行服务器并检查日志输出
- 使用提供的工具进行测试
示例命令
- "What's the current status of my 3D printer?"
- "Show me the list of files on my printer."
- "Upload this G-code to my printer: [G-code content]"
- "Start printing the file named 'benchy.gcode'."
- "Cancel the current print job."
- "Set the extruder temperature to 200°C."
- "Set the bed temperature to 60°C."