faxseal-mcp 2.1.0 → 2.2.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/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  const BASE_URL = (process.env.FAXSEAL_BASE_URL ?? 'https://faxseal.com').replace(/\/+$/, '');
10
10
  const API_KEY = process.env.FAXSEAL_API_KEY ?? '';
11
11
  const FETCH_TIMEOUT_MS = 30_000;
12
- const SERVER_VERSION = '2.1.0';
12
+ const SERVER_VERSION = '2.2.0';
13
13
 
14
14
  if (!API_KEY) {
15
15
  process.stderr.write('Error: FAXSEAL_API_KEY environment variable is required.\n');
@@ -232,6 +232,37 @@ const handlers = {
232
232
 
233
233
  return ok(lines);
234
234
  },
235
+ open_pdf_editor: async (args) => {
236
+ if (!args.file_url) throw new Error('file_url is required');
237
+ const data = await apiFetch('/api/v1/pdf', {
238
+ method: 'POST',
239
+ headers: authHeaders(),
240
+ body: JSON.stringify({ file_url: args.file_url }),
241
+ });
242
+ return ok([
243
+ 'PDF opened in the FaxSeal editor. Nothing has been edited, signed or sent yet.',
244
+ `Document ID: ${data.document_id}`,
245
+ `Pages: ${data.pages}`,
246
+ `Editor: ${data.editor_url}`,
247
+ `Link expires: ${data.expires_at}`,
248
+ 'Give the user the editor link. They place their own text, dates and signature, click Apply and can download free.',
249
+ 'Then call get_edited_pdf with this document ID. Ready means edits were applied; it does not verify a signature was added. Never claim it is signed unless the user confirms that.',
250
+ ]);
251
+ },
252
+
253
+ get_edited_pdf: async (args) => {
254
+ if (!args.document_id) throw new Error('document_id is required');
255
+ const data = await apiFetch(`/api/v1/pdf/${encodeURIComponent(args.document_id)}`, { headers: authHeaders() });
256
+ if (!data.ready) return ok([`Document ${args.document_id}: not finished yet. The user must apply their edits in the editor first.`]);
257
+ return ok([
258
+ `Document ${data.document_id} is ready.`,
259
+ `Pages: ${data.pages}`,
260
+ data.filename && `File: ${data.filename}`,
261
+ `Download: ${data.download_url}`,
262
+ `Download link expires: ${data.expires_at}`,
263
+ 'Faxing is optional: only send this file with send_fax after the user explicitly approves the recipient and cost.',
264
+ ]);
265
+ },
235
266
  };
236
267
 
237
268
  // ---------------------------------------------------------------------------
@@ -334,6 +365,30 @@ const TOOL_DEFS = [
334
365
  },
335
366
  },
336
367
  },
368
+ {
369
+ name: 'open_pdf_editor',
370
+ description:
371
+ 'Open a PDF from an HTTPS URL in the free FaxSeal editor so the user can add text, dates, checkboxes and their own signature, rotate or remove pages, and download. Does not send a fax or spend credits. Requires an API token with the "Edit and sign PDFs" permission on a personal account. The user must apply edits themselves; never claim the document is signed because this returned a link.',
372
+ inputSchema: {
373
+ type: 'object',
374
+ required: ['file_url'],
375
+ properties: {
376
+ file_url: { type: 'string', description: 'Publicly accessible HTTPS URL to a PDF file' },
377
+ },
378
+ },
379
+ },
380
+ {
381
+ name: 'get_edited_pdf',
382
+ description:
383
+ 'Check whether the user has applied their edits to a document opened with open_pdf_editor. Returns not ready until they do, then a short-lived download URL that can also be passed to send_fax with separate user approval.',
384
+ inputSchema: {
385
+ type: 'object',
386
+ required: ['document_id'],
387
+ properties: {
388
+ document_id: { type: 'string', description: 'Document ID returned by open_pdf_editor' },
389
+ },
390
+ },
391
+ },
337
392
  ];
338
393
 
339
394
  // ---------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "faxseal-mcp",
3
- "version": "2.1.0",
4
- "description": "MCP server for FaxSeal — send, receive, and verify faxes from AI assistants and agents",
3
+ "version": "2.2.0",
4
+ "description": "MCP server for FaxSeal — send, receive, and verify faxes, and edit or sign PDFs free, from AI assistants and agents",
5
5
  "main": "index.js",
6
6
  "bin": {
7
7
  "faxseal-mcp": "index.js"
package/server-http.js CHANGED
@@ -13,7 +13,7 @@ import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprot
13
13
  const PORT = parseInt(process.env.PORT ?? '3001', 10);
14
14
  const BASE_URL = (process.env.FAXSEAL_BASE_URL ?? 'https://faxseal.com').replace(/\/+$/, '');
15
15
  const FETCH_TIMEOUT_MS = 30_000;
16
- const SERVER_VERSION = '2.1.0';
16
+ const SERVER_VERSION = '2.2.0';
17
17
 
18
18
  // ---------------------------------------------------------------------------
19
19
  // HTTP helper — per-request API key, hard timeout, no timer leaks
@@ -207,6 +207,36 @@ function makeHandlers(apiFetch) {
207
207
  }
208
208
  return ok(lines);
209
209
  },
210
+ open_pdf_editor: async (args) => {
211
+ if (!args.file_url) throw new Error('file_url is required');
212
+ const data = await apiFetch('/api/v1/pdf', {
213
+ method: 'POST',
214
+ body: JSON.stringify({ file_url: args.file_url }),
215
+ });
216
+ return ok([
217
+ 'PDF opened in the FaxSeal editor. Nothing has been edited, signed or sent yet.',
218
+ `Document ID: ${data.document_id}`,
219
+ `Pages: ${data.pages}`,
220
+ `Editor: ${data.editor_url}`,
221
+ `Link expires: ${data.expires_at}`,
222
+ 'Give the user the editor link. They place their own text, dates and signature, click Apply and can download free.',
223
+ 'Then call get_edited_pdf with this document ID. Ready means edits were applied; it does not verify a signature was added. Never claim it is signed unless the user confirms that.',
224
+ ]);
225
+ },
226
+
227
+ get_edited_pdf: async (args) => {
228
+ if (!args.document_id) throw new Error('document_id is required');
229
+ const data = await apiFetch(`/api/v1/pdf/${encodeURIComponent(args.document_id)}`);
230
+ if (!data.ready) return ok([`Document ${args.document_id}: not finished yet. The user must apply their edits in the editor first.`]);
231
+ return ok([
232
+ `Document ${data.document_id} is ready.`,
233
+ `Pages: ${data.pages}`,
234
+ data.filename && `File: ${data.filename}`,
235
+ `Download: ${data.download_url}`,
236
+ `Download link expires: ${data.expires_at}`,
237
+ 'Faxing is optional: only send this file with send_fax after the user explicitly approves the recipient and cost.',
238
+ ]);
239
+ },
210
240
  };
211
241
  }
212
242
 
@@ -293,6 +323,30 @@ const TOOL_DEFS = [
293
323
  },
294
324
  },
295
325
  },
326
+ {
327
+ name: 'open_pdf_editor',
328
+ description:
329
+ 'Open a PDF from an HTTPS URL in the free FaxSeal editor so the user can add text, dates, checkboxes and their own signature, rotate or remove pages, and download. Does not send a fax or spend credits. Requires an API token with the "Edit and sign PDFs" permission on a personal account. The user must apply edits themselves; never claim the document is signed because this returned a link.',
330
+ inputSchema: {
331
+ type: 'object',
332
+ required: ['file_url'],
333
+ properties: {
334
+ file_url: { type: 'string', description: 'Publicly accessible HTTPS URL to a PDF file' },
335
+ },
336
+ },
337
+ },
338
+ {
339
+ name: 'get_edited_pdf',
340
+ description:
341
+ 'Check whether the user has applied their edits to a document opened with open_pdf_editor. Returns not ready until they do, then a short-lived download URL that can also be passed to send_fax with separate user approval.',
342
+ inputSchema: {
343
+ type: 'object',
344
+ required: ['document_id'],
345
+ properties: {
346
+ document_id: { type: 'string', description: 'Document ID returned by open_pdf_editor' },
347
+ },
348
+ },
349
+ },
296
350
  ];
297
351
 
298
352
  // ---------------------------------------------------------------------------
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "io.github.grichardomi/faxseal",
4
4
  "title": "FaxSeal",
5
5
  "description": "Send, receive, and verify faxes from AI assistants and agents via FaxSeal.",
6
- "version": "2.1.0",
6
+ "version": "2.2.0",
7
7
  "repository": {
8
8
  "url": "https://github.com/grichardomi/mcp-server",
9
9
  "source": "github"
@@ -19,7 +19,7 @@
19
19
  "registryType": "npm",
20
20
  "name": "faxseal-mcp",
21
21
  "identifier": "faxseal-mcp",
22
- "version": "2.1.0",
22
+ "version": "2.2.0",
23
23
  "runtime": "node",
24
24
  "transport": { "type": "stdio" },
25
25
  "environmentVariables": [