Bambu Lab MCP Server

Bambu Lab MCP Server

Enables comprehensive control and monitoring of Bambu Lab 3D printers through Claude using local MQTT, FTPS, and X.509 authentication. Users can manage print jobs, monitor real-time status, handle filament through AMS, and adjust hardware settings like temperature and lighting.

Category
访问服务器

README

<div align="center">

Bambu Lab MCP Server

Model Context Protocol server for Bambu Lab 3D printers

License: MIT TypeScript MCP Node

Full control of Bambu Lab printers through Claude AI — MQTT, FTP, camera, AMS, and X.509 auth

Features · Quick Start · Tools · Background

</div>


Overview

Complete MCP server for Bambu Lab 3D printers (P1P, P1S, X1C, A1, A1 Mini). Connects over local MQTT for real-time control and monitoring, with FTPS file upload and X.509 certificate signing to bypass firmware authentication restrictions.

25 tools covering print control, status monitoring, camera, AMS filament management, temperature, LED control, and more.

Background

In January 2025, Bambu Lab pushed firmware updates requiring authentication for local LAN printer control, breaking all third-party tools — OctoPrint, Home Assistant integrations, custom scripts, everything.

Community researchers extracted the X.509 certificate and private key from the Bambu Connect desktop application, restoring third-party access. This MCP server builds on that work to provide comprehensive printer control through Claude.

Key references:

Features

  • Local MQTT control — Print, pause, resume, stop, speed profiles, G-code execution
  • Real-time status — Continuous caching from MQTT reports with cached + fresh status tools
  • Camera control — Start/stop recording and timelapse
  • AMS management — Change filament trays, unload filament
  • FTP file upload — FTPS upload to printer SD card (port 990)
  • X.509 signing — Bypass firmware auth restrictions with certificate signing
  • Temperature control — Set nozzle/bed temps with safety limits
  • Object skipping — Skip failed objects without stopping the print
  • Speed profiles — Silent, Standard, Sport, Ludicrous (or raw percentage)
  • LED control — Chamber and work lights
  • Safety validation — Blocked G-codes, temperature limits, path traversal prevention

Quick Start

Prerequisites

  • Node.js 18+
  • Bambu Lab printer on your local network
  • Printer LAN access code (printer screen -> WLAN -> Access Code)
  • Printer serial number (Settings -> Device -> Serial Number)

Install

git clone https://github.com/schwarztim/bambu-mcp.git
cd bambu-mcp
npm install
npm run build

Configure

cp .env.example .env
# Edit .env with your printer IP, access code, and serial number

Register with Claude Code

Add to ~/.claude/user-mcps.json:

{
  "mcpServers": {
    "bambu-lab": {
      "command": "node",
      "args": ["/path/to/bambu-mcp/dist/index.js"],
      "env": {
        "BAMBU_LAB_MQTT_HOST": "192.168.1.100",
        "BAMBU_LAB_MQTT_PASSWORD": "YOUR_ACCESS_CODE",
        "BAMBU_LAB_DEVICE_ID": "YOUR_SERIAL_NUMBER"
      }
    }
  }
}

Tools

Cloud API (4 tools)

Tool Description
get_user_profile Get Bambu Lab cloud account profile
list_printers List all printers registered to cloud account
get_printer_status Get printer status via cloud API
sign_message Sign message with X.509 certificate for firmware auth bypass

Print Control (7 tools)

Tool Description
printer_stop Stop the current print immediately
printer_pause Pause the current print
printer_resume Resume a paused print
printer_set_speed Set speed via profile (silent/standard/sport/ludicrous) or percentage
printer_send_gcode Send G-code command (dangerous commands blocked)
printer_print_file Start printing a file from printer SD card
skip_objects Skip specific objects during multi-object prints

Status & Info (3 tools)

Tool Description
printer_get_status Request full status push (temps, progress, AMS, fans, etc.)
printer_get_cached_status Return last cached status (no pushall — use for frequent polling)
printer_get_version Get firmware and module version info

Camera (2 tools)

Tool Description
camera_record Enable/disable camera recording
camera_timelapse Enable/disable timelapse recording

AMS & Filament (2 tools)

Tool Description
ams_change_filament Change to a different AMS tray (0-3)
ams_unload_filament Unload current filament from extruder

Hardware (3 tools)

Tool Description
set_temperature Set nozzle or bed temperature (with safety limits)
set_nozzle Set nozzle diameter for profile selection
led_control Control chamber/work LED lights

Connection & Upload (3 tools)

Tool Description
mqtt_connect Connect to printer via local MQTT over TLS
mqtt_disconnect Disconnect from MQTT
ftp_upload_file Upload .gcode/.3mf/.stl to printer via FTPS

Architecture

Claude Code / AI
    |
    v
Bambu Lab MCP Server
  |-- Cloud API (bambulab.com)
  |-- MQTT Client (port 8883, TLS)
  |-- FTP Client (port 990, FTPS)
    |
    v
Bambu Lab Printer (P1P/P1S/X1C/A1)

How It Works

  1. MQTT connects to the printer over TLS on port 8883 using the LAN access code
  2. Status reports are continuously cached as they arrive on the MQTT report topic
  3. Commands are sent on the MQTT request topic with sequence IDs for response matching
  4. FTP uploads files to the printer SD card over FTPS (port 990)
  5. X.509 signing uses the extracted Bambu Connect certificate for authenticated commands

Configuration

Environment Variables

Variable Required Description
BAMBU_LAB_MQTT_HOST For MQTT Printer IP address
BAMBU_LAB_MQTT_PASSWORD For MQTT LAN access code
BAMBU_LAB_DEVICE_ID For MQTT Printer serial number
BAMBU_LAB_MQTT_PORT No MQTT port (default: 8883)
BAMBU_LAB_MQTT_USERNAME No MQTT username (default: bblp)
BAMBU_LAB_COOKIES For cloud Session cookies for cloud API
BAMBU_LAB_BASE_URL No Cloud API base URL
BAMBU_APP_PRIVATE_KEY No Override the built-in X.509 private key
BAMBU_APP_CERTIFICATE No Override the built-in X.509 certificate

Finding Your Printer Info

  • IP Address: Printer screen → WLAN → IP
  • Access Code: Printer screen → WLAN → Access Code (8-digit)
  • Serial Number: Settings → Device → Serial Number

Security

X.509 Certificate

This server includes the publicly extracted X.509 certificate from the Bambu Connect desktop application. This is not a secret — it was publicly disclosed in January 2025 and is embedded in every copy of Bambu Connect.

The certificate can be overridden via BAMBU_APP_PRIVATE_KEY and BAMBU_APP_CERTIFICATE environment variables if Bambu Lab rotates credentials.

Safety Features

  • Blocked G-codes: M112 (emergency stop), M502 (factory reset), M500/M501 (EEPROM), M997 (firmware update), M999 (restart)
  • Temperature limits: Nozzle max 300C, bed max 120C
  • File validation: Only .gcode, .3mf, .stl uploads allowed
  • Path traversal prevention: No .. or absolute paths in FTP uploads

Best Practices

  1. Keep printers on a separate VLAN
  2. Rotate LAN access codes periodically
  3. Never commit .env files (already in .gitignore)

Acknowledgments

License

MIT — see LICENSE for details.

Disclaimer

Not affiliated with or endorsed by Bambu Lab. Use at your own risk.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选