document-mcp 1.4.1 → 1.4.3

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 CHANGED
@@ -50,23 +50,18 @@ graph TD
50
50
 
51
51
  ## Getting started
52
52
 
53
- Requires Node.js `>=20` and pnpm `11.6.0` (pinned via `packageManager` in `package.json`).
53
+ Run the server directly no install step needed:
54
54
 
55
55
  ```sh
56
- pnpm install
57
- pnpm build # tsdown -> dist/ (ESM + CJS + .d.ts)
58
- pnpm typecheck # tsc --noEmit
59
- pnpm lint # eslint . --fix --cache --max-warnings 0
60
- pnpm test # vitest run --project unit
61
- pnpm test:smoke # rebuilds dist/, then spawns dist/bin.js as a real subprocess and drives it over genuine MCP stdio
56
+ npx document-mcp
62
57
  ```
63
58
 
64
- Once published, run the server directly via `npx document-mcp` (stdio transport, no install step needed).
65
-
66
59
  ### Connecting from Claude Code / Claude Desktop
67
60
 
68
61
  Add an entry to the client's MCP server configuration (`claude mcp add` for Claude Code, or the `mcpServers` block in Claude Desktop's config file):
69
62
 
63
+ Add an entry to the client's MCP server configuration (`claude mcp add` for Claude Code, or the `mcpServers` block in Claude Desktop's config file):
64
+
70
65
  ```json
71
66
  {
72
67
  "mcpServers": {
@@ -91,6 +86,20 @@ Or, for local development against a checkout of this repository rather than the
91
86
  }
92
87
  ```
93
88
 
89
+ ### Development
90
+
91
+ Requires Node.js `>=20` and pnpm `11.6.0` (pinned via `packageManager` in `package.json`).
92
+
93
+ ```sh
94
+ pnpm install
95
+ pnpm build # turbo -> tsdown -> dist/ (ESM + CJS + .d.ts)
96
+ pnpm typecheck # turbo -> tsc --noEmit
97
+ pnpm lint # turbo -> eslint . --fix --cache --max-warnings 0
98
+ pnpm test # turbo -> vitest run --project unit
99
+ pnpm test:workers # turbo -> vitest under the real Cloudflare Workers runtime (workerd) via @cloudflare/vitest-pool-workers, driving createServer() through an in-memory JSON-RPC pair
100
+ pnpm test:smoke # turbo -> tsdown then vitest --project smoke -- spawns dist/bin.js as a real subprocess driven over genuine MCP stdio
101
+ ```
102
+
94
103
  ## Document I/O
95
104
 
96
105
  Every tool that takes or produces document bytes goes through the same two hybrid shapes, documented once here rather than repeated per tool below.
@@ -127,6 +136,10 @@ Every tool that takes or produces document bytes goes through the same two hybri
127
136
  - [document-cli](https://github.com/ExaDev/document-cli) — the sibling CLI/TUI over the same library, whose toolchain this repository's scaffold mirrors.
128
137
  - [Model Context Protocol](https://modelcontextprotocol.io) — the protocol this server implements, via [`@modelcontextprotocol/server`](https://www.npmjs.com/package/@modelcontextprotocol/server).
129
138
 
139
+ ## Gotchas
140
+
141
+ - **Runtime dependencies are `documents.js` + `@modelcontextprotocol/server` + `zod` only; `pdf-codec` and `odf.js` are devDependencies (test-support only).** Every runtime reach into either — `ProvidedFont`/`FontSubstitution`/`describeFontFace`/the `WinAnsi` substitution shape — goes through `documents.js`'s own re-exports, so a published install pulls in no direct `pdf-codec`/`odf.js` dependency. `odf.js` survives in `devDependencies` solely because `src/test-support/odm-fixture.ts` and `src/test-support/embedded-font-fixture.ts` build real ODF package fixtures from its low-level XML primitives (`zipPackage`/`el`/`rootElement`), and `src/test-support/` is excluded from the `tsdown` build — only `src/index.ts` and `src/bin.ts` are entry points — so neither fixture module ever ships in `dist/`.
142
+
130
143
  ## License
131
144
 
132
145
  MIT
package/dist/bin.js CHANGED
@@ -7,7 +7,7 @@ import { readFile, writeFile } from "node:fs/promises";
7
7
  import { existsSync, readFileSync } from "node:fs";
8
8
  import { basename, join } from "node:path";
9
9
  //#region package.json
10
- var version = "1.4.1";
10
+ var version = "1.4.3";
11
11
  //#endregion
12
12
  //#region src/io/document-input.ts
13
13
  const EXTENSION_TO_FORMAT = {
package/dist/index.cjs CHANGED
@@ -6,7 +6,7 @@ let node_fs_promises = require("node:fs/promises");
6
6
  let node_fs = require("node:fs");
7
7
  let node_path = require("node:path");
8
8
  //#region package.json
9
- var version = "1.4.1";
9
+ var version = "1.4.3";
10
10
  //#endregion
11
11
  //#region src/io/document-input.ts
12
12
  const EXTENSION_TO_FORMAT = {
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { readFile, writeFile } from "node:fs/promises";
5
5
  import { existsSync, readFileSync } from "node:fs";
6
6
  import { basename, join } from "node:path";
7
7
  //#region package.json
8
- var version = "1.4.1";
8
+ var version = "1.4.3";
9
9
  //#endregion
10
10
  //#region src/io/document-input.ts
11
11
  const EXTENSION_TO_FORMAT = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "document-mcp",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "MCP (Model Context Protocol) server exposing documents.js's document-conversion, .odb, metadata, and font tooling as MCP tools.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -104,7 +104,7 @@
104
104
  "husky": "^9.1.7",
105
105
  "lint-staged": "^17.3.0",
106
106
  "odf.js": "^2.3.1",
107
- "pdf-codec": "^2.1.1",
107
+ "pdf-codec": "^2.1.3",
108
108
  "publint": "^0.3.22",
109
109
  "semantic-release": "^25.0.8",
110
110
  "tsdown": "^0.22.14",