@modelcontextprotocol/server-pdf 0.4.1 → 1.0.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 +94 -45
- package/dist/index.js +23609 -28764
- package/dist/mcp-app.html +26 -29
- package/dist/server.d.ts +30 -8
- package/dist/server.js +8676 -8701
- package/package.json +3 -3
- package/dist/src/pdf-indexer.d.ts +0 -15
- package/dist/src/pdf-loader.d.ts +0 -5
- package/dist/src/types.d.ts +0 -50
package/dist/server.d.ts
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
1
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
-
/**
|
|
3
|
-
* Initialize the PDF index with the given URLs.
|
|
4
|
-
* Must be called before createServer().
|
|
5
|
-
*/
|
|
6
|
-
export declare function initializePdfIndex(urls: string[]): Promise<void>;
|
|
7
1
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
2
|
+
* PDF MCP Server
|
|
3
|
+
*
|
|
4
|
+
* An MCP server that displays PDFs in an interactive viewer.
|
|
5
|
+
* Supports local files and remote URLs from academic sources (arxiv, biorxiv, etc).
|
|
6
|
+
*
|
|
7
|
+
* Tools:
|
|
8
|
+
* - list_pdfs: List available PDFs
|
|
9
|
+
* - display_pdf: Show interactive PDF viewer
|
|
10
|
+
* - read_pdf_bytes: Stream PDF data in chunks (used by viewer)
|
|
10
11
|
*/
|
|
12
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
13
|
+
export declare const DEFAULT_PDF = "https://arxiv.org/pdf/1706.03762";
|
|
14
|
+
export declare const MAX_CHUNK_BYTES: number;
|
|
15
|
+
export declare const RESOURCE_URI = "ui://pdf-viewer/mcp-app.html";
|
|
16
|
+
/** Allowed remote origins (security allowlist) */
|
|
17
|
+
export declare const allowedRemoteOrigins: Set<string>;
|
|
18
|
+
/** Allowed local file paths (populated from CLI args) */
|
|
19
|
+
export declare const allowedLocalFiles: Set<string>;
|
|
20
|
+
export declare function isFileUrl(url: string): boolean;
|
|
21
|
+
export declare function isArxivUrl(url: string): boolean;
|
|
22
|
+
export declare function normalizeArxivUrl(url: string): string;
|
|
23
|
+
export declare function fileUrlToPath(fileUrl: string): string;
|
|
24
|
+
export declare function pathToFileUrl(filePath: string): string;
|
|
25
|
+
export declare function validateUrl(url: string): {
|
|
26
|
+
valid: boolean;
|
|
27
|
+
error?: string;
|
|
28
|
+
};
|
|
29
|
+
export declare function readPdfRange(url: string, offset: number, byteCount: number): Promise<{
|
|
30
|
+
data: Uint8Array;
|
|
31
|
+
totalBytes: number;
|
|
32
|
+
}>;
|
|
11
33
|
export declare function createServer(): McpServer;
|