document-mcp 4.14.9 → 4.14.10

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/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.14.9";
9
+ var version = "4.14.10";
10
10
  //#endregion
11
11
  //#region src/register-operation.ts
12
12
  function toErrorResult(error) {
@@ -28,7 +28,7 @@ function registerOperation(server, operation, options) {
28
28
  title: operation.title,
29
29
  description: operation.description,
30
30
  inputSchema: operation.inputSchema,
31
- ...operation.outputSchema === void 0 ? {} : { outputSchema: operation.outputSchema }
31
+ outputSchema: operation.outputSchema
32
32
  }, async (args, ctx) => {
33
33
  try {
34
34
  const result = await operation.run(args, { signal: ctx.mcpReq.signal });
@@ -154,20 +154,28 @@ function createServer$1() {
154
154
  //#endregion
155
155
  //#region src/serve-http.ts
156
156
  const MCP_HTTP_PATH = "/mcp";
157
+ function routeHttpRequest(req, res, onMcpRequest) {
158
+ if (req.url === void 0) throw new Error("serveHttp: request has no url");
159
+ if (new URL(req.url, "http://localhost").pathname !== "/mcp") {
160
+ res.writeHead(404, { "content-type": "text/plain" }).end("Not found");
161
+ return;
162
+ }
163
+ onMcpRequest();
164
+ }
157
165
  function serveHttp(port, host) {
158
166
  const handler = createMcpHandler(createServer$1);
159
167
  const nodeHandler = toNodeHandler(handler);
160
168
  const httpServer = createServer((req, res) => {
161
- if (req.url === void 0) throw new Error("serveHttp: request has no url");
162
- if (new URL(req.url, "http://localhost").pathname !== "/mcp") {
163
- res.writeHead(404, { "content-type": "text/plain" }).end("Not found");
164
- return;
165
- }
166
- nodeHandler(req, res);
169
+ routeHttpRequest(req, res, () => {
170
+ nodeHandler(req, res);
171
+ });
167
172
  });
168
173
  return new Promise((resolve) => {
169
174
  httpServer.listen(port, host, () => {
170
- resolve(httpServer);
175
+ resolve({
176
+ server: httpServer,
177
+ address: httpServer.address()
178
+ });
171
179
  });
172
180
  });
173
181
  }
@@ -206,9 +214,7 @@ async function main() {
206
214
  const portArg = readFlag(args, "port");
207
215
  const port = portArg === void 0 ? DEFAULT_HTTP_PORT : parsePort(portArg);
208
216
  const host = readFlag(args, "host") ?? "127.0.0.1";
209
- const httpServer = await serveHttp(port, host);
210
- const address = httpServer.address();
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");
217
+ const { server: httpServer, address } = await serveHttp(port, host);
212
218
  console.error(`document-mcp listening on http://${host}:${String(address.port)}${MCP_HTTP_PATH}`);
213
219
  return httpServer;
214
220
  }
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.14.9";
6
+ var version = "4.14.10";
7
7
  //#endregion
8
8
  //#region src/register-operation.ts
9
9
  function toErrorResult(error) {
@@ -25,7 +25,7 @@ function registerOperation(server, operation, options) {
25
25
  title: operation.title,
26
26
  description: operation.description,
27
27
  inputSchema: operation.inputSchema,
28
- ...operation.outputSchema === void 0 ? {} : { outputSchema: operation.outputSchema }
28
+ outputSchema: operation.outputSchema
29
29
  }, async (args, ctx) => {
30
30
  try {
31
31
  const result = await operation.run(args, { signal: ctx.mcpReq.signal });
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.14.9";
5
+ var version = "4.14.10";
6
6
  //#endregion
7
7
  //#region src/register-operation.ts
8
8
  function toErrorResult(error) {
@@ -24,7 +24,7 @@ function registerOperation(server, operation, options) {
24
24
  title: operation.title,
25
25
  description: operation.description,
26
26
  inputSchema: operation.inputSchema,
27
- ...operation.outputSchema === void 0 ? {} : { outputSchema: operation.outputSchema }
27
+ outputSchema: operation.outputSchema
28
28
  }, async (args, ctx) => {
29
29
  try {
30
30
  const result = await operation.run(args, { signal: ctx.mcpReq.signal });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "document-mcp",
3
- "version": "4.14.9",
3
+ "version": "4.14.10",
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": {