document-mcp 1.1.5 → 1.1.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.
- package/README.md +4 -2
- package/dist/bin.js +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> An MCP (Model Context Protocol) server exposing [`documents.js`](https://github.com/ExaDev/documents.js)'s document-conversion, `.odb`, metadata, and font tooling as MCP tools, so an MCP-speaking agent can convert, inspect, and edit docx/pptx/odt/odp/ods/odg/odf/pdf/odb/xlsx/markdown documents without writing TypeScript against `documents.js` directly.
|
|
6
6
|
|
|
7
|
-
`document-mcp` adds no conversion or editing logic of its own — it is a dispatch layer over `documents.js`'s existing conversion functions, `DocumentConverter` port, and `.odb`/PDF readers, wired up as MCP tools served over stdio. [`document-cli`](https://github.com/ExaDev/document-cli) is the sibling frontend over the identical `documents.js` library — a terminal CLI/TUI rather than an MCP server — so the two are independent consumers of one shared implementation and can expose different subsets of it.
|
|
7
|
+
`document-mcp` adds no conversion or editing logic of its own — it is a dispatch layer over `documents.js`'s existing conversion functions, `DocumentConverter` port, and `.odb`/PDF readers, wired up as MCP tools served over stdio. [`document-cli`](https://github.com/ExaDev/document-cli) is the sibling frontend over the identical `documents.js` library — a terminal CLI/TUI rather than an MCP server — so the two are independent consumers of one shared implementation and can expose different subsets of it. A `convert_document` call's fidelity — which `(source, targetFormat)` pairs round-trip losslessly, which are a best-effort reconstruction, and why — is exactly what [`documents.js`'s own Fidelity section](https://github.com/ExaDev/documents.js#fidelity) documents, table included; it is not restated here.
|
|
8
8
|
|
|
9
9
|
```mermaid
|
|
10
10
|
graph TD
|
|
@@ -29,6 +29,8 @@ graph TD
|
|
|
29
29
|
documents --> mcp
|
|
30
30
|
pdfcodec --> mcp
|
|
31
31
|
documents --> cli
|
|
32
|
+
odf --> cli
|
|
33
|
+
pdfcodec --> cli
|
|
32
34
|
|
|
33
35
|
click schema "https://github.com/ExaDev/document-schema.js" "document-schema.js"
|
|
34
36
|
click ooxml "https://github.com/ExaDev/ooxml.js" "ooxml.js"
|
|
@@ -100,7 +102,7 @@ Every tool that takes or produces document bytes goes through the same two hybri
|
|
|
100
102
|
| `convert_document` | Converts a document from one supported format to another via `documents.js`'s `DocumentConverter` port — docx, pptx, xlsx, odt, odp, ods, odg, odf, markdown, and pdf. Not every `(source, targetFormat)` pair is direct; call `list_document_conversions` first. |
|
|
101
103
|
| `list_document_conversions` | Lists every `(source, target)` format pair `convert_document` actually supports. |
|
|
102
104
|
| `metadata_read` | Reads a document's title/author/subject/keywords/creator/producer/created-and-modified timestamps. Works across every supported format, including xlsx and odf. |
|
|
103
|
-
| `metadata_write` | Patches a document's title/author/subject/keywords in place. Does not convert format — source and target format must match (or both be `pdf`);
|
|
105
|
+
| `metadata_write` | Patches a document's title/author/subject/keywords in place. Does not convert format — source and target format must match (or both be `pdf`); odf (a standalone formula document) is rejected as either, since it has no write path back out at all. |
|
|
104
106
|
| `fonts` | Lists every source-embedded font face a docx/pptx/odt/odp/ods/odg document carries (family, weight/style, byte length). |
|
|
105
107
|
| `describe_font_file` | Reads a standalone `.ttf`/`.otf` font file and reports the family/bold/italic triple it declares about itself. |
|
|
106
108
|
| `docx_extras` | Reads a docx's own comments, footnotes, headers, footers, and numbering definitions — data the `ContentDocument` pivot cannot carry, so no other tool sees it. |
|
package/dist/bin.js
CHANGED
|
@@ -8,7 +8,7 @@ import { readFontFace } from "pdf-codec";
|
|
|
8
8
|
import { existsSync, readFileSync } from "node:fs";
|
|
9
9
|
import { basename, join } from "node:path";
|
|
10
10
|
//#region package.json
|
|
11
|
-
var version = "1.1.
|
|
11
|
+
var version = "1.1.7";
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/io/document-input.ts
|
|
14
14
|
const EXTENSION_TO_FORMAT = {
|
|
@@ -372,7 +372,7 @@ function registerMetadataTools(server) {
|
|
|
372
372
|
});
|
|
373
373
|
server.registerTool("metadata_write", {
|
|
374
374
|
title: "Write document metadata",
|
|
375
|
-
description: "Patches a document's own title/author/subject/keywords, leaving every other field and every other flag as-is. Does not convert format -- the source document's own format and targetFormat must match (or both be 'pdf');
|
|
375
|
+
description: "Patches a document's own title/author/subject/keywords, leaving every other field and every other flag as-is. Does not convert format -- the source document's own format and targetFormat must match (or both be 'pdf'); odf (a standalone formula document) is rejected outright as either a source or a target, since it has no write path back out at all. Convert the document to a different format first (e.g. with a documents.js conversion tool) if metadata needs to be set on the result of a format change.",
|
|
376
376
|
inputSchema: z.object({
|
|
377
377
|
source: DocumentInputSchema.describe("The document to patch metadata on."),
|
|
378
378
|
targetFormat: DocumentFormatSchema.describe("The format to write the patched document back out as -- must match the source document's own format (or both be 'pdf'). metadata_write never converts format."),
|
package/dist/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ let pdf_codec = require("pdf-codec");
|
|
|
7
7
|
let node_fs = require("node:fs");
|
|
8
8
|
let node_path = require("node:path");
|
|
9
9
|
//#region package.json
|
|
10
|
-
var version = "1.1.
|
|
10
|
+
var version = "1.1.7";
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/io/document-input.ts
|
|
13
13
|
const EXTENSION_TO_FORMAT = {
|
|
@@ -371,7 +371,7 @@ function registerMetadataTools(server) {
|
|
|
371
371
|
});
|
|
372
372
|
server.registerTool("metadata_write", {
|
|
373
373
|
title: "Write document metadata",
|
|
374
|
-
description: "Patches a document's own title/author/subject/keywords, leaving every other field and every other flag as-is. Does not convert format -- the source document's own format and targetFormat must match (or both be 'pdf');
|
|
374
|
+
description: "Patches a document's own title/author/subject/keywords, leaving every other field and every other flag as-is. Does not convert format -- the source document's own format and targetFormat must match (or both be 'pdf'); odf (a standalone formula document) is rejected outright as either a source or a target, since it has no write path back out at all. Convert the document to a different format first (e.g. with a documents.js conversion tool) if metadata needs to be set on the result of a format change.",
|
|
375
375
|
inputSchema: zod.z.object({
|
|
376
376
|
source: DocumentInputSchema.describe("The document to patch metadata on."),
|
|
377
377
|
targetFormat: documents_js.DocumentFormatSchema.describe("The format to write the patched document back out as -- must match the source document's own format (or both be 'pdf'). metadata_write never converts format."),
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { readFontFace } from "pdf-codec";
|
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
7
7
|
import { basename, join } from "node:path";
|
|
8
8
|
//#region package.json
|
|
9
|
-
var version = "1.1.
|
|
9
|
+
var version = "1.1.7";
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/io/document-input.ts
|
|
12
12
|
const EXTENSION_TO_FORMAT = {
|
|
@@ -370,7 +370,7 @@ function registerMetadataTools(server) {
|
|
|
370
370
|
});
|
|
371
371
|
server.registerTool("metadata_write", {
|
|
372
372
|
title: "Write document metadata",
|
|
373
|
-
description: "Patches a document's own title/author/subject/keywords, leaving every other field and every other flag as-is. Does not convert format -- the source document's own format and targetFormat must match (or both be 'pdf');
|
|
373
|
+
description: "Patches a document's own title/author/subject/keywords, leaving every other field and every other flag as-is. Does not convert format -- the source document's own format and targetFormat must match (or both be 'pdf'); odf (a standalone formula document) is rejected outright as either a source or a target, since it has no write path back out at all. Convert the document to a different format first (e.g. with a documents.js conversion tool) if metadata needs to be set on the result of a format change.",
|
|
374
374
|
inputSchema: z.object({
|
|
375
375
|
source: DocumentInputSchema.describe("The document to patch metadata on."),
|
|
376
376
|
targetFormat: DocumentFormatSchema.describe("The format to write the patched document back out as -- must match the source document's own format (or both be 'pdf'). metadata_write never converts format."),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-mcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
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": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"packageManager": "pnpm@11.6.0",
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
72
|
-
"documents.js": "^1.
|
|
72
|
+
"documents.js": "^1.81.8",
|
|
73
73
|
"pdf-codec": "^1.11.0",
|
|
74
74
|
"zod": "^4.2.0"
|
|
75
75
|
},
|