@sylphx/pdf-reader-mcp 2.0.7 → 2.0.8
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/dist/index.js +25 -20
- package/package.json +5 -6
package/dist/index.js
CHANGED
|
@@ -455,27 +455,32 @@ var determinePagesToProcess = (targetPages, totalPages, includeFullText) => {
|
|
|
455
455
|
};
|
|
456
456
|
|
|
457
457
|
// src/schemas/readPdf.ts
|
|
458
|
-
import {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
458
|
+
import {
|
|
459
|
+
array,
|
|
460
|
+
bool,
|
|
461
|
+
description,
|
|
462
|
+
gte,
|
|
463
|
+
int,
|
|
464
|
+
min,
|
|
465
|
+
num,
|
|
466
|
+
object,
|
|
467
|
+
optional,
|
|
468
|
+
str,
|
|
469
|
+
union
|
|
470
|
+
} from "@sylphx/vex";
|
|
471
|
+
var pageSpecifierSchema = union(array(num(int, gte(1))), str(min(1)));
|
|
472
|
+
var pdfSourceSchema = object({
|
|
473
|
+
path: optional(str(min(1), description("Path to the local PDF file (absolute or relative to cwd)."))),
|
|
474
|
+
url: optional(str(min(1), description("URL of the PDF file."))),
|
|
475
|
+
pages: optional(pageSpecifierSchema)
|
|
476
|
+
});
|
|
477
|
+
var readPdfArgsSchema = object({
|
|
478
|
+
sources: array(pdfSourceSchema),
|
|
479
|
+
include_full_text: optional(bool(description("Include the full text content of each PDF (only if 'pages' is not specified for that source)."))),
|
|
480
|
+
include_metadata: optional(bool(description("Include metadata and info objects for each PDF."))),
|
|
481
|
+
include_page_count: optional(bool(description("Include the total number of pages for each PDF."))),
|
|
482
|
+
include_images: optional(bool(description("Extract and include embedded images from the PDF pages as base64-encoded data.")))
|
|
471
483
|
});
|
|
472
|
-
var readPdfArgsSchema = z.object({
|
|
473
|
-
sources: z.array(pdfSourceSchema).min(1).describe("An array of PDF sources to process, each can optionally specify pages."),
|
|
474
|
-
include_full_text: z.boolean().optional().default(false).describe("Include the full text content of each PDF (only if 'pages' is not specified for that source)."),
|
|
475
|
-
include_metadata: z.boolean().optional().default(true).describe("Include metadata and info objects for each PDF."),
|
|
476
|
-
include_page_count: z.boolean().optional().default(true).describe("Include the total number of pages for each PDF."),
|
|
477
|
-
include_images: z.boolean().optional().default(false).describe("Extract and include embedded images from the PDF pages as base64-encoded data.")
|
|
478
|
-
}).strict();
|
|
479
484
|
|
|
480
485
|
// src/handlers/readPdf.ts
|
|
481
486
|
var logger5 = createLogger("ReadPdf");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sylphx/pdf-reader-mcp",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "An MCP server providing tools to read PDF files.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -71,18 +71,17 @@
|
|
|
71
71
|
"prepare": "node_modules/.bin/lefthook install || true"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@sylphx/mcp-server-sdk": "1.
|
|
74
|
+
"@sylphx/mcp-server-sdk": "^2.1.0",
|
|
75
|
+
"@sylphx/vex": "^0.1.11",
|
|
75
76
|
"glob": "^13.0.0",
|
|
76
77
|
"pdfjs-dist": "^5.4.449",
|
|
77
|
-
"pngjs": "^7.0.0"
|
|
78
|
-
"zod": "4.2.0-canary.20251124T022609",
|
|
79
|
-
"zod-to-json-schema": "^3.25.0"
|
|
78
|
+
"pngjs": "^7.0.0"
|
|
80
79
|
},
|
|
81
80
|
"devDependencies": {
|
|
82
81
|
"@biomejs/biome": "^2.3.8",
|
|
83
82
|
"@solidjs/router": "^0.15.4",
|
|
84
83
|
"@sylphx/biome-config": "^0.4.1",
|
|
85
|
-
"@sylphx/bump": "^
|
|
84
|
+
"@sylphx/bump": "^1.6.1",
|
|
86
85
|
"@sylphx/doctor": "^1.32.1",
|
|
87
86
|
"@sylphx/leaf": "^1.0.0",
|
|
88
87
|
"@sylphx/leaf-theme-default": "^1.0.0",
|