document-mcp 4.13.0 → 4.14.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 +10 -0
- package/dist/bin.js +7 -5
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -191,6 +191,16 @@ Then add the server URL (e.g., `https://your-host:3000/mcp`) as a connector in C
|
|
|
191
191
|
|
|
192
192
|
Every release also attaches a Node [single-executable application](https://nodejs.org/api/single-executable-applications.html) build for Linux (x64 and arm64), Windows (x64 and arm64), and macOS (Apple Silicon and Intel) to that release's own GitHub Release assets — the entire server and its dependencies embedded in one file, needing no Node.js install or `npx` at all. It supports both `stdio` and `--transport http` exactly as above; point an MCP client's `command` at the downloaded binary directly instead of `npx`/`node`. Download the asset matching your platform from the package's tag on the [Releases page](https://github.com/ExaDev/documents.js/releases) and run it directly (`chmod +x` on Linux/macOS first).
|
|
193
193
|
|
|
194
|
+
### Container image
|
|
195
|
+
|
|
196
|
+
Every release also publishes a multi-arch (`linux/amd64` + `linux/arm64`) container image to GitHub Container Registry, wrapping the identical standalone `--transport http` binary above on a minimal [distroless](https://github.com/GoogleContainerTools/distroless) base rather than a Node install:
|
|
197
|
+
|
|
198
|
+
```sh
|
|
199
|
+
docker run -p 3000:3000 ghcr.io/exadev/document-mcp:VERSION --port 3000
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The image always runs in `--transport http` mode — `stdio` mode is exec'd directly by an MCP client as a subprocess, which a container has no role in — and binds to `0.0.0.0` inside the container regardless of `--port`, so `-p <host>:<container>` reaches `/mcp` directly. Replace `VERSION` with the package's own exact release version; `latest` also tracks the newest release, matching `document-rest`'s identical image. See [Remote transport](#remote-transport-http) above for this listener's own lack of authentication.
|
|
203
|
+
|
|
194
204
|
### Development
|
|
195
205
|
|
|
196
206
|
Requires Node.js `>=20` and pnpm `11.6.0` (pinned via `packageManager` in `package.json`).
|
package/dist/bin.js
CHANGED
|
@@ -6,7 +6,7 @@ import { McpServer, createMcpHandler } from "@modelcontextprotocol/server";
|
|
|
6
6
|
import { computeFormulaOperation, convertDocumentOperation, describeFontFileOperation, documentAppendParagraphsOperation, documentCreateOperation, docxExtrasOperation, fontsOperation, fromPackageOperation, listDocumentConversionsOperation, metadataReadOperation, metadataWriteOperation, odbFormsOperation, odbQueryOperation, odbRenderReportOperation, odbReportsOperation, odbTablesOperation, odbToCsvOperation, odbToXlsxOperation, odmToPdfOperation, outlineDocumentOperation, pdfInspectOperation } from "document-operations";
|
|
7
7
|
import { OdbReportNotSpecifiedError, OdmUnresolvedSectionError } from "documents.js";
|
|
8
8
|
//#region package.json
|
|
9
|
-
var version = "4.
|
|
9
|
+
var version = "4.14.0";
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/register-operation.ts
|
|
12
12
|
function toErrorResult(error) {
|
|
@@ -154,7 +154,7 @@ function createServer$1() {
|
|
|
154
154
|
//#endregion
|
|
155
155
|
//#region src/serve-http.ts
|
|
156
156
|
const MCP_HTTP_PATH = "/mcp";
|
|
157
|
-
function serveHttp(port) {
|
|
157
|
+
function serveHttp(port, host) {
|
|
158
158
|
const handler = createMcpHandler(createServer$1);
|
|
159
159
|
const nodeHandler = toNodeHandler(handler);
|
|
160
160
|
const httpServer = createServer((req, res) => {
|
|
@@ -166,7 +166,7 @@ function serveHttp(port) {
|
|
|
166
166
|
nodeHandler(req, res);
|
|
167
167
|
});
|
|
168
168
|
return new Promise((resolve) => {
|
|
169
|
-
httpServer.listen(port,
|
|
169
|
+
httpServer.listen(port, host, () => {
|
|
170
170
|
resolve(httpServer);
|
|
171
171
|
});
|
|
172
172
|
});
|
|
@@ -204,10 +204,12 @@ async function main() {
|
|
|
204
204
|
}
|
|
205
205
|
if (transport === "http") {
|
|
206
206
|
const portArg = readFlag(args, "port");
|
|
207
|
-
const
|
|
207
|
+
const port = portArg === void 0 ? DEFAULT_HTTP_PORT : parsePort(portArg);
|
|
208
|
+
const host = readFlag(args, "host") ?? "127.0.0.1";
|
|
209
|
+
const httpServer = await serveHttp(port, host);
|
|
208
210
|
const address = httpServer.address();
|
|
209
211
|
if (address === null || typeof address === "string") throw new Error("Expected the HTTP server to bind a TCP address, not a pipe or Unix socket");
|
|
210
|
-
console.error(`document-mcp listening on http
|
|
212
|
+
console.error(`document-mcp listening on http://${host}:${String(address.port)}${MCP_HTTP_PATH}`);
|
|
211
213
|
return httpServer;
|
|
212
214
|
}
|
|
213
215
|
throw new Error(`Unknown --transport "${transport}". Supported values: stdio, http.`);
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ let _modelcontextprotocol_server = require("@modelcontextprotocol/server");
|
|
|
3
3
|
let document_operations = require("document-operations");
|
|
4
4
|
let documents_js = require("documents.js");
|
|
5
5
|
//#region package.json
|
|
6
|
-
var version = "4.
|
|
6
|
+
var version = "4.14.0";
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/register-operation.ts
|
|
9
9
|
function toErrorResult(error) {
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { McpServer } from "@modelcontextprotocol/server";
|
|
|
2
2
|
import { computeFormulaOperation, convertDocumentOperation, describeFontFileOperation, documentAppendParagraphsOperation, documentCreateOperation, docxExtrasOperation, fontsOperation, fromPackageOperation, listDocumentConversionsOperation, metadataReadOperation, metadataWriteOperation, odbFormsOperation, odbQueryOperation, odbRenderReportOperation, odbReportsOperation, odbTablesOperation, odbToCsvOperation, odbToXlsxOperation, odmToPdfOperation, outlineDocumentOperation, pdfInspectOperation } from "document-operations";
|
|
3
3
|
import { OdbReportNotSpecifiedError, OdmUnresolvedSectionError } from "documents.js";
|
|
4
4
|
//#region package.json
|
|
5
|
-
var version = "4.
|
|
5
|
+
var version = "4.14.0";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/register-operation.ts
|
|
8
8
|
function toErrorResult(error) {
|
package/package.json
CHANGED