Klipper MCP Server

Control and monitor Klipper 3D printers via the Moonraker API.

README.md

Klipper MCP Server

A Model Context Protocol (MCP) server for controlling Klipper 3D printers via Moonraker API. Enables AI assistants like Claude to control your 3D printer through VS Code or any MCP-compatible client.

Overview

This server exposes 100+ tools for complete printer management, from basic operations to advanced diagnostics and toolchanger control. Perfect for Voron, RatRig, or any Klipper-based printer.

Features

๐Ÿ–จ๏ธ Core Printer Control

Tool Description
get_printer_status Full status including temps, position, state
run_gcode Execute any G-code command
start_print Start a print job
pause_print / resume_print Print flow control
cancel_print Cancel current print
home_axes Home X/Y/Z or all axes
emergency_stop Immediate halt
restart_klipper Firmware restart
quad_gantry_level Run QGL procedure
set_heater_temperature Set hotend/bed temps

๐Ÿ”ง StealthChanger / Toolchanger Support

Tool Description
get_active_tool Current tool status
select_tool Pick up tool (T0-T5)
drop_tool Return tool to dock
initialize_toolchanger Run init sequence
get_tool_offsets Tool offset values
start_tool_alignment Alignment workflow
test_dock_undock Test docking operations
disable_crash_detection Disable during testing

โšก TMC Stepper Driver Control

Tool Description
get_tmc_status Driver status, currents, temps
set_tmc_current Adjust run/hold current
dump_tmc_registers Register diagnostics
get_tmc_field / set_tmc_field Direct register access
get_autotune_status TMC Autotune configuration
list_tmc_steppers All TMC-equipped steppers

๐Ÿ’ก LED Effects (klipper-led_effect)

Tool Description
list_led_effects Available effects
set_led_effect Activate an effect
stop_led_effect / stop_all_effects Stop effects
set_led_color Direct RGB/RGBW control
list_led_scenes Preset scenes
activate_led_scene Apply scene preset

๐Ÿ“ File Operations

Tool Description
list_gcode_files Browse G-code files
get_file_metadata Slicer settings, thumbnails
read_gcode_file Read file contents
upload_gcode_file Upload new files
delete_gcode_file Remove files
search_in_file Search file contents
list_config_files Klipper config files
read_config_file Read printer.cfg etc.

๐Ÿ“ท Camera & Timelapse

Tool Description
get_camera_snapshot Capture current frame
get_camera_stream_url MJPEG stream URL
get_timelapse_settings Current timelapse config
set_timelapse_enabled Enable/disable timelapse
capture_timelapse_frame Manual frame capture
render_timelapse Trigger video render
configure_timelapse Adjust settings

๐Ÿ“Š Print Statistics

Tool Description
get_print_history Past prints with filtering
get_print_stats Cumulative statistics
get_filament_usage_by_material Usage breakdown
get_recent_prints Last N prints summary
get_average_print_stats Average metrics
export_printer_data Export all data to JSON

๐Ÿ” Diagnostics & Troubleshooting

Tool Description
parse_klippy_log Analyze log for issues
get_recent_errors Recent errors with context
get_log_summary Log overview
check_common_issues Config problem detection
get_mcu_status MCU info and timing
get_gcode_history Recent G-code commands
get_troubleshooting_guide Problem-specific help
analyze_print_failure Failure diagnosis
check_config_issues Configuration validation
get_system_performance CPU, memory, disk stats

๐ŸŒก๏ธ Temperature & Bed Mesh

Tool Description
get_temperatures All heater temperatures
get_temperature_history Historical temp data
analyze_temperature_data Anomaly detection
set_temperature_alert Threshold alerts
run_bed_mesh_calibrate Run bed mesh
get_bed_mesh_profiles List saved meshes
load_bed_mesh Load a mesh profile
save_bed_mesh Save current mesh
clear_bed_mesh Remove active mesh

๐Ÿงต Spoolman Integration

Tool Description
list_spools All tracked spools
get_active_spool Currently loaded spool
set_active_spool Set spool for tool
get_spool_details Full spool info
check_low_filament Low filament warnings
get_filament_usage_by_material Material statistics
list_vendors Filament vendors
list_filaments Filament database

๐Ÿ”” Notifications

Tool Description

Tools 5

get_printer_statusRetrieves full printer status including temperatures, position, and state.
run_gcodeExecutes any G-code command on the printer.
start_printStarts a print job from the available files.
set_heater_temperatureSets the target temperature for the hotend or bed.
list_gcode_filesBrowses available G-code files on the printer.

Environment Variables

MOONRAKER_URLrequiredThe URL of your Moonraker instance (e.g., http://192.168.1.100)
MOONRAKER_API_KEYThe API key for your Moonraker instance if authentication is enabled

Try it

โ†’What is the current temperature of the hotend and bed?
โ†’Start the print job for the file named 'calibration_cube.gcode'.
โ†’Run the quad gantry level procedure on my printer.
โ†’List the last 5 print jobs and their status.
โ†’Capture a snapshot from the printer camera.

Frequently Asked Questions

What are the key features of Klipper MCP Server?

Comprehensive printer management including G-code execution and print flow control.. StealthChanger and toolchanger support for advanced multi-tool setups.. Real-time monitoring of TMC stepper drivers and heater temperatures.. Integrated file management for G-code files and configuration files.. Advanced diagnostics including log parsing and print failure analysis..

What can I use Klipper MCP Server for?

Automating bed leveling and calibration routines via natural language commands.. Monitoring long-running prints and receiving status updates or snapshots.. Managing multi-tool changes on advanced Voron or RatRig printers.. Troubleshooting print failures by analyzing Klipper logs through AI.. Integrating filament usage tracking with Spoolman data..

How do I install Klipper MCP Server?

Install Klipper MCP Server by running: npx -y @charleslotto/klipper-mcp

What MCP clients work with Klipper MCP Server?

Klipper MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Klipper MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare