@sylphx/pdf-reader-mcp 2.0.2 → 2.0.7

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.
Files changed (3) hide show
  1. package/README.md +14 -13
  2. package/dist/index.js +2 -12
  3. package/package.json +103 -104
package/README.md CHANGED
@@ -1,15 +1,16 @@
1
1
  <div align="center">
2
2
 
3
- # PDF Reader MCP 📄
3
+ # 📄 @sylphx/pdf-reader-mcp
4
4
 
5
- **Production-ready PDF processing server for AI agents**
5
+ > Production-ready PDF processing server for AI agents
6
6
 
7
+ [![npm version](https://img.shields.io/npm/v/@sylphx/pdf-reader-mcp?style=flat-square)](https://www.npmjs.com/package/@sylphx/pdf-reader-mcp)
8
+ [![License](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](https://opensource.org/licenses/MIT)
7
9
  [![CI/CD](https://img.shields.io/github/actions/workflow/status/SylphxAI/pdf-reader-mcp/ci.yml?style=flat-square&label=CI/CD)](https://github.com/SylphxAI/pdf-reader-mcp/actions/workflows/ci.yml)
8
10
  [![codecov](https://img.shields.io/codecov/c/github/SylphxAI/pdf-reader-mcp?style=flat-square)](https://codecov.io/gh/SylphxAI/pdf-reader-mcp)
9
- [![npm version](https://img.shields.io/npm/v/@sylphx/pdf-reader-mcp?style=flat-square)](https://www.npmjs.com/package/@sylphx/pdf-reader-mcp)
10
11
  [![coverage](https://img.shields.io/badge/coverage-94.17%25-brightgreen?style=flat-square)](https://pdf-reader-msu3esos4-sylphx.vercel.app)
12
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue.svg?style=flat-square)](https://www.typescriptlang.org/)
11
13
  [![Downloads](https://img.shields.io/npm/dm/@sylphx/pdf-reader-mcp?style=flat-square)](https://www.npmjs.com/package/@sylphx/pdf-reader-mcp)
12
- [![License](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](https://opensource.org/licenses/MIT)
13
14
 
14
15
  **5-10x faster parallel processing** • **Y-coordinate content ordering** • **94%+ test coverage** • **103 tests passing**
15
16
 
@@ -780,12 +781,12 @@ This project uses the following [@sylphx](https://github.com/SylphxAI) packages:
780
781
 
781
782
  ---
782
783
 
783
- <p align="center">
784
- <strong>5-10x faster. Production-ready. Battle-tested.</strong>
785
- <br>
786
- <sub>The PDF processing server that actually scales</sub>
787
- <br><br>
788
- <a href="https://sylphx.com">sylphx.com</a> •
789
- <a href="https://x.com/SylphxAI">@SylphxAI</a>
790
- <a href="mailto:hi@sylphx.com">hi@sylphx.com</a>
791
- </p>
784
+ ## Star History
785
+
786
+ [![Star History Chart](https://api.star-history.com/svg?repos=SylphxAI/pdf-reader-mcp&type=Date)](https://star-history.com/#SylphxAI/pdf-reader-mcp&Date)
787
+
788
+ ---
789
+
790
+ <div align="center">
791
+ <sub>Built with ❤️ by <a href="https://github.com/SylphxAI">Sylphx</a></sub>
792
+ </div>
package/dist/index.js CHANGED
@@ -329,24 +329,14 @@ class PdfError extends Error {
329
329
  }
330
330
 
331
331
  // src/utils/pathUtils.ts
332
- import os from "node:os";
333
332
  import path from "node:path";
334
333
  var PROJECT_ROOT = process.cwd();
335
- var ALLOWED_ROOTS = [PROJECT_ROOT, os.homedir()];
336
334
  var resolvePath = (userPath) => {
337
335
  if (typeof userPath !== "string") {
338
336
  throw new PdfError(-32602 /* InvalidParams */, "Path must be a string.");
339
337
  }
340
338
  const normalizedUserPath = path.normalize(userPath);
341
- const resolvedPath = path.isAbsolute(normalizedUserPath) ? normalizedUserPath : path.resolve(PROJECT_ROOT, normalizedUserPath);
342
- const isWithinAllowedRoot = ALLOWED_ROOTS.some((allowedRoot) => {
343
- const relativePath = path.relative(allowedRoot, resolvedPath);
344
- return relativePath !== "" && !relativePath.startsWith("..") && !path.isAbsolute(relativePath);
345
- });
346
- if (!isWithinAllowedRoot) {
347
- throw new PdfError(-32602 /* InvalidParams */, "Access denied: Path resolves outside allowed directories.");
348
- }
349
- return resolvedPath;
339
+ return path.isAbsolute(normalizedUserPath) ? normalizedUserPath : path.resolve(PROJECT_ROOT, normalizedUserPath);
350
340
  };
351
341
 
352
342
  // src/pdf/loader.ts
@@ -617,7 +607,7 @@ var server = createServer({
617
607
  });
618
608
  async function main() {
619
609
  await server.start();
620
- if (process.env.DEBUG_MCP) {
610
+ if (process.env["DEBUG_MCP"]) {
621
611
  console.error("[PDF Reader MCP] Server running on stdio");
622
612
  console.error("[PDF Reader MCP] Project root:", process.cwd());
623
613
  }
package/package.json CHANGED
@@ -1,106 +1,105 @@
1
1
  {
2
- "name": "@sylphx/pdf-reader-mcp",
3
- "version": "2.0.2",
4
- "description": "An MCP server providing tools to read PDF files.",
5
- "type": "module",
6
- "bin": {
7
- "pdf-reader-mcp": "./dist/index.js"
8
- },
9
- "files": [
10
- "dist/",
11
- "README.md",
12
- "LICENSE"
13
- ],
14
- "exports": {
15
- ".": {
16
- "import": "./dist/index.js",
17
- "types": "./dist/index.d.ts"
18
- }
19
- },
20
- "publishConfig": {
21
- "access": "public"
22
- },
23
- "engines": {
24
- "node": ">=22.0.0"
25
- },
26
- "repository": {
27
- "type": "git",
28
- "url": "git+https://github.com/SylphxAI/pdf-reader-mcp.git"
29
- },
30
- "bugs": {
31
- "url": "https://github.com/SylphxAI/pdf-reader-mcp/issues"
32
- },
33
- "homepage": "https://github.com/SylphxAI/pdf-reader-mcp#readme",
34
- "author": "Sylphx <contact@sylphx.com> (https://sylphx.com)",
35
- "license": "MIT",
36
- "keywords": [
37
- "mcp",
38
- "model-context-protocol",
39
- "pdf",
40
- "reader",
41
- "parser",
42
- "typescript",
43
- "node",
44
- "ai",
45
- "agent",
46
- "tool"
47
- ],
48
- "scripts": {
49
- "build": "bunup",
50
- "watch": "tsc --watch",
51
- "inspector": "npx @modelcontextprotocol/inspector dist/index.js",
52
- "test": "bun test",
53
- "test:watch": "bun test --watch",
54
- "test:cov": "bun test --coverage",
55
- "lint": "biome lint .",
56
- "lint:fix": "biome lint --write .",
57
- "format": "biome format --write .",
58
- "check-format": "biome format .",
59
- "check": "biome check .",
60
- "check:fix": "biome check --write .",
61
- "validate": "bun run check && bun run test",
62
- "docs:dev": "leaf dev docs",
63
- "docs:build": "leaf build docs",
64
- "docs:preview": "leaf preview docs",
65
- "start": "node dist/index.js",
66
- "typecheck": "tsc --noEmit",
67
- "benchmark": "bun bench",
68
- "clean": "rm -rf dist coverage",
69
- "docs:api": "typedoc --entryPoints src/index.ts --tsconfig tsconfig.json --plugin typedoc-plugin-markdown --out docs/api --readme none",
70
- "prepublishOnly": "bunx @sylphx/doctor prepublish && bun run clean && bun run build",
71
- "release": "standard-version",
72
- "prepare": "node_modules/.bin/lefthook install || true"
73
- },
74
- "dependencies": {
75
- "@sylphx/mcp-server-sdk": "1.2.0",
76
- "glob": "^11.1.0",
77
- "pdfjs-dist": "^5.4.394",
78
- "pngjs": "^7.0.0",
79
- "zod": "4.2.0-canary.20251124T022609",
80
- "zod-to-json-schema": "^3.25.0"
81
- },
82
- "devDependencies": {
83
- "@biomejs/biome": "^2.3.8",
84
- "@solidjs/router": "^0.15.4",
85
- "@sylphx/biome-config": "^0.4.0",
86
- "@sylphx/bump": "^0.12.1",
87
- "@sylphx/doctor": "^1.23.3",
88
- "@sylphx/leaf": "^1.0.0",
89
- "@sylphx/leaf-theme-default": "^1.0.0",
90
- "@sylphx/tsconfig": "^0.3.0",
91
- "@types/glob": "^8.1.0",
92
- "@types/node": "^24.10.1",
93
- "@types/pngjs": "^6.0.5",
94
- "bunup": "^0.16.10",
95
- "lefthook": "^2.0.4",
96
- "solid-js": "^1.9.10",
97
- "typedoc": "^0.28.14",
98
- "typedoc-plugin-markdown": "^4.9.0",
99
- "typescript": "^5.9.3",
100
- "vite": "^7.2.4"
101
- },
102
- "packageManager": "bun@1.3.1",
103
- "overrides": {
104
- "js-yaml": "^4.1.0"
105
- }
2
+ "name": "@sylphx/pdf-reader-mcp",
3
+ "version": "2.0.7",
4
+ "description": "An MCP server providing tools to read PDF files.",
5
+ "type": "module",
6
+ "bin": {
7
+ "pdf-reader-mcp": "./dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist/",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "import": "./dist/index.js"
17
+ }
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "engines": {
23
+ "node": ">=22.0.0"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/SylphxAI/pdf-reader-mcp.git"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/SylphxAI/pdf-reader-mcp/issues"
31
+ },
32
+ "homepage": "https://github.com/SylphxAI/pdf-reader-mcp#readme",
33
+ "author": "Sylphx <contact@sylphx.com> (https://sylphx.com)",
34
+ "license": "MIT",
35
+ "keywords": [
36
+ "mcp",
37
+ "model-context-protocol",
38
+ "pdf",
39
+ "reader",
40
+ "parser",
41
+ "typescript",
42
+ "node",
43
+ "ai",
44
+ "agent",
45
+ "tool"
46
+ ],
47
+ "scripts": {
48
+ "build": "bunup",
49
+ "watch": "tsc --watch",
50
+ "inspector": "npx @modelcontextprotocol/inspector dist/index.js",
51
+ "test": "bun test",
52
+ "test:watch": "bun test --watch",
53
+ "test:cov": "bun test --coverage",
54
+ "lint": "biome lint .",
55
+ "lint:fix": "biome lint --write .",
56
+ "format": "biome format --write .",
57
+ "check-format": "biome format .",
58
+ "check": "biome check .",
59
+ "check:fix": "biome check --write .",
60
+ "validate": "bun run check && bun run test",
61
+ "docs:dev": "bunx @sylphx/leaf dev docs",
62
+ "docs:build": "bunx @sylphx/leaf build docs",
63
+ "docs:preview": "bunx @sylphx/leaf preview docs",
64
+ "start": "node dist/index.js",
65
+ "typecheck": "tsc --noEmit",
66
+ "benchmark": "bun bench",
67
+ "clean": "rm -rf dist coverage",
68
+ "docs:api": "typedoc --entryPoints src/index.ts --tsconfig tsconfig.json --plugin typedoc-plugin-markdown --out docs/api --readme none",
69
+ "prepublishOnly": "bunx @sylphx/doctor prepublish && bun run clean && bun run build",
70
+ "release": "standard-version",
71
+ "prepare": "node_modules/.bin/lefthook install || true"
72
+ },
73
+ "dependencies": {
74
+ "@sylphx/mcp-server-sdk": "1.3.0",
75
+ "glob": "^13.0.0",
76
+ "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"
80
+ },
81
+ "devDependencies": {
82
+ "@biomejs/biome": "^2.3.8",
83
+ "@solidjs/router": "^0.15.4",
84
+ "@sylphx/biome-config": "^0.4.1",
85
+ "@sylphx/bump": "^0.12.1",
86
+ "@sylphx/doctor": "^1.32.1",
87
+ "@sylphx/leaf": "^1.0.0",
88
+ "@sylphx/leaf-theme-default": "^1.0.0",
89
+ "@sylphx/tsconfig": "^0.3.1",
90
+ "@types/glob": "^8.1.0",
91
+ "@types/node": "^24.10.1",
92
+ "@types/pngjs": "^6.0.5",
93
+ "bunup": "^0.16.10",
94
+ "lefthook": "^2.0.7",
95
+ "solid-js": "^1.9.10",
96
+ "typedoc": "^0.28.15",
97
+ "typedoc-plugin-markdown": "^4.9.0",
98
+ "typescript": "^5.9.3",
99
+ "vite": "^7.2.6"
100
+ },
101
+ "packageManager": "bun@1.3.1",
102
+ "overrides": {
103
+ "js-yaml": "^4.1.0"
104
+ }
106
105
  }