Moonraker
The quiet piece in the middle of every modern Klipper setup. Moonraker is the web API server that exposes Klipper's state and control to the outside world — it is the reason a browser dashboard can drive your printer at all.
If you run Klipper, you almost certainly run Moonraker — it is the API server that front-ends, automation and integrations talk to. You will rarely interact with it directly; you will configure it once in moonraker.conf, point a UI at it, and then forget it exists. That invisibility is the point: it is infrastructure, not an interface.
What it is
Klipper splits a printer's brain in two: the real-time firmware on the microcontroller, and a host process (usually on a Raspberry Pi) that does the heavy planning. But Klipper itself has no web interface — it speaks over a Unix socket. Moonraker is the Python web server that wraps that socket and exposes it as a proper API: JSON-RPC over a WebSocket plus a REST-style HTTP interface.
Everything a graphical front-end does — stream temperatures, send G-code, upload and manage files, start a print, read job history — goes through Moonraker. It also handles concerns Klipper deliberately leaves out: update management (pulling new Klipper, Moonraker and UI versions), file and history management, webcam configuration, and notifications to services like ntfy or Discord. Mainsail and Fluidd are just browser clients sitting on top of it; swap one for the other and Moonraker does not care.
Where it wins
- One clean API, many clients. Because every front-end talks the same JSON-RPC / REST + WebSocket protocol, Mainsail, Fluidd, mobile apps and scripts all interoperate against a single, well-documented surface.
- Does the unglamorous work. Update management, file uploads, print history and webcam config live here so the UI and the firmware don't have to reinvent them.
- Decoupled by design. Separating the API from both the firmware and the UI means each layer evolves independently — you can change dashboards without touching your printer's motion code.
- Extensible. Plugins, notification back-ends and a webhook-style component system make it a natural hub for automation around the printer.
Where it still hurts
- It isn't a UI. Moonraker on its own gives you nothing to look at — you always need Mainsail, Fluidd or another client on top. Newcomers expecting a dashboard are often confused by what this layer actually does.
- Configuration is hand-rolled. The
moonraker.conffile, and especially the[authorization]block — trusted clients, CORS domains, API keys — trip people up when they put the printer behind a reverse proxy or access it from a new device. - It needs Klipper. Moonraker is purpose-built for Klipper and assumes it is there; it is not a generic print-server for arbitrary firmware.
- Version coupling. Moonraker, Klipper and the front-end move together; an out-of-step component can break the update manager or the connection until the versions are reconciled.
The AI angle
Moonraker is the cleanest entry point for putting intelligence around a printer. Because it exposes the full machine state — temperatures, position, job progress, history — and accepts G-code over a stable WebSocket, an agent or model can subscribe to live telemetry, react to events, and issue commands without ever touching firmware. Failure-detection from a webcam feed, automatic pause-on-spaghetti, queue orchestration across a fleet, or an LLM that watches a print and narrates what is happening: all of it talks to Moonraker. The API is the integration point that makes printers programmable.
Start here
- Read the official Moonraker documentation — the
moonraker.confand[authorization]sections are the ones worth understanding. - Source and issues: github.com/Arksine/moonraker.
- Easiest path: flash MainsailOS (or KIAUH on a fresh Pi), which installs Klipper, Moonraker and a front-end together.
- We did exactly this on ender-pi, our Pi 4 Klipper build for an Ender 3 V2, where Moonraker sits between Klipper and the Mainsail UI — notes and config at github.com/2nth-ai/ender-pi.
- For where this layer sits in the whole picture, read the Klipper stack explained.