@sylphx/pdf-reader-mcp 2.4.2 → 2.4.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.
- package/README.md +18 -18
- package/dist/index.js +3 -2
- package/package.json +6 -8
package/README.md
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
9
|
[](https://github.com/SylphxAI/pdf-reader-mcp/actions/workflows/ci.yml)
|
|
10
10
|
[](https://codecov.io/gh/SylphxAI/pdf-reader-mcp)
|
|
11
|
-
[](https://www.typescriptlang.org/)
|
|
12
12
|
[](https://www.npmjs.com/package/@sylphx/pdf-reader-mcp)
|
|
13
13
|
|
|
14
|
-
**5-10x faster parallel processing** • **Y-coordinate content ordering** • **94%+ test coverage** • **
|
|
14
|
+
**5-10x faster parallel processing** • **Y-coordinate content ordering** • **94%+ test coverage** • **173 tests passing**
|
|
15
15
|
|
|
16
16
|
<a href="https://mseep.ai/app/SylphxAI-pdf-reader-mcp">
|
|
17
17
|
<img src="https://mseep.net/pr/SylphxAI-pdf-reader-mcp-badge.png" alt="Security Validated" width="200"/>
|
|
@@ -62,7 +62,7 @@ PDF Reader MCP is a **production-ready** Model Context Protocol server that empo
|
|
|
62
62
|
- 🎯 **Path Flexibility** - Absolute & relative paths, Windows/Unix support (v1.3.0)
|
|
63
63
|
- 🖼️ **Smart Ordering** - Y-coordinate based content preserves document layout
|
|
64
64
|
- 🛡️ **Type Safe** - Full TypeScript with strict mode enabled
|
|
65
|
-
- 📚 **Battle-tested** -
|
|
65
|
+
- 📚 **Battle-tested** - 173 tests, 94%+ coverage, 98%+ function coverage
|
|
66
66
|
- 🎨 **Simple API** - Single tool handles all operations elegantly
|
|
67
67
|
|
|
68
68
|
---
|
|
@@ -324,7 +324,7 @@ npm install -g @sylphx/pdf-reader-mcp
|
|
|
324
324
|
**Other Improvements:**
|
|
325
325
|
- 🐛 Fixed Zod validation error handling
|
|
326
326
|
- 📦 Updated all dependencies to latest versions
|
|
327
|
-
- ✅
|
|
327
|
+
- ✅ 173 tests passing, 94%+ coverage maintained
|
|
328
328
|
|
|
329
329
|
<details>
|
|
330
330
|
<summary><strong>📋 View Full Changelog</strong></summary>
|
|
@@ -710,10 +710,10 @@ CMD ["bun", "node_modules/@sylphx/pdf-reader-mcp/dist/index.js"]
|
|
|
710
710
|
|:----------|:-----------|
|
|
711
711
|
| **Runtime** | Node.js 22+ ESM |
|
|
712
712
|
| **PDF Engine** | PDF.js (Mozilla) |
|
|
713
|
-
| **Validation** |
|
|
713
|
+
| **Validation** | Vex + JSON Schema |
|
|
714
714
|
| **Protocol** | MCP SDK |
|
|
715
715
|
| **Language** | TypeScript (strict) |
|
|
716
|
-
| **Testing** |
|
|
716
|
+
| **Testing** | Bun test (173 tests) |
|
|
717
717
|
| **Quality** | Biome (50x faster) |
|
|
718
718
|
| **CI/CD** | GitHub Actions |
|
|
719
719
|
|
|
@@ -737,28 +737,28 @@ CMD ["bun", "node_modules/@sylphx/pdf-reader-mcp/dist/index.js"]
|
|
|
737
737
|
<br/>
|
|
738
738
|
|
|
739
739
|
**Prerequisites:**
|
|
740
|
-
- Node.js >= 22.
|
|
741
|
-
-
|
|
740
|
+
- Node.js >= 22.13.0 (required by pdfjs-dist v6)
|
|
741
|
+
- Bun (this repo uses `bun@1.3.1`)
|
|
742
742
|
|
|
743
743
|
**Setup:**
|
|
744
744
|
```bash
|
|
745
745
|
git clone https://github.com/SylphxAI/pdf-reader-mcp.git
|
|
746
746
|
cd pdf-reader-mcp
|
|
747
|
-
|
|
747
|
+
bun install && bun run build
|
|
748
748
|
```
|
|
749
749
|
|
|
750
750
|
**Scripts:**
|
|
751
751
|
```bash
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
752
|
+
bun run build # Build with bunup
|
|
753
|
+
bun test # Run 173 tests
|
|
754
|
+
bun run test:cov # Coverage (94%+)
|
|
755
|
+
bun run check # Lint + format
|
|
756
|
+
bun run check:fix # Auto-fix
|
|
757
|
+
bun run benchmark # Performance tests
|
|
758
758
|
```
|
|
759
759
|
|
|
760
760
|
**Quality:**
|
|
761
|
-
- ✅
|
|
761
|
+
- ✅ 173 tests
|
|
762
762
|
- ✅ 94%+ coverage
|
|
763
763
|
- ✅ 98%+ function coverage
|
|
764
764
|
- ✅ Zero lint errors
|
|
@@ -774,8 +774,8 @@ pnpm run benchmark # Performance tests
|
|
|
774
774
|
**Quick Start:**
|
|
775
775
|
1. Fork repository
|
|
776
776
|
2. Create branch: `git checkout -b feature/awesome`
|
|
777
|
-
3. Make changes: `
|
|
778
|
-
4. Format: `
|
|
777
|
+
3. Make changes: `bun test`
|
|
778
|
+
4. Format: `bun run check:fix`
|
|
779
779
|
5. Commit: Use [Conventional Commits](https://www.conventionalcommits.org/)
|
|
780
780
|
6. Open PR
|
|
781
781
|
|
package/dist/index.js
CHANGED
|
@@ -1152,9 +1152,10 @@ var processSingleSource = async (source, options) => {
|
|
|
1152
1152
|
individualResult.success = false;
|
|
1153
1153
|
individualResult.data = undefined;
|
|
1154
1154
|
} finally {
|
|
1155
|
-
|
|
1155
|
+
const loadingTask = pdfDocument?.loadingTask;
|
|
1156
|
+
if (loadingTask && typeof loadingTask.destroy === "function") {
|
|
1156
1157
|
try {
|
|
1157
|
-
await
|
|
1158
|
+
await loadingTask.destroy();
|
|
1158
1159
|
} catch (destroyError) {
|
|
1159
1160
|
const message = destroyError instanceof Error ? destroyError.message : String(destroyError);
|
|
1160
1161
|
logger6.warn("Error destroying PDF document", { sourceDescription, error: message });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sylphx/pdf-reader-mcp",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
4
4
|
"description": "An MCP server providing tools to read PDF files.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": ">=22.
|
|
21
|
+
"node": ">=22.13.0"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
@@ -71,8 +71,7 @@
|
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@sylphx/mcp-server-sdk": "^2.1.1",
|
|
73
73
|
"@sylphx/vex": "^0.1.11",
|
|
74
|
-
"
|
|
75
|
-
"pdfjs-dist": "^5.6.205",
|
|
74
|
+
"pdfjs-dist": "^6.0.227",
|
|
76
75
|
"pngjs": "^7.0.0"
|
|
77
76
|
},
|
|
78
77
|
"overrides": {
|
|
@@ -83,16 +82,15 @@
|
|
|
83
82
|
"vite": "^6.4.2"
|
|
84
83
|
},
|
|
85
84
|
"devDependencies": {
|
|
86
|
-
"@biomejs/biome": "^2.4.
|
|
85
|
+
"@biomejs/biome": "^2.4.16",
|
|
87
86
|
"@sylphx/biome-config": "^0.4.1",
|
|
88
87
|
"@sylphx/bump": "^1.6.1",
|
|
89
88
|
"@sylphx/doctor": "^1.34.0",
|
|
90
89
|
"@sylphx/tsconfig": "^0.3.1",
|
|
91
|
-
"@types/
|
|
92
|
-
"@types/node": "^25.6.0",
|
|
90
|
+
"@types/node": "^25.9.1",
|
|
93
91
|
"@types/pngjs": "^6.0.5",
|
|
94
92
|
"bunup": "0.16.31",
|
|
95
|
-
"lefthook": "^2.1.
|
|
93
|
+
"lefthook": "^2.1.9",
|
|
96
94
|
"typedoc": "^0.28.19",
|
|
97
95
|
"typedoc-plugin-markdown": "^4.11.0",
|
|
98
96
|
"typescript": "^6.0.3",
|