document-mcp 0.0.0 → 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/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/bin.js +18 -0
- package/dist/index.cjs +14 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +13 -0
- package/package.json +94 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ExaDev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# document-mcp
|
|
2
|
+
|
|
3
|
+
[](https://github.com/ExaDev/document-mcp) [](https://www.npmjs.com/package/document-mcp) [](https://github.com/ExaDev/document-mcp/releases/latest) [](https://github.com/ExaDev/document-mcp/actions)
|
|
4
|
+
|
|
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
|
+
|
|
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, live-view editors, and `.odb`/PDF readers, wired up as MCP tools served over stdio.
|
|
8
|
+
|
|
9
|
+
```mermaid
|
|
10
|
+
graph TD
|
|
11
|
+
schema("document-schema.js")
|
|
12
|
+
ooxml("ooxml.js")
|
|
13
|
+
odf("odf.js")
|
|
14
|
+
pdfcodec("pdf-codec")
|
|
15
|
+
mdcodec("markdown-codec")
|
|
16
|
+
documents("documents.js")
|
|
17
|
+
mcp("document-mcp")
|
|
18
|
+
|
|
19
|
+
schema --> ooxml
|
|
20
|
+
schema --> odf
|
|
21
|
+
schema --> pdfcodec
|
|
22
|
+
schema --> mdcodec
|
|
23
|
+
schema --> documents
|
|
24
|
+
ooxml --> documents
|
|
25
|
+
odf --> documents
|
|
26
|
+
pdfcodec --> documents
|
|
27
|
+
mdcodec --> documents
|
|
28
|
+
documents --> mcp
|
|
29
|
+
odf --> mcp
|
|
30
|
+
pdfcodec --> mcp
|
|
31
|
+
|
|
32
|
+
click schema "https://github.com/ExaDev/document-schema.js" "document-schema.js"
|
|
33
|
+
click ooxml "https://github.com/ExaDev/ooxml.js" "ooxml.js"
|
|
34
|
+
click odf "https://github.com/ExaDev/odf.js" "odf.js"
|
|
35
|
+
click pdfcodec "https://github.com/ExaDev/pdf-codec" "pdf-codec"
|
|
36
|
+
click mdcodec "https://github.com/ExaDev/markdown-codec" "markdown-codec"
|
|
37
|
+
click documents "https://github.com/ExaDev/documents.js" "documents.js"
|
|
38
|
+
click mcp "https://github.com/ExaDev/document-mcp" "document-mcp"
|
|
39
|
+
|
|
40
|
+
style mcp fill:#f9a825,stroke:#333,stroke-width:3px
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Status
|
|
44
|
+
|
|
45
|
+
Under construction. This repository currently holds the project scaffold only (package/build/lint/release tooling and the shared hybrid document input/output I/O helpers) — no MCP tools are registered yet. A later phase wires `documents.js`'s conversions, `.odb` reading, metadata, and font tooling up as real MCP tools. This README will be rewritten once that lands.
|
|
46
|
+
|
|
47
|
+
## Getting started
|
|
48
|
+
|
|
49
|
+
Requires Node.js `>=20` and pnpm `11.6.0` (pinned via `packageManager` in `package.json`).
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
pnpm install
|
|
53
|
+
pnpm build # tsdown -> dist/ (ESM + CJS + .d.ts)
|
|
54
|
+
pnpm typecheck # tsc --noEmit
|
|
55
|
+
pnpm lint # eslint . --max-warnings 0
|
|
56
|
+
pnpm test # vitest run --project unit
|
|
57
|
+
pnpm test:smoke # rebuilds dist/, then a smoke pass over the built server
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Once published, run the server directly via `npx document-mcp` (stdio transport).
|
|
61
|
+
|
|
62
|
+
## References
|
|
63
|
+
|
|
64
|
+
- [documents.js](https://github.com/ExaDev/documents.js) — the library this server exposes.
|
|
65
|
+
- [document-cli](https://github.com/ExaDev/document-cli) — the sibling CLI/TUI over the same library, whose toolchain this repository's scaffold mirrors.
|
|
66
|
+
- [Model Context Protocol](https://modelcontextprotocol.io) — the protocol this server implements, via [`@modelcontextprotocol/server`](https://www.npmjs.com/package/@modelcontextprotocol/server).
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
MIT
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { serveStdio } from "@modelcontextprotocol/server/stdio";
|
|
3
|
+
import { McpServer } from "@modelcontextprotocol/server";
|
|
4
|
+
//#region package.json
|
|
5
|
+
var version = "1.0.0";
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/server.ts
|
|
8
|
+
function createServer() {
|
|
9
|
+
return new McpServer({
|
|
10
|
+
name: "document-mcp",
|
|
11
|
+
version
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/bin.ts
|
|
16
|
+
serveStdio(createServer);
|
|
17
|
+
//#endregion
|
|
18
|
+
export {};
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _modelcontextprotocol_server = require("@modelcontextprotocol/server");
|
|
3
|
+
//#region package.json
|
|
4
|
+
var version = "1.0.0";
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/server.ts
|
|
7
|
+
function createServer() {
|
|
8
|
+
return new _modelcontextprotocol_server.McpServer({
|
|
9
|
+
name: "document-mcp",
|
|
10
|
+
version
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.createServer = createServer;
|
package/dist/index.d.cts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/server";
|
|
2
|
+
//#region package.json
|
|
3
|
+
var version = "1.0.0";
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/server.ts
|
|
6
|
+
function createServer() {
|
|
7
|
+
return new McpServer({
|
|
8
|
+
name: "document-mcp",
|
|
9
|
+
version
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { createServer };
|
package/package.json
CHANGED
|
@@ -1,5 +1,97 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-mcp",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP (Model Context Protocol) server exposing documents.js's document-conversion, .odb, metadata, and font tooling as MCP tools.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/ExaDev/document-mcp.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/ExaDev/document-mcp#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/ExaDev/document-mcp/issues"
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"document-mcp": "./dist/bin.js"
|
|
16
|
+
},
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": {
|
|
20
|
+
"import": "./dist/index.d.ts",
|
|
21
|
+
"require": "./dist/index.d.cts"
|
|
22
|
+
},
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"require": "./dist/index.cjs"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"main": "./dist/index.cjs",
|
|
28
|
+
"module": "./dist/index.js",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public",
|
|
35
|
+
"provenance": true,
|
|
36
|
+
"registry": "https://registry.npmjs.org/"
|
|
37
|
+
},
|
|
38
|
+
"sideEffects": false,
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsdown",
|
|
44
|
+
"prepublishOnly": "pnpm run lint && pnpm run typecheck && tsdown && publint && attw --pack",
|
|
45
|
+
"lint": "eslint . --max-warnings 0",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"test": "vitest run --project unit",
|
|
48
|
+
"test:watch": "vitest --project unit",
|
|
49
|
+
"test:coverage": "vitest run --project unit --coverage",
|
|
50
|
+
"test:smoke": "tsdown && vitest run --project smoke",
|
|
51
|
+
"prepare": "husky",
|
|
52
|
+
"release": "semantic-release"
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"mcp",
|
|
56
|
+
"model-context-protocol",
|
|
57
|
+
"docx",
|
|
58
|
+
"pptx",
|
|
59
|
+
"pdf",
|
|
60
|
+
"odt",
|
|
61
|
+
"odp",
|
|
62
|
+
"ods",
|
|
63
|
+
"odg",
|
|
64
|
+
"odf",
|
|
65
|
+
"odb",
|
|
66
|
+
"document-conversion"
|
|
67
|
+
],
|
|
68
|
+
"license": "MIT",
|
|
69
|
+
"packageManager": "pnpm@11.6.0",
|
|
70
|
+
"dependencies": {
|
|
71
|
+
"@modelcontextprotocol/server": "^2.0.0",
|
|
72
|
+
"documents.js": "^1.77.1",
|
|
73
|
+
"odf.js": "^2.3.0",
|
|
74
|
+
"pdf-codec": "^1.11.0",
|
|
75
|
+
"zod": "^4.2.0"
|
|
76
|
+
},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
79
|
+
"@commitlint/cli": "^21.2.1",
|
|
80
|
+
"@commitlint/config-conventional": "^21.2.0",
|
|
81
|
+
"@eslint/js": "^10.0.1",
|
|
82
|
+
"@semantic-release/changelog": "^7.0.0",
|
|
83
|
+
"@semantic-release/git": "^11.0.1",
|
|
84
|
+
"@types/node": "^26.1.2",
|
|
85
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
86
|
+
"eslint": "^10.8.0",
|
|
87
|
+
"globals": "^17.8.0",
|
|
88
|
+
"husky": "^9.1.7",
|
|
89
|
+
"lint-staged": "^17.3.0",
|
|
90
|
+
"publint": "^0.3.22",
|
|
91
|
+
"semantic-release": "^25.0.8",
|
|
92
|
+
"tsdown": "^0.22.14",
|
|
93
|
+
"typescript": "^6.0.3",
|
|
94
|
+
"typescript-eslint": "^8.65.0",
|
|
95
|
+
"vitest": "^4.1.10"
|
|
96
|
+
}
|
|
5
97
|
}
|