Repository navigation
Releases: hnjae/mcp-printer
Releases · hnjae/mcp-printer
Release list
v3.0.3
Fixed
list_printersreports a printer whose PPD options cannot be read as unavailable.lpoptions -lprints its complaint on stderr and exits 0 when it cannot fetch the PPD, for example when the CUPS daemon listens only on its Unix socket, and the empty output was shown as a printer that supports no quality and no page sizes
v3.0.2
v3.0.1
Fixed
print_pdfaccepts PDFs up to 3 MB (3,000,000 bytes) instead of 5 MB. The HTTP transport rejects request bodies over 4 MiB, so a larger PDF could never arrive that way and failed with HTTP 413; 3 MB is the largest size that fits once base64 and the request around it are counted
v3.0.0
Added
- Streamable HTTP transport: set
MCP_PRINTER_TRANSPORT=httpto serve MCP atPOST /mcp(MCP_PRINTER_HTTP_HOST,MCP_PRINTER_HTTP_PORT). It is stateless and has no authentication, so it must sit behind an authenticating proxy. stdio remains the default print_contenttool: print a document whose text the client sends (markdown,html,codeortext) without a file on the serverprint_pdftool: print a PDF sent as base64 (up to 5 MB)MCP_PRINTER_ENABLE_FILE_TOOLS(defaulttrue): set tofalseto hideprint_file,get_page_metaand theprint-changedpromptMCP_PRINTER_CHROME_NO_SANDBOX(defaultfalse): start Chrome with--no-sandbox, needed when running as root in a containerContainerfilefor running the HTTP server in a rootless container with the CUPS client commands, Chromium, CJK fonts and the Sarasa Mono K code font. Release images are published toghcr.io/hnjae/mcp-printeras3.0.0,3.0,3andlatest, so:3follows every 3.x releasesides,media,orientationandqualityparameters onprint_content,print_pdfandprint_file, replacing the need to writesides=…,media=…,landscapeandcupsPrintQuality=…in the free-formoptionsstring. They override the same settings inoptionsandMCP_PRINTER_DEFAULT_OPTIONS.get_page_metaacceptssidesandmedia.optionsremains for other CUPS optionslist_printersreports thesides,mediaandqualityvalues each printer accepts, read fromlpoptions -l. It offersjis_b5_182x257mmandjis_b6_128x182mmunder that name on every printer that can print the size, whether or not the printer lists it itself, and sends the printer's own choice or, failing that,Custom.182x257mm/Custom.128x182mm. A printer without its own listing gets the size when it lists A4 (B5) or A5 (B6) and custom page sizesrenderparameter (markdown,codeornone) onprint_fileandget_page_meta: renders the file that way whatever its extension, so Markdown can be rendered from a file without a Markdown extension. Omitted, the extension and theMCP_PRINTER_AUTO_RENDER_*settings decide as before- Documents are rendered on the page size of the call's
media:A3toA6,Letter,Legal,Executive,Oficio,FanFoldGermanLegal, the JIS B5/B6 names, IPP names that carry their size, a printer's own names made of dimensions such as4x6(inches) and215x345mm, andCustom.<W>x<H>. Any other name renders on A4. A size the document sets itself (HTML@page, Markdown front matter) wins - Code and plain text are set in
ui-monospace, then Sarasa Mono K, then the system's monospace font, so Korean and other CJK comments stay aligned
Changed
- BREAKING: the runtime and tooling moved to Bun (
bun >=1.3.14); pnpm, ESLint, Prettier and Vitest were replaced by Bun, Biome and prek. The sources run directly with no build step ordist/directory, so point MCP client configurations atsrc/index.tsinstead ofdist/index.js - BREAKING: Markdown files whose front matter selects a non-YAML engine, such as
---js, are rejected. gray-matter evaluated such front matter as code - BREAKING: rendered documents are laid out on A4 instead of US Letter when the call has no
media. Passmedia: Letterto keep Letter - BREAKING:
print_fileandget_page_metano longer acceptforce_markdown_renderandforce_code_render; userender - BREAKING:
print_content,print_fileandget_page_metano longer acceptline_numbers,color_scheme,font_sizeorline_spacing. TheMCP_PRINTER_CODE_*settings control how code looks - BREAKING:
MCP_PRINTER_AUTO_DUPLEXis no longer read; setMCP_PRINTER_DEFAULT_OPTIONS=sides=two-sided-long-edgeinstead - BREAKING:
MCP_PRINTER_ENABLE_PROMPTSis no longer read; theprint-changedprompt followsMCP_PRINTER_ENABLE_FILE_TOOLS - BREAKING:
MCP_PRINTER_FALLBACK_ON_RENDER_ERRORis no longer read; a failed rendering always fails that item, andrender: noneprints a file as it is - BREAKING:
MCP_PRINTER_CODE_EXCLUDE_EXTENSIONSis no longer read; userender: nonefor one file orMCP_PRINTER_AUTO_RENDER_CODE=falsefor all - Markdown is printed without filled backgrounds: code blocks are outlined instead, block quotes keep their left bar
- File path validation now happens once, where a path enters the print flow, instead of again inside the code and Markdown renderers
Fixed
- The sheet estimate and
PAGE_COUNT_CONFIRMATION_REQUIREDcheck assumed duplex wheneverMCP_PRINTER_AUTO_DUPLEXwas on, even when the call printed one-sided. It now follows the effectivesidessetting - A Markdown file that was not rendered as Markdown (
MCP_PRINTER_AUTO_RENDER_MARKDOWN=false) was rendered as code instead. It is now printed as it is;render: coderenders it as code - CUPS output is parsed under a fixed locale, so a translated CUPS no longer breaks printer and queue parsing
- Every CUPS command has a time limit (10 seconds for queries, 60 seconds for submissions and changes), so an unreachable CUPS server no longer leaves a call waiting indefinitely
- HTML, code and plain-text PDFs no longer carry Chrome's date and the path of a temporary file as header and footer, and rendered code starts with the file's name instead of its full path