@modelcontextprotocol/server-pdf 1.0.0 → 1.1.0
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 +4 -1
- package/dist/index.js +9 -9
- package/dist/mcp-app.html +98 -48
- package/dist/server.d.ts +34 -4
- package/dist/server.js +173 -46
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -63,7 +63,10 @@ On some host platforms, tool calls have size limits, so large PDFs cannot be sen
|
|
|
63
63
|
```typescript
|
|
64
64
|
// Load in chunks with progress
|
|
65
65
|
while (hasMore) {
|
|
66
|
-
const chunk = await app.callServerTool(
|
|
66
|
+
const chunk = await app.callServerTool({
|
|
67
|
+
name: "read_pdf_bytes",
|
|
68
|
+
arguments: { url, offset },
|
|
69
|
+
});
|
|
67
70
|
chunks.push(base64ToBytes(chunk.bytes));
|
|
68
71
|
offset += chunk.byteCount;
|
|
69
72
|
hasMore = chunk.hasMore;
|
package/dist/index.js
CHANGED
|
@@ -27197,11 +27197,11 @@ var require_lib4 = __commonJS((exports, module) => {
|
|
|
27197
27197
|
var headers = [], method = req.method && req.method.toUpperCase && req.method.toUpperCase();
|
|
27198
27198
|
if (method === "OPTIONS") {
|
|
27199
27199
|
headers.push(configureOrigin(options, req));
|
|
27200
|
-
headers.push(configureCredentials(options));
|
|
27201
|
-
headers.push(configureMethods(options));
|
|
27200
|
+
headers.push(configureCredentials(options, req));
|
|
27201
|
+
headers.push(configureMethods(options, req));
|
|
27202
27202
|
headers.push(configureAllowedHeaders(options, req));
|
|
27203
|
-
headers.push(configureMaxAge(options));
|
|
27204
|
-
headers.push(configureExposedHeaders(options));
|
|
27203
|
+
headers.push(configureMaxAge(options, req));
|
|
27204
|
+
headers.push(configureExposedHeaders(options, req));
|
|
27205
27205
|
applyHeaders(headers, res);
|
|
27206
27206
|
if (options.preflightContinue) {
|
|
27207
27207
|
next();
|
|
@@ -27212,8 +27212,8 @@ var require_lib4 = __commonJS((exports, module) => {
|
|
|
27212
27212
|
}
|
|
27213
27213
|
} else {
|
|
27214
27214
|
headers.push(configureOrigin(options, req));
|
|
27215
|
-
headers.push(configureCredentials(options));
|
|
27216
|
-
headers.push(configureExposedHeaders(options));
|
|
27215
|
+
headers.push(configureCredentials(options, req));
|
|
27216
|
+
headers.push(configureExposedHeaders(options, req));
|
|
27217
27217
|
applyHeaders(headers, res);
|
|
27218
27218
|
next();
|
|
27219
27219
|
}
|
|
@@ -28648,7 +28648,7 @@ class Doc {
|
|
|
28648
28648
|
var version = {
|
|
28649
28649
|
major: 4,
|
|
28650
28650
|
minor: 3,
|
|
28651
|
-
patch:
|
|
28651
|
+
patch: 5
|
|
28652
28652
|
};
|
|
28653
28653
|
|
|
28654
28654
|
// ../../node_modules/zod/v4/core/schemas.js
|
|
@@ -29688,7 +29688,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
29688
29688
|
if (keyResult instanceof Promise) {
|
|
29689
29689
|
throw new Error("Async schemas not supported in object keys currently");
|
|
29690
29690
|
}
|
|
29691
|
-
const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length;
|
|
29691
|
+
const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length && keyResult.issues.some((iss) => iss.code === "invalid_type" && iss.expected === "number");
|
|
29692
29692
|
if (checkNumericKey) {
|
|
29693
29693
|
const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
|
|
29694
29694
|
if (retryResult instanceof Promise) {
|
|
@@ -30854,7 +30854,7 @@ function finalize(ctx, schema) {
|
|
|
30854
30854
|
}
|
|
30855
30855
|
}
|
|
30856
30856
|
}
|
|
30857
|
-
if (refSchema.$ref
|
|
30857
|
+
if (refSchema.$ref) {
|
|
30858
30858
|
for (const key in schema2) {
|
|
30859
30859
|
if (key === "$ref" || key === "allOf")
|
|
30860
30860
|
continue;
|