Klipper MCP Server
An MCP server that enables AI assistants to control and monitor Klipper 3D printers via the Moonraker API. It supports comprehensive printer management, including G-code execution, toolchanger operations, and real-time status monitoring.
README
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.
Features
Core Printer Control
- Get printer status, temperatures, and position
- Run G-code commands
- Start, pause, resume, and cancel prints
- Home axes and emergency stop
- Klipper firmware restart
StealthChanger Toolchanger
- Select tools (T0-T5)
- Initialize toolchanger
- Tool alignment workflow
- Crash detection control
- Tool dock/pickup operations
LED Effects (klipper-led_effect)
- Set LED effects and animations
- Stop effects (single or all)
- LED scene presets (idle, printing, complete, etc.)
- Direct LED color control
File Operations
- List and read G-code files
- Upload and delete files
- Search within files
- Get G-code metadata
Camera & Timelapse
- Capture webcam snapshots
- Get stream URLs
- Timelapse settings and control
- Manual frame capture
Print Statistics
- Print history with filtering
- Cumulative totals (time, filament)
- Filament usage analysis
- Recent prints summary
Diagnostics
- Parse klippy.log for errors
- Common issue detection
- MCU status
- G-code history
- Problem troubleshooting guide
Temperature & Bed Mesh
- Temperature history
- Anomaly detection
- Bed mesh profiles
- Mesh calibration
Spoolman Integration
- List and track filament spools
- Set active spool
- Low filament warnings
- Usage by material
Notifications
- Discord, Slack, Pushover webhooks
- Text-to-speech announcements
- Print completion alerts
- Temperature alerts
Backup & Maintenance
- Config file backup/restore
- Maintenance logging
- Due maintenance alerts
- Data export
G-code Analysis
- File analysis and metadata
- Comment extraction
- Move statistics
- Layer extraction
- Validation checks
Installation
On CB1 (BigTreeTech)
-
Clone or copy files to CB1:
cd ~ git clone <repo-url> klipper-mcp # Or copy files via SCP/SFTP -
Run the installer:
cd ~/klipper-mcp chmod +x install.sh ./install.sh -
Configure settings:
nano ~/klipper-mcp/config.pyUpdate these settings:
MOONRAKER_URL: Usuallyhttp://localhost:7125PRINTER_NAME: Your printer nameAPI_KEY: Generate a secure keyADMIN_PIN: Set a PIN for destructive operationsARMED: Set toTruewhen ready
-
Start the service:
sudo systemctl start klipper-mcp sudo systemctl status klipper-mcp
Manual Installation
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run server
python server.py
VS Code Configuration
Add to your VS Code mcp.json:
{
"mcpServers": {
"voron": {
"type": "http",
"url": "http://192.168.2.87:8000/mcp",
"headers": {
"X-API-Key": "your-api-key"
}
}
}
}
Replace 192.168.2.87 with your CB1's IP address.
Security
ARMED Flag
Dangerous operations (G-code execution, temperature changes) require ARMED=True in config.
Admin PIN
Destructive operations (file deletion, config restore) require the admin PIN.
Audit Log
All operations are logged to data/audit.log for security review.
Configuration Reference
# config.py
# Moonraker connection
MOONRAKER_URL = "http://localhost:7125"
PRINTER_NAME = "Voron"
# MCP Server
MCP_HOST = "0.0.0.0"
MCP_PORT = 8000
MCP_TRANSPORT = "http" # or "stdio"
# Security
API_KEY = "your-secret-key"
ARMED = False # Set True to enable dangerous ops
ADMIN_PIN = "1234"
# Camera
CAMERA_SNAPSHOT_URL = "http://localhost/webcam/?action=snapshot"
CAMERA_STREAM_URL = "http://localhost/webcam/?action=stream"
# Spoolman (optional)
SPOOLMAN_ENABLED = False
SPOOLMAN_URL = "http://localhost:7912"
# Notifications (optional)
DISCORD_WEBHOOK_URL = ""
SLACK_WEBHOOK_URL = ""
PUSHOVER_USER_KEY = ""
PUSHOVER_API_TOKEN = ""
# Text-to-Speech (optional)
TTS_ENABLED = False
TTS_RATE = 150
TTS_VOLUME = 1.0
# Maintenance intervals (hours)
MAINTENANCE_INTERVALS = {
"nozzle": 200,
"belts": 500,
"linear_rails": 1000,
"filters": 100
}
# StealthChanger
TOOL_COUNT = 4
Troubleshooting
Server won't start
- Check Moonraker is running:
systemctl status moonraker - Verify config.py settings
- Check logs:
tail -f /var/log/klipper-mcp.log
Can't connect from VS Code
- Verify CB1 IP address
- Check firewall allows port 8000
- Verify API key matches
Operations failing
- Check
ARMED=Truefor dangerous operations - Verify Klipper is running and ready
- Check klippy.log for errors
License
MIT License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。