mcp-web-print-pdf 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +34 -7
  2. package/README_EN.md +36 -7
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -8,19 +8,26 @@
8
8
  `ws://127.0.0.1:16794/websocket/standard` 再加一个客户端,并把 `web-print-pdf@2.x` 的公开 API
9
9
  一对一映射成 MCP 工具。
10
10
 
11
+ - 官网:<https://webprintpdf.com/>
12
+ - 底层 npm 包:[web-print-pdf](https://www.npmjs.com/package/web-print-pdf)
13
+ - 文档:<https://webprintpdf.com/docs/>
14
+
11
15
  ```
12
16
  Claude / dsh ──stdio──> mcp-web-print-pdf ──ws──> Web打印专家客户端 ──> 打印机
13
17
  ```
14
18
 
15
- ## 安装
19
+ ## 前置条件
16
20
 
17
- 宿主会自动通过 `npx -y mcp-web-print-pdf` 拉取,不需要全局安装。
21
+ - 本机安装并启动 [Web打印专家客户端](https://webprintpdf.com/downloadApp/)(Windows 10/11、macOS 11+、Linux / 银河麒麟 / 统信 UOS)
22
+ - 客户端默认监听 `ws://127.0.0.1:16794/websocket/standard`
23
+ - 不需要改客户端或前端代码;本 MCP 只是把 [web-print-pdf](https://www.npmjs.com/package/web-print-pdf) 的公开 API 映射成 MCP 工具
24
+ - MCP 接入指南:<https://webprintpdf.com/docs/mcp-print/>
18
25
 
19
- 从源码开发:
26
+ ## 安装
20
27
 
21
- ```bash
22
- npm install
23
- ```
28
+ 不需要安装。宿主通过 `npx -y mcp-web-print-pdf` 启动,首次运行会自动下载并缓存。
29
+
30
+ > 需要固定版本时在包名后加版本号,例如 `npx -y mcp-web-print-pdf@0.2.3`。
24
31
 
25
32
  ## 配置
26
33
 
@@ -374,7 +381,7 @@ MCP 的 stdio 通道单条消息默认上限 **10MB**(SDK 的 `ReadBuffer`)
374
381
  客户端,绕开 MCP 的消息上限。
375
382
  - 也可以先把文件挂到 HTTP 地址,用 `printPdfByUrl` / `printImageByUrl` / `printHtmlByUrl`。
376
383
 
377
- ## 与 `web-print-pdf@2.1.9` 的覆盖对照
384
+ ## 与 [web-print-pdf@2.1.9](https://www.npmjs.com/package/web-print-pdf) 的覆盖对照
378
385
 
379
386
  | 上游公开 API | 本 MCP |
380
387
  |---|---|
@@ -405,6 +412,17 @@ MCP 的 stdio 通道单条消息默认上限 **10MB**(SDK 的 `ReadBuffer`)
405
412
  - 客户端侧实现见 `ElctronPrintWeb` 仓库:消息入口在 `electronApp/server/websocket/standard/`,
406
413
  参数白名单在 `core/generatePdf` 与 `core/printPdf`。
407
414
 
415
+ ## 本地开发
416
+
417
+ ```bash
418
+ git clone https://github.com/weixiaoyi/mcp-web-print-pdf.git
419
+ cd mcp-web-print-pdf
420
+ npm install
421
+ npm test
422
+ ```
423
+
424
+ `npm test` 跑参数合并和默认 action 的单元测试;端到端冒烟见下一节。
425
+
408
426
  ## 本地验证(没装客户端也能跑)
409
427
 
410
428
  ```bash
@@ -437,6 +455,15 @@ npx @modelcontextprotocol/inspector node bin/mcp.js
437
455
  - 参数与消息结构按 `ElctronPrintWeb`(客户端 1.0.9)源码校准:`batchPrint` 任务用 `data` 字段,
438
456
  不是 `web-print-pdf` README 示例里的 `content` / `url` / `base64`。
439
457
 
458
+ ## 相关链接
459
+
460
+ - 官网:<https://webprintpdf.com/>
461
+ - 文档:<https://webprintpdf.com/docs/>
462
+ - MCP 接入指南:<https://webprintpdf.com/docs/mcp-print/>
463
+ - 客户端下载:<https://webprintpdf.com/downloadApp/>
464
+ - web-print-pdf(npm):<https://www.npmjs.com/package/web-print-pdf>
465
+ - 本仓库:<https://github.com/weixiaoyi/mcp-web-print-pdf>
466
+
440
467
  ## License
441
468
 
442
469
  MIT
package/README_EN.md CHANGED
@@ -8,19 +8,27 @@ It does **not** modify the Web Print Expert client or the `web-print-pdf` browse
8
8
  adds another client to the existing `ws://127.0.0.1:16794/websocket/standard` endpoint and maps the
9
9
  public `web-print-pdf@2.x` API one-to-one onto MCP tools.
10
10
 
11
+ - Website: <https://webprintpdf.com/>
12
+ - Underlying npm package: [web-print-pdf](https://www.npmjs.com/package/web-print-pdf)
13
+ - Docs: <https://webprintpdf.com/docs/>
14
+
11
15
  ```
12
16
  Claude / dsh ──stdio──> mcp-web-print-pdf ──ws──> Web Print Expert client ──> printer
13
17
  ```
14
18
 
15
- ## Installation
19
+ ## Prerequisites
16
20
 
17
- Hosts fetch it automatically via `npx -y mcp-web-print-pdf`; no global install is required.
21
+ - Install and start the [Web Print Expert client](https://webprintpdf.com/downloadApp/) (Windows 10/11, macOS 11+, Linux / Kylin / UOS)
22
+ - The client listens on `ws://127.0.0.1:16794/websocket/standard` by default
23
+ - No changes to the client or your frontend code; this MCP just maps the public [web-print-pdf](https://www.npmjs.com/package/web-print-pdf) API onto MCP tools
24
+ - MCP guide: <https://webprintpdf.com/docs/mcp-print/>
18
25
 
19
- For local development:
26
+ ## Installation
20
27
 
21
- ```bash
22
- npm install
23
- ```
28
+ Nothing to install. Hosts start it via `npx -y mcp-web-print-pdf`; the first run downloads and caches
29
+ the package.
30
+
31
+ > To pin a version, append it to the package name, for example `npx -y mcp-web-print-pdf@0.2.3`.
24
32
 
25
33
  ## Configuration
26
34
 
@@ -388,7 +396,7 @@ MCP's stdio channel has a default **10MB** per-message limit (the SDK's `ReadBuf
388
396
  the client over WebSocket, bypassing the MCP message limit.
389
397
  - Alternatively host the file over HTTP and use `printPdfByUrl` / `printImageByUrl` / `printHtmlByUrl`.
390
398
 
391
- ## Coverage vs `web-print-pdf@2.1.9`
399
+ ## Coverage vs [web-print-pdf@2.1.9](https://www.npmjs.com/package/web-print-pdf)
392
400
 
393
401
  | Upstream public API | This MCP |
394
402
  |---|---|
@@ -425,6 +433,18 @@ MCP).
425
433
  `electronApp/server/websocket/standard/`, option whitelists in `core/generatePdf` and
426
434
  `core/printPdf`.
427
435
 
436
+ ## Local development
437
+
438
+ ```bash
439
+ git clone https://github.com/weixiaoyi/mcp-web-print-pdf.git
440
+ cd mcp-web-print-pdf
441
+ npm install
442
+ npm test
443
+ ```
444
+
445
+ `npm test` runs unit tests for option merging and the default action; the end-to-end smoke test is
446
+ below.
447
+
428
448
  ## Local verification (works without the client)
429
449
 
430
450
  ```bash
@@ -465,6 +485,15 @@ check that a preview appears.
465
485
  `batchPrint` tasks use a `data` field, not the `content` / `url` / `base64` fields shown in the
466
486
  `web-print-pdf` README examples.
467
487
 
488
+ ## Links
489
+
490
+ - Website: <https://webprintpdf.com/>
491
+ - Docs: <https://webprintpdf.com/docs/>
492
+ - MCP guide: <https://webprintpdf.com/docs/mcp-print/>
493
+ - Client download: <https://webprintpdf.com/downloadApp/>
494
+ - web-print-pdf (npm): <https://www.npmjs.com/package/web-print-pdf>
495
+ - This repository: <https://github.com/weixiaoyi/mcp-web-print-pdf>
496
+
468
497
  ## License
469
498
 
470
499
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-web-print-pdf",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "MCP server for Web打印专家 / web-print-pdf — full API coverage: HTML, URL, PDF, image, batch printing to local printers",
5
5
  "type": "module",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  "receipt",
39
39
  "label"
40
40
  ],
41
- "homepage": "https://github.com/weixiaoyi/mcp-web-print-pdf#readme",
41
+ "homepage": "https://webprintpdf.com/",
42
42
  "repository": {
43
43
  "type": "git",
44
44
  "url": "git+https://github.com/weixiaoyi/mcp-web-print-pdf.git"