Skip to main content
Glama
EthanPany

thermal-mcp

by EthanPany

thermal-mcp 🧾

Print beautiful HTML & Markdown on a $30 thermal receipt printer, straight from your AI agent.

thermal-mcp is an MCP server that turns any 58mm ESC/POS thermal printer into a typographic output device for LLM agents. The agent hands over Markdown or HTML; the server renders it in headless Chromium (2Γ— supersampled), converts it to 1-bit with quality dithering, encodes ESC/POS, and ships it to the printer over USB, Bluetooth serial, or CUPS β€” wired preferred, automatically.

agent ──MCP──► render (Chromium @2x) ──► 1-bit (Atkinson/Jarvis/Bayer + CLAHE)
              ──► ESC/POS (heat-tuned, blank-line elision) ──► USB / BT / CUPS

Why it's nice

  • Markdown in, ticket out β€” GFM plus syntax-highlighted code (monochrome scheme), mermaid diagrams, LaTeX math (KaTeX), task lists, tables, remote images. Three type-size tiers.

  • Full custom HTML when the agent wants layout control: real Chromium, so flexbox/grid/SVG/emoji/web fonts all work.

  • Offline font library β€” Geist Sans/Mono, Inter, JetBrains Mono, Space Grotesk, Lora, Playfair Display, Caveat, Noto Sans SC, plus Font Awesome icons, all bundled and loaded via file://.

  • Print quality obsessed β€” supersampled rendering, CLAHE + unsharp photo pipeline, three dither algorithms, ESC/POS heat/density tuning (ESC 7, DC2 #), blank-line elision, paced Bluetooth writes. Calibrated on real hardware.

  • Exact previews β€” preview_* tools return the true 1-bit image that will print, so agents iterate without wasting paper.

  • <img data-qr="..."> becomes a scannable QR code, generated server-side.

Related MCP server: ShotAPI

Tools

tool

what it does

print_markdown { markdown, size?, feed_lines? }

quick path: markdown β†’ house-styled ticket

preview_markdown { markdown, size? }

exact 1-bit preview, no paper

print_html { html, mode?, algorithm?, feed_lines? }

full custom design

preview_html { html, mode?, algorithm? }

exact 1-bit preview

printer_status {}

transport + printer state

design_guide {}

returns the full design guide (fonts, layout, house style) β€” client-agnostic, works in Claude Desktop

mode: auto (detect photos, keep text sharp) / text / photo Β· algorithm: atkinson / jarvis / bayer Β· size: large 24px / medium 19px / small 14px.

Setup

git clone https://github.com/EthanPany/thermal-mcp && cd thermal-mcp
npm install
npx puppeteer browsers install chrome
npm run smoke   # renders out/smoke.png without a printer

Register with Claude Code:

claude mcp add --scope user thermal --env THERMAL_TRANSPORT=auto \
  -- "$(which node)" /absolute/path/to/thermal-mcp/node_modules/tsx/dist/cli.mjs \
     /absolute/path/to/thermal-mcp/src/index.ts

Claude Desktop (claude_desktop_config.json). Use absolute paths β€” GUI apps launch with a minimal PATH and won't find npx/tsx on their own:

"thermal": {
  "command": "/absolute/path/to/node",
  "args": [
    "/absolute/path/to/thermal-mcp/node_modules/tsx/dist/cli.mjs",
    "/absolute/path/to/thermal-mcp/src/index.ts"
  ],
  "env": { "THERMAL_TRANSPORT": "auto" }
}

Design guidance. In Claude Code, optionally install the skill so it auto-loads:

ln -s /absolute/path/to/thermal-mcp/skills/thermal-print ~/.claude/skills/thermal-print

In Claude Desktop (or any other MCP client) the skill mechanism isn't available, but the same guidance is served over MCP by the design_guide tool β€” the agent calls it before designing. No extra setup.

Printer configuration

THERMAL_TRANSPORT=auto (default) probes in order: USB (any printer-class device) β†’ Bluetooth SPP serial (THERMAL_DEVICE, default /dev/cu.MPT-II) β†’ dry-run (writes PNG + ESC/POS bytes to out/). Or force usb / serial / lp-raw / lp-image / file.

Darkness: by default the server sends only ESC @ and uses the printer's firmware-default darkness β€” clean, no bleed. Hardware heat/density commands are opt-in because some clone firmwares (incl. the MPT-II tested here) misparse ESC 7 and leak a parameter byte as a stray glyph. Set these only if your firmware honors them and you need to push darker:

env

meaning

default

THERMAL_HEAT_TIME

ESC 7 n2 β€” heat pulse Γ—10Β΅s (darker); enables ESC 7

unset

THERMAL_HEAT_DOTS

ESC 7 n1 β€” dots per strobe = 8Γ—(n+1)

3 (if ESC 7 on)

THERMAL_HEAT_INTERVAL

ESC 7 n3 β€” recovery Γ—10Β΅s (fixes fading)

60 (if ESC 7 on)

THERMAL_DENSITY

DC2 # density 0–31; enables DC2 #

unset

THERMAL_BREAK

DC2 # per-line break time 0–7

4 (if DC2 # on)

THERMAL_THIN

software stroke-thinning 0–2 (0.3–0.6 lightens fat Latin text; >0.7 breaks small/CJK text)

0 (off)

THERMAL_MAX_PX

max ticket height in px; taller content is truncated with a warning (roll-saver)

12000 (~1.5m)

THERMAL_DITHER

default photo algorithm

atkinson

THERMAL_CHUNK / THERMAL_PACE_MS

Bluetooth pacing

256 / 30

Tested on a Sunydog 58mm (USB 6868:0200, Bluetooth "MPT-II") on macOS. Any printer speaking GS v 0 raster should work.

License

MIT

Available Tools

6 tools
design_guideA

Read this FIRST before designing any thermal ticket. Returns the full design guide: the two paths (markdown vs custom HTML), type-size tiers, the bundled font/icon library, graphics helpers, house style, and layout best practices for 58mm 1-bit thermal paper. Client-agnostic (works in Claude Desktop, which does not load the Claude Code skill).

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of disclosing behavior. It describes what the tool returns (the full design guide) and lists its contents: the two paths, type-size tiers, font/icon library, graphics helpers, house style, and layout best practices. It also discloses the client-agnostic behavior. It does not explicitly state that the tool is read-only, but the nature of 'Returns' implies no side effects, making this a strong but not perfect disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences, each earning its place. The first sentence is a directive, the second lists the guide's contents, and the third addresses a potential client-specific caveat. It is front-loaded with the most important instruction ('Read this FIRST') and contains no fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool with no output schema, the description provides a complete picture: what the tool does, what it contains, when to use it, and a client-specific caveat. It fully covers the purpose and usage, and the absence of output schema means no return-form documentation is needed. The description is sufficient for an agent to invoke this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the baseline is 4. The description does not need to explain parameter details, but it adds context about what the guide contains, which is relevant for the user's decision to call the tool. The schema adds nothing since it is empty, so the description compensates appropriately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: to return the full design guide for thermal tickets. It uses a specific verb ('Returns') and distinguishes itself from sibling preview/print tools by positioning itself as the prerequisite guide, explicitly saying 'Read this FIRST before designing any thermal ticket.'

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says when to use this tool: 'Read this FIRST before designing any thermal ticket.' This is a direct usage directive that tells the agent to use this tool before any other design-related actions. It also notes the client-agnostic nature, clarifying it works in Claude Desktop where the Claude Code skill is not loaded, which adds important context for invocation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

preview_htmlA

Render ticket HTML WITHOUT printing. Returns the EXACT 1-bit image that would be printed (after dithering/thresholding) β€” always preview before print_html.

ParametersJSON Schema
NameRequiredDescriptionDefault
htmlYesHTML body fragment to render on 58mm thermal paper (384px wide canvas, unlimited height, 1-bit black & white output). You may include your own <style> tag. Remote images and web fonts (e.g. Google Fonts) ARE supported. Grayscale/color images and gradients are supported β€” they are dithered to 1-bit with a high-quality algorithm. Special feature: <img data-qr="text or url" width="160"> is replaced with a generated QR code. Call the design_guide tool first for fonts, layout, and house-style guidance (or read the "thermal-print" skill if you're in Claude Code).
modeNobinarization mode: "auto" (default β€” detects photos/gradients and dithers them, keeps pure text razor-sharp), "text" (hard threshold), "photo" (force Atkinson dithering)
algorithmNophoto dithering algorithm: "atkinson" (default, crisp), "jarvis" (smoother gradients), "bayer" (ordered halftone / newspaper look)

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full disclosure burden. It clearly reveals the preview/print behavioral trait (returns exact printed output, no physical printing), explains rendering details (1-bit, dithering), and discloses capabilities like QR generation and remote image support. This is rich behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is somewhat long but every sentence earns its place: it describes output fidelity, canvas dimensions, style support, special features, and usage guidance. The key differentiator ('Render... WITHOUT printing') is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-param tool with no output schema and no annotations, the description is thorough. It covers canvas specs, supported features, QR generation, mode selection, and ties to design_guide and print_html. Minor gap: no mention of return value format (image data vs URL), but overall it's quite complete for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema documents all three parameters. The description adds meaningful value by explaining the html canvas spec (58mm, 384px wide, unlimited height), the QR data attribute feature, and clarifying mode/algorithm semantics (auto detects photos vs text, bayer gives halftone look). This goes beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb+resource ('Render ticket HTML WITHOUT printing') and clearly distinguishes from the sibling print_html by emphasizing the preview-only behavior. It also explicitly notes it returns the exact 1-bit printed image, making its functional scope unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit guidance: 'always preview before print_html', directly telling the agent when to use this tool relative to its sibling. It also instructs calling design_guide first or reading the thermal-print skill, adding clear context for proper usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

preview_markdownA

Render markdown WITHOUT printing. Returns the EXACT 1-bit image that would be printed β€” preview before print_markdown.

ParametersJSON Schema
NameRequiredDescriptionDefault
flowNo"ticket" (default): standalone ticket with margins and trailing paper feed. "continuous": typewriter/log mode β€” zero top/bottom margins, NO trailing feed, so chunks printed across separate calls join seamlessly into one document; send one complete markdown block per call (incomplete chunks are rejected before printing); press the printer's FEED button after tearing to restore a margin.
sizeNotype size tier. "medium" (19px) is the RECOMMENDED default β€” use it for almost everything. "large" (24px) for headlines / very short notes. "small" (14px) ONLY for genuinely dense or long content (it is noticeably harder to read on thermal paper) β€” do NOT default to small.
markdownYesGitHub-flavored markdown with advanced features: syntax-highlighted code fences (monochrome: bold keywords, italic strings/comments), ```mermaid diagrams, LaTeX math ($inline$ and $$block$$), checkbox task lists, tables, remote images (auto-dithered). Rendered with a built-in minimalist high-contrast stylesheet (h1 = white-on-black rounded banner, bordered rounded blockquotes/code, dashed hr). Fastest way to print; use the html tools for full custom design. Call design_guide first for size/style guidance.

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It discloses the key behavior (renders exact 1-bit image without printing) and that incomplete continuous-flow chunks are rejected before printing. However, it doesn't state what the return value/preview output looks like (since there's no output schema), nor side effects or limits. It covers the most critical behavioral facts but leaves return-format details unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is tight and front-loaded with the core purpose verb and constraint (render WITHOUT printing), immediately followed by the preview-before-print guidance. The extra context is pushed into the schema parameter descriptions rather than repeated. Slightly verbose only because of rich semantic content, but every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 3 parameters fully described in schema (incl. enums and recommended defaults), no output schema, and rich parameter docs covering size guidance, flow modes, and markdown features, the description adds the critical preview-vs-print distinction and points to design_guide. It's reasonably complete; the only gap is the unspecified return/preview output format, but the title 'preview' plus the description strongly imply the rendered image is returned.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters in detail. The description adds a useful note about being the fastest way to print and pointing to html tools for full custom design, but it largely relies on the schema's already-rich parameter descriptions for the markdown, flow, and size semantics. Baseline 3 is appropriate given full schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb (render/preview), the resource (markdown), and the key distinction: it renders WITHOUT printing to show the exact 1-bit image before print_markdown. This directly distinguishes it from the sibling print_markdown tool while expressing the core purpose precisely.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly warns against printing ("preview before print_markdown"), tells users to call design_guide first for size/style guidance, and the schema's flow/size params carry detailed usage guidance (RECOMMENDED medium default, when to use large/small, when to use continuous vs ticket mode). This exceeds baseline expectations for when-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

printer_statusB

Check printer/transport status and current configuration.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. The description says 'check' which implies a read operation, but it doesn't disclose whether there are side effects, what 'current configuration' reveals, whether transport state affects subsequent print calls, or any error conditions. For a status tool with zero annotation coverage, more behavioral disclosure would help.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the two aspects being checked (printer/transport status and current configuration). Zero waste, appropriately brief for a zero-parameter tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (0 params, no output schema), so the description doesn't need much. However, with no output schema and no annotations, the description could clarify what information comes back (device name, connection state, queue length, etc.) to help an agent know what to expect. Adequate but could be more informative about the return value.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0 parameters, the baseline is 4 per the rubric. There are no parameters needing documentation, and the description correctly implies the tool takes no input and simply returns current state. Nothing to add here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear verb+resource goal: 'Check printer/transport status and current configuration.' It distinguishes from siblings (preview_html, print_html, etc.), which are about rendering/previewing output, while this tool inspects status. However, it could be more specific about what 'status' includes, though 0 params means no scope ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool vs the print/preview siblings. Given the sibling set (preview_html, print_html, etc.), it's only implied that this is a diagnostic/config tool rather than a rendering operation. No explicit when-to-use or exclusions are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 6 tool updatesv1.0.7
    • First observeddesign_guide
    • First observedpreview_html
    • First observedpreview_markdown
    • First observedprint_html
    • First observedprint_markdown
    • First observedprinter_status

TDQS

A4.2/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a distinct purpose: previewing vs printing, HTML vs Markdown, checking status, and reading the design guide. No two tools overlap in function, and the descriptions clarify the exact use case for each.

Naming Consistency4/5

Most tools follow a clear verb_noun pattern: preview_html, print_html, preview_markdown, print_markdown. Two exceptions (printer_status, design_guide) are noun phrases, but they are still intuitive and don't create confusion.

Tool Count5/5

With 6 tools, the set is well-scoped for thermal printing workflows. Each tool earns its place, covering preview, print, status, and guidance without unnecessary bloat.

Completeness5/5

The surface covers the full lifecycle: design (design_guide), validate (preview_*), execute (print_*), and monitor (printer_status). No obvious dead ends or missing essential operations for the domain.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    F
    maintenance
    Connect AI agents to physical printers. Print receipts, shipping labels, and packing slips to your existing BizPrint-connected printers from Claude and other MCP clients.
    7
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Screenshot and HTML Rendering MCP Server for AI Agents. Capture screenshots, render HTML to images, and generate PDFs via simple API calls. Compatible with Claude, Cursor, and any MCP client.
    1
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI agents to publish HTML or Markdown to a public URL with a single HTTP POST, automatically converting Markdown to a styled webpage, with no account or setup required.
    5 npm
    1
    MIT
  • F
    license
    A
    quality
    B
    maintenance
    Enables coding agents to export Markdown implementation plans and audits into pixel-perfect PNGs, PDFs, and self-contained HTML files, with code highlighting, Mermaid diagrams, and GitHub callouts preserved.
    2
    1
    -