@modelcontextprotocol/server-pdf 1.1.0 → 1.1.2
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 +12 -6
- package/dist/mcp-app.html +40 -28
- package/dist/server.d.ts +6 -3
- package/dist/server.js +629 -594
- package/package.json +1 -1
package/dist/server.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* PDF MCP Server
|
|
3
3
|
*
|
|
4
4
|
* An MCP server that displays PDFs in an interactive viewer.
|
|
5
|
-
* Supports local files and remote URLs
|
|
5
|
+
* Supports local files and remote HTTPS URLs.
|
|
6
6
|
*
|
|
7
7
|
* Tools:
|
|
8
8
|
* - list_pdfs: List available PDFs
|
|
@@ -19,8 +19,6 @@ export declare const CACHE_INACTIVITY_TIMEOUT_MS = 10000;
|
|
|
19
19
|
export declare const CACHE_MAX_LIFETIME_MS = 60000;
|
|
20
20
|
/** Max size for cached PDFs (defensive limit to prevent memory exhaustion) */
|
|
21
21
|
export declare const CACHE_MAX_PDF_SIZE_BYTES: number;
|
|
22
|
-
/** Allowed remote origins (security allowlist) */
|
|
23
|
-
export declare const allowedRemoteOrigins: Set<string>;
|
|
24
22
|
/** Allowed local file paths (populated from CLI args) */
|
|
25
23
|
export declare const allowedLocalFiles: Set<string>;
|
|
26
24
|
/** Allowed local directories (populated from MCP roots) */
|
|
@@ -30,6 +28,11 @@ export declare function isArxivUrl(url: string): boolean;
|
|
|
30
28
|
export declare function normalizeArxivUrl(url: string): string;
|
|
31
29
|
export declare function fileUrlToPath(fileUrl: string): string;
|
|
32
30
|
export declare function pathToFileUrl(filePath: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Check if `dir` is an ancestor of `filePath` using path.relative,
|
|
33
|
+
* which is more robust than string prefix matching (handles normalization).
|
|
34
|
+
*/
|
|
35
|
+
export declare function isAncestorDir(dir: string, filePath: string): boolean;
|
|
33
36
|
export declare function validateUrl(url: string): {
|
|
34
37
|
valid: boolean;
|
|
35
38
|
error?: string;
|