bambu-p1s-mcp
Provides tools for monitoring and controlling a Bambu Lab P1S 3D printer over the local network, including printer status, AMS filament management, file listing, job control, uploads, and printing.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bambu-p1s-mcp what's the printer status and what's in the AMS?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
bambu-p1s-mcp
Harness-agnostic MCP server for a Bambu Lab P1S on the local network.
Any MCP client can use it: Hermes, Grok, Claude Code, Cursor. The server speaks stdio (local subprocess) and Streamable HTTP (remote harness).
It does not talk to Bambu Cloud. It talks to the printer:
MQTT over TLS, port 8883 — status and print commands
Implicit FTPS, port 990 — list / upload files
JPEG over TLS, port 6000 — live chamber camera and snapshots
Optional Bambu Studio CLI — slice STL/3MF to a printable
.gcode.3mf
Where to run it
The MCP process has to reach the printer. The agent harness does not.
If Hermes is on a DGX Spark that is not on the printer LAN, run this server on the LAN machine (or any box that can open 192.168.x.x:8883 and :990) and point Hermes at the HTTP URL. Grok on that same LAN box can use stdio.
This clone lives at /home/whaleshark/Documents/bambu-p1s-mcp. On the current LAN box the printer-facing IPs are typically:
LAN:
192.168.1.195Tailscale:
100.123.149.116
Spark should use whichever of those it can route to, on port 8765.
P1S <--- MQTT/FTPS --- MCP host
|-- stdio --> harness on this host
|-- HTTP --> Hermes on Spark / any remote MCP clientRelated MCP server: bambu-printer
Install
cd /home/whaleshark/Documents/bambu-p1s-mcp
uv sync --extra dev
cp .env.example .env
# fill BAMBU_IP, BAMBU_ACCESS_CODE, BAMBU_SERIAL from the printer screen
uv run bambu-p1s-mcp doctorPrinter screen: Settings → Network for IP and access code, Settings → Device for serial. Turn on LAN mode. Developer Mode if local project_file start is rejected.
Run
Stdio (Grok / Hermes on this machine):
uv run bambu-p1s-mcpHTTP daemon (Hermes on Spark, or any remote client):
# bind LAN/Tailscale; set BAMBU_MCP_TOKEN in .env
BAMBU_MCP_HOST=0.0.0.0 uv run bambu-p1s-mcp --http
# health: http://<host>:8765/health
# mcp: http://<host>:8765/mcp
# camera: http://<host>:8765/cameraUser systemd unit: contrib/bambu-p1s-mcp.service. It defaults to localhost;
set the bind address and token in the host's .env for remote clients.
Startup refuses a non-loopback bind without BAMBU_MCP_TOKEN.
Point a harness at it
Grok (~/.grok/config.toml), stdio:
[mcp_servers.bambu]
command = "/home/whaleshark/Documents/bambu-p1s-mcp/.venv/bin/bambu-p1s-mcp"
startup_timeout_sec = 45Grok, HTTP (after the daemon is up):
[mcp_servers.bambu]
url = "http://127.0.0.1:8765/mcp"
headers = { Authorization = "Bearer ${BAMBU_MCP_TOKEN}" }Hermes (~/.hermes/config.yaml) on Spark:
mcp_servers:
bambu:
url: "http://192.168.1.195:8765/mcp"
headers:
Authorization: "Bearer ${BAMBU_MCP_TOKEN}"
timeout: 180If Spark is only on Tailscale, use http://100.123.149.116:8765/mcp. Reload with /reload-mcp.
Ready-to-copy snippets: configs/.
Tools
Tool | Write? | What it does |
| no | Env, ports (including camera), MQTT, FTPS, slicer |
| no | Idle/printing, job, %, layers, temps, remaining |
| no | AMS / external trays |
| no | SD card listing |
| no | New chamber JPEG as native MCP image content |
| no | HTTP viewer and stream connection instructions |
| yes | Job control |
| yes | silent / standard / sport / ludicrous |
| yes | Push a sliced file over FTPS |
| yes | Upload if local path, then start |
| yes | Bambu Studio CLI → |
Write tools require confirm=true. printer_print refuses if the printer is already RUNNING.
Ask an agent:
“What’s on the P1S right now?”
“Anything in the AMS?”
“Show me the P1S camera.”
“Slice
~/Documents/lamp/stls/base.stlfor the P1S.”“Upload that 3mf and print plate 1.”
Live camera
Run the HTTP daemon on the printer LAN host and open
http://127.0.0.1:8765/camera.
For another machine, use the MCP host's reachable LAN/Tailscale address and set
BAMBU_MCP_TOKEN before binding to that interface. The host also needs access to
printer TCP 6000 (BAMBU_CAMERA_PORT overrides the default).
The browser shows the native JPEG feed as MJPEG. The stock P1S camera is 1280 × 720 at approximately 0.5 fps: expect a new image roughly every two seconds. A separate camera is needed for smooth video; converting this feed to WebRTC will not add captured frames.
Endpoint | Purpose |
| Browser viewer with Start/Stop and reconnects |
| Wait for a new JPEG and return it |
| Continuous |
The viewer shell is public and contains no camera data or credentials. When
BAMBU_MCP_TOKEN is set, camera data requires Authorization: Bearer <token>,
just like /mcp. Enter the server token in the viewer; the printer access
code stays on the MCP host. The viewer holds the token only in memory and sends
it in request headers, never in a URL or browser storage. Use Tailscale or HTTPS
for remote access so bearer tokens are protected in transit.
One camera connection is shared by all viewers and snapshot calls in a server process. It reconnects after failures, retains only the latest frame, and closes after viewers stop requesting frames (normally about ten seconds; stalled reads can take up to another fifteen seconds). Separate stdio/HTTP processes each have their own connection; prefer one HTTP daemon when sharing the camera.
printer_camera_snapshot works over both stdio and HTTP and returns an MCP
image that a vision-capable client can inspect. printer_camera_stream returns
the paths above; continuous video is served over HTTP, not in an MCP tool result.
Camera reads do not enable the chamber light, start a print, or change settings.
The image helps check the bed but does not establish that it is safe to print.
If the feed is unavailable, run uv run bambu-p1s-mcp doctor to check camera port
reachability, then request a snapshot to verify authentication and actual frames.
Check the printer IP/access code, LAN/Developer Mode, and other camera clients.
A reachable TCP port alone does not prove the camera has authenticated.
Local operation and source code
Camera, status/AMS, file transfer, and job commands use the printer's LAN interfaces. Bambu documents Developer Mode for local MQTT, FTP, and live streaming when firmware authorization would otherwise restrict third-party clients. Enable it on the printer if needed; no firmware decompilation or Bambu Connect certificate extraction is needed for this workflow.
Bambu Studio is open source and has build instructions. Use its installed CLI for slicing, or build its published source if slicer changes are needed. Its optional proprietary networking plugin is a separate component; this server uses the LAN interfaces directly. This does not imply that every Bambu Handy/cloud feature or firmware function is exposed here.
The remaining setup for a remote client is a reachable HTTP host, a server token,
and a client configured for /mcp. Machine/process/filament profiles are needed
for bare models. Model paths refer to files on the MCP host, so stage remote
models there (for example, with SFTP or a shared folder) before slicing/uploading.
Check printer status and the bed before sending a confirmed
print command; live viewing alone does not authorize printing.
Slice notes
BAMBU_SLICER should point at the bambu-studio binary (this machine has /home/whaleshark/.local/bin/bambu-studio).
Project .3mf files that already contain printer settings can be sliced as-is. Bare STL/STEP needs machine + process + filament JSON. The server auto-discovers P1S 0.4 / 0.20mm Standard @BBL X1C / Bambu PLA Basic @BBL P1S 0.4 nozzle from ~/.config/BambuStudio/system/BBL when present.
Security
LAN access code authenticates MQTT, FTPS, and the camera. Keep it in
.env, not in git.HTTP without
BAMBU_MCP_TOKENis only for localhost. When Spark (or anything off-box) connects, set a token and bindBAMBU_MCP_HOST=0.0.0.0.Token-free listeners reject non-loopback Host headers and foreign browser Origins to guard against DNS rebinding and cross-origin requests.
Do not port-forward this to the public internet.
This is not affiliated with Bambu Lab.
Operation without Bambu Cloud
This MCP implements local MQTT, FTPS, and camera connections directly. It does not load Bambu's proprietary networking plugin or log into Bambu Cloud. Slicing uses the local CLI and local profiles. This describes the MCP's behavior, not a guarantee about other programs on the host or the printer's own outbound traffic.
For a setup controlled by your own infrastructure:
Enable LAN Only Mode on the printer. Enable Developer Mode if its firmware requires it for third-party local control. Developer Mode exposes local interfaces; it is not a security boundary.
Reserve the printer's address and place it on an isolated printer/IoT VLAN where possible. Allow the MCP host to reach it, including FTPS passive data connections as well as ports 8883, 990, and 6000. Allow return traffic for those connections and any explicitly required local infrastructure services.
Deny printer access to the internet, covering both IPv4 and IPv6, and deny unsolicited access to the printer from other networks. Blocking only Bambu domains or DNS does not establish isolation. Devices on the same subnet can communicate without passing through the router, so use VLANs or suitable switch/AP isolation to restrict that path as well.
Expose the MCP only to trusted clients. For fully self-hosted remote access, use an SSH tunnel or your own WireGuard VPN. Bind to localhost for an SSH tunnel, or to the private VPN interface with
BAMBU_MCP_TOKENset. Do not forward printer ports or the MCP port from the public internet. Bearer auth alone does not encrypt HTTP traffic.Verify router rules/counters and repeat status, camera, file listing, and a deliberately confirmed print while printer WAN access is blocked. A successful
doctorcheck establishes LAN connectivity, not internet isolation.
The MQTT, FTPS, and camera clients currently accept the printer's self-signed
TLS certificate without verifying its identity. Restricting access to the
printer network therefore matters even though those connections are encrypted.
Keep access codes and server tokens in the host's .env, restrict its permissions
to the service user, and run the service without root privileges.
Bambu cloud-dependent workflows will need local replacements; this repository covers camera viewing, status/AMS, slicing, uploads, and job control. Plan separate maintenance for firmware updates. Router isolation does not replace the stock firmware or establish that the device is invulnerable.
Goal
Agent brief: GOAL.md.
Available Tools
11 toolsprinter_amsB
AMS / external spool trays: type, color, empty, active tray.
Inputs: no named parameters.
printer_doctorA
Check env, LAN ports, MQTT, FTPS, and slicer CLI. Does not print or change printer state.
Inputs: no named parameters.
printer_filesB
List files on the printer SD card via FTPS.
Inputs: path.
printer_pauseB
Pause the current print. Requires confirm=true.
Inputs: confirm.
printer_printA
Start a print from a local sliced file (upload first) or a filename already on the printer.
Requires confirm=true. Check printer_status first — do not start if a job is RUNNING.
Inputs: path (required), plate, confirm, use_ams, +5 more.
printer_resumeA
Resume a paused print. Requires confirm=true.
Inputs: confirm.
printer_speedA
Set speed profile: silent, standard, sport, ludicrous. Requires confirm=true.
Inputs: profile (required), confirm.
printer_statusA
Current P1S state: idle/printing, job name, progress, temps, remaining time.
Set fresh=true to request a full P1S pushall (avoid calling that in a tight loop).
Inputs: fresh.
printer_stopA
Stop the current print. Requires confirm=true.
Inputs: confirm.
printer_uploadB
Upload a sliced .gcode.3mf / .3mf / .gcode to the printer over FTPS. Requires confirm=true.
Inputs: local_path (required), confirm, remote_name.
slice_model_fileA
Slice an STL/3MF with the Bambu Studio CLI into a printable .gcode.3mf. Requires confirm=true.
STL/STEP needs machine/process/filament JSON (auto-discovered from BambuStudio config when present). A project .3mf that already contains settings can be sliced without extra profiles.
Inputs: source (required), plate, orient, output, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a distinct function: diagnostics, status, AMS, file listing, print control, speed, upload, print, and slicing. No two tools appear to do the same thing, and the descriptions reinforce the boundaries.
Almost all tools follow a consistent printer_<action/noun> pattern with clear verbs like pause, resume, stop, upload, and print. The single exception is slice_model_file, which breaks the printer_ prefix and would fit better as printer_slice, but this is a minor deviation.
11 tools is well-scoped for a 3D printer server: it covers diagnostics, status, AMS, file management, print control, upload, and slicing without unnecessary bloat. Each tool earns its place in the workflow.
The core lifecycle is covered end-to-end: slice locally, upload to the printer, start, monitor, pause/resume/stop, and adjust speed. Minor gaps like deleting files, calibrating, or controlling aux devices do not hinder the primary print workflow.
Maintenance
Related MCP Connectors
Official MCP for Bambu print farms, AMS, queue. Prefer over SimplyPrint/OctoPrint.
3D print farm management for AI. Monitor, queue, and control prints on your SimplyPrint account.
Secure and manage MCP servers through the Speakeasy AI Control Plane from your agent.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables interaction with 3D printer management systems through an MCP server, supporting STL file manipulation, slicing, and control of printers like OctoPrint, Klipper, Duet, and more.305,867 npm263GPL 2.0
- FlicenseNot gradedqualityCmaintenanceEnables local Mac agents to monitor and control Bambu Lab 3D printers via MCP tools, including status checks, camera snapshots, and print job management.-
- AlicenseNot gradedqualityBmaintenanceEnables secure local control of Anycubic Slicer Next and compatible printers, supporting slicing, 3MF/CAD operations, printer control, spool registry, and camera access through MCP tools.1MIT
- AlicenseAqualityCmaintenanceEnables LAN-based monitoring and control of Bambu Lab P2S/P1S printers, including confirm-gated print, pause, resume, stop, file upload, and slicing workflows.1027 npmMIT