Let AI Print: mcp-web-print-pdf Setup Guide

Once the Web Print Expert client is installed, add one stdio MCP server to your AI host and the model can print HTML, web pages, PDFs and images straight to a local printer. It changes neither the client nor the web-print-pdf browser library — it just attaches another client to the local port the client already exposes.

Updated 2026-10 · web-print-pdf v2.1.7 · Runs locally · data never leaves the machine

How it works

Three hops, all on your own machine, with no cloud relay:

  • The AI host (Claude Desktop / Cursor / dsh / Claude Code …) launches the MCP server via npx -y mcp-web-print-pdf over stdio.
  • The MCP server translates each tool call into the client WebSocket message it already understands.
  • The client renders the PDF locally, submits it to the system print queue, and returns the job result.
AI host (Claude / Cursor / dsh)
   |  stdio: npx -y mcp-web-print-pdf
   v
mcp-web-print-pdf
   |  ws://127.0.0.1:16794/websocket/standard
   v
Web Print Expert client  -->  printer

Set expectations first (four common misreads)

  • The client must be installed and running. MCP is only a bridge; without the client there is no printer channel.
  • The response means “submitted”, not “printed”. A job that reaches the system queue counts as success; paused, offline or out-of-paper printers will stall the queue silently.
  • Calling a print tool prints. Jobs go straight to the printer by default; pass dry_run: true when you only want to check the layout.
  • No cloud path. Only a client running on the same machine works. ChatGPT and claude.ai web only accept remote HTTP MCP, so they cannot reach a local stdio server.

An unlicensed real print returns Not allowed to use, please purchase authorization; make sure the client is signed in and licensed first.

Prerequisites

  • Web Print Expert client installed and running (default port 16794). Not yet? Download the client.
  • Node.js 18+ — hosts pull the server with npx, so no global install is needed; the package is on npm.
  • A host that speaks MCP stdio: Claude Desktop, Cursor, dsh, Claude Code, VS Code Copilot, Codex CLI, Cline, Cherry Studio, Trae and similar.

Three steps

1. Check the client is online

Open the client and confirm it is running and the port is free. Once the host is connected, the first tool to call is getConnectStatus.

2. Register the MCP server in your host

Every host runs the same stdio command; only the config file location and top-level key differ:

{
  "mcpServers": {
    "webprint": {
      "command": "npx",
      "args": ["-y", "mcp-web-print-pdf"],
      "env": { "WEBPRINT_PORT": "16794" }
    }
  }
}

dsh uses a YAML insert instead — different shape, same fields:

- insert:
    - id: mcp-webprint
      name: '@deepseek-ai/dsh-mcp-client'
      config:
        serverName: webprint
        transport: stdio
        command: npx
        args:
          - '-y'
          - 'mcp-web-print-pdf'
        toolCallTimeoutMs: 180000

3. Restart the host and confirm it is green

Restart the host and check its MCP panel reports the server as connected. Tool names are namespaced on the model side, e.g. mcp__webprint__printHtml. Call getConnectStatus first, then printHtml with dry_run: true to see whether a preview is generated.

The client port defaults to 16794 and can be overridden with WEBPRINT_PORT; the WebSocket request timeout defaults to 120 s and can be overridden with WEBPRINT_TIMEOUT (milliseconds).

Config locations by host

Config formats follow each host current docs; the table below is for locating the file quickly.

HostConfig locationTop-level key
Claude Desktop%APPDATA%\Claude\claude_desktop_config.jsonmcpServers
Cursor~/.cursor/mcp.json or project .cursor/mcp.jsonmcpServers
dsh~/.dsh/profiles/<profile>/cordis.patch.ymlinsert (YAML)
Claude Codeclaude mcp add --scope user webprint -- npx -y mcp-web-print-pdfwritten by the CLI
VS Code + Copilot.vscode/mcp.jsonservers
OpenAI Codex CLI~/.codex/config.tomlmcp_servers (TOML)
Cline / Roo / Kilocline_mcp_settings.jsonmcpServers
Cherry Studio / TraeAdd a STDIO server in the settings panelGUI

Available tools

Tool names map one-to-one onto web-print-pdf@2.x methods (the utils. prefix cannot appear in a tool name, so it is dropped).

ToolWhat it doesNotes
getConnectStatusCheck whether the client is onlineProbe first, before printing
getPrinterListList local printers (name + driver)Use it to get an exact printer_name
getPrinterPapersList paper sizes a printer acceptsFills paper_format / print_options.bin
printHtmlPrint an HTML stringMost used; fragments and full pages both work
printHtmlByUrlFetch a page, then print itAccepts cookies / httpHeaders
printHtmlByBase64Print Base64-encoded HTMLSubject to the 10 MB message cap
printPdfByUrlPrint a PDF URLThe client downloads it first
printPdfByBase64Print a Base64-encoded PDFRoughly under 5 MB
printImageByUrlPrint an image URL—
printImageByBase64Print a Base64-encoded imageBare base64 gets the data-URI prefix added
printFilePrint a local .pdf / .html / image by pathExtra tool in this repo; bypasses the stdio message cap
batchPrintSubmit several mixed jobs at onceEvery task action must match
ToolWhat it doesNotes
setTitleSet the client window titlereset: true restores defaults
setThemeColorSet the client theme color
switchTabsVisibilityShow or hide client tabs
setContactUsTabInnerHtmlSet the content of the Contact Us tab

Arguments at a glance

The three option objects map onto the upstream arguments: pdf_options and print_options go through the client whitelist (unknown field names fail loudly), while extra_options accepts any custom keys and echoes them back.

Merge rule: fields you set explicitly win, convenience arguments only fill gaps.

MCP argumentUpstreamNotes
content fieldfirst argumenthtml / url / base64 / path / tasks
pdf_optionspdfOptionsPDF layout: paper, margins, header/footer, watermark, page numbers, background
print_optionsprintOptionsPrinter delivery: printer name, copies, duplex, scaling, bin, thermal sharpening
extra_optionsextraOptionsaction, requestTimeout, cookies, httpHeaders, localStorages
dry_run—Convenience flag: true renders a preview only; omit it to print
paper_format / printer_name / copies—Convenience arguments, equivalent to the same print_options fields

Six pitfalls worth avoiding

  • Using Base64 as a file channel. A stdio message is capped at 10 MB; past that the connection closes before the tool can report an error. For large PDFs or images use printFile or a URL.
  • Host timeout beats the job. Most hosts cap a tool call at roughly 60 s, so batches and big files get cut off — split the batch or raise the host timeout (e.g. dsh toolCallTimeoutMs).
  • Custom paper names in pdf_options.paperFormat. It only accepts a fixed enum (A0–A6 / Letter / Legal / Tabloid / Ledger); for 80 mm receipts or 100×150 labels use width + height.
  • Wrong batchPrint task shape. Each task is { type, data, pdfOptions?, printOptions?, extraOptions? } — content goes in data, not content / url / base64.
  • Enabling printFile casually. It reads any local path the model names, so only enable it in trusted environments.
  • Copying old tool names. 0.1.0 used snake_case (print_html, list_printers); since 0.2.0 the names match the upstream camelCase methods and the old ones no longer exist.

Verification checklist

  1. getConnectStatus — continue only when the client is online.
  2. getPrinterList — confirm the target printer names the model sees are the ones you expect.
  3. printHtml with dry_run: true — a preview or PDF URL in the response means the render path works.
  4. Real print — actual output. If nothing comes out, inspect the OS print queue (e.g. Get-PrintJob on Windows) instead of trusting the tool response alone.

FAQ

Does the printed content leave my machine?

No. The MCP server, client, PDF rendering and print queue all run locally; only the initial npx package download needs the network. Nothing is uploaded and there is no cloud relay.

Can I use it from the ChatGPT or claude.ai web app?

No. Those only accept remote HTTP MCP servers, while this project ships a local stdio server. Using them would require your own HTTP bridge in between.

How does it relate to web-print-pdf?

One-to-one mapping: public APIs such as printHtml, batchPrint and utils.getPrinterList all have same-named tools, with arguments reshaped as MCP JSON. printFile is the one addition (print by local path).

The call succeeded but nothing printed. Why?

Check the printer for paused, offline or empty-paper states, which leave the job stuck in the OS queue. Then confirm licensing: an unlicensed real print returns NOTALLOWUSE.

Does it cost extra?

The MCP server itself is an MIT-licensed open-source package with no extra fee; actual printing still depends on your Web Print Expert client licence. To verify the wiring first, pass dry_run: true to render a preview.

Client deployment by platform

The same web-print-pdf front-end runs on Windows, macOS, and Linux/domestic OS—install the matching client on each desktop.

Download client — free trial View npm package Documentation