Skip to main content
Glama
klipper-doctor-mcp

klipper-doctor-mcp

by kd-011

klipper-doctor-mcp

Ask your AI agent why a Klipper print stopped. This server gives it klipper-doctor's rules for klippy.log and printer.cfg, so the answer names the cause and cites the Klipper docs or source it comes from. It is read-only: it never moves, heats or writes anything on the printer.

The picture is a real Claude Code session against this server, recorded by scripts/record-session.mjs and drawn by scripts/render-assets.mjs. The log is test/fixtures/heater-verify.log, a synthetic one built from Klipper's message formats.

Try it

You need Node 18 or newer and an MCP client. This is for Claude Code; other clients are a config snippet.

claude mcp add klipper-doctor -- npx -y github:kd-011/klipper-doctor-mcp
curl -sO https://raw.githubusercontent.com/kd-011/klipper-doctor-mcp/main/test/fixtures/heater-verify.log
claude "My print stopped. The log is heater-verify.log in this folder. Why, and what should I try?"

The package is not on npm yet, which is why the command points at GitHub. npm builds it on the first start, which took about 20 seconds from a cold cache on my machine. If your client gives up before that, run npx -y github:kd-011/klipper-doctor-mcp --version once in a terminal and add it again.

For your own printer, add MOONRAKER_URL and the agent can fetch klippy.log and printer.cfg itself:

claude mcp add klipper-doctor -e MOONRAKER_URL=http://printer.local:7125 -- npx -y github:kd-011/klipper-doctor-mcp

Or run Claude Code on the printer's host and let it read ~/printer_data/logs/klippy.log.

Related MCP server: prusactl

What it gives the agent

Five tools: diagnose_log (why a print or session died, plus a lint of the config Klipper wrote into the log), lint_config, list_rules, explain_rule and printer_status. The log can be pasted text, a file path, or fetched from Moonraker. The reference has the inputs and settings, and an example report shows the text the agent gets back.

The code enforces read-only. The Moonraker client can only send GET to a short list of read endpoints, every tool is marked read-only, and a test fails if any request leaves that list. Logs can contain hostnames, usernames, IP addresses and serial numbers, and whatever the agent reads goes to your AI provider, so check what you share. KLIPPER_DOCTOR_ALLOWED_DIRS limits which files it can open.

Other tools

Searched in November 2026. Most Klipper MCP servers on GitHub are about control. Charleslotto/klipper-mcp exposes over a hundred tools including G-code, print control and TMC drivers. nixkor/moonraker-mcp controls prints with a confirmation step on risky calls. mikehatch/KlipperMCP reads and edits config files. OctoEverywhere runs a hosted MCP server for several printer types. In that search I did not find one that applies rules to klippy.log. I have run none of them, so this is from their READMEs.

They run next to this one. If you want your agent to drive the printer, use one of those. If you want it to work out why Klipper stopped, with sources, use this.

When not to use it

  • You have no Klipper. It knows nothing about Marlin or Bambu printers.

  • The failure left no trace in klippy.log. A wobbly bed or a clogged nozzle will not show up.

  • You just want a report. The klipper-doctor CLI does the same analysis with npx klipper-doctor klippy.log, and hotend.app/klipper-doctor does it in a browser with nothing installed.

  • You cannot send a log to an AI provider. The analysis itself runs locally, but the agent then reads the result and the log.

More limits are in the reference.

Develop

git clone https://github.com/kd-011/klipper-doctor-mcp
cd klipper-doctor-mcp
npm ci && npm test

See CONTRIBUTING.md. A wrong diagnosis is a klipper-doctor issue, since the rules live there. MIT licence, release notes in CHANGELOG.md.

Available Tools

5 tools
diagnose_logDiagnose a klippy.logA
Read-onlyIdempotent

Use when a Klipper print stopped, failed or shut down, or the printer shows an error. Reads a klippy.log and explains why the print or session died, plus lint the printer.cfg that Klipper wrote into the log. Give exactly one of text, path or moonraker. Read-only: it never touches the printer.

Inputs: path, text, moonraker. Returns: counts, report, source, summary

explain_ruleExplain a ruleA
Read-onlyIdempotent

Explain one klipper-doctor rule by id: what it catches, the usual fix, and the Klipper docs page it comes from. Ids come from list_rules or from a finding.

Inputs: id (required). Returns: rule

lint_configLint a printer.cfgA
Read-onlyIdempotent

Lint a Klipper printer.cfg (or the config inside a klippy.log) and return config findings only, no crash report. Give exactly one of text, path or moonraker. With moonraker, config_file picks a file in the config root (default printer.cfg). Read-only.

Inputs: path, text, moonraker, config_file. Returns: counts, report, source, summary

list_rulesList klipper-doctor rulesA
Read-onlyIdempotent

List every rule the klipper-doctor engine can fire, with its id, severity and one-line title. Use explain_rule for the full text.

Inputs: kind. Returns: rules

printer_statusMoonraker's reported printer stateA
Read-onlyIdempotent

Ask Moonraker for Klippy's state and state message (which holds the last error when Klippy is in error or shutdown) and the print state. Needs MOONRAKER_URL. Read-only: two GET requests.

Inputs: no named parameters. Returns: print, klippy, warnings

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 5 tools

    Disambiguation4/5

    Most tools are clearly distinct: diagnose_log handles crash/failure analysis, list_rules and explain_rule cover the rule catalog, and printer_status queries Moonraker state. The main overlap is diagnose_log and lint_config, since both can lint a printer.cfg or the config embedded in a klippy.log, though the descriptions clarify that diagnose_log adds crash diagnosis while lint_config returns config findings only.

    Naming Consistency4/5

    All names use snake_case, and four of five follow a clear verb_noun pattern: diagnose_log, lint_config, list_rules, and explain_rule. printer_status is noun_noun rather than verb_noun, a minor deviation that remains readable and predictable.

    Tool Count5/5

    Five tools is well scoped for a Klipper diagnostics server. Each tool has a clear role: diagnose logs, lint configs, browse rules, explain a rule, and check printer status.

    Completeness5/5

    The surface covers the core read-only diagnostic workflow: inspect a failed print or shutdown, lint configuration, query live Klippy/print state, and discover or explain every diagnostic rule. There are no obvious lifecycle gaps for a read-only troubleshooting server.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to monitor and control Prusa 3D printers over PrusaLink or Prusa Connect, including status and camera checks, file upload and print control, G-code execution, queue and history access, and responding to printer dialogs.
      1
      MIT
    • A
      license
      C
      quality
      C
      maintenance
      Exposes Klipper and Moonraker capabilities to LLM clients through a typed MCP API of tools, resources, and prompts, enabling offline printer.cfg/include validation, AST-based extras development, assisted log and telemetry diagnostics, and controlled G-code execution with safeguards for dangerous commands. It also provides caching, coalescing, circuit breaking, and token-economy optimizations for resilient, observable operation of the printer stack.
      17
      GPL 3.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables an agent to inspect, slice, upload, start, and monitor jobs on a Moonraker/Klipper 3D printer end to end, using one JSON profile for machine-specific configuration. Built-in safety checks block unsafe starts such as incomplete G-code, nozzle mismatches, hot beds, or running jobs.
      MIT