New:Socket for Asana Is Now Available.Learn more
Sign In

polydoc-mcp

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

polydoc-mcp - npm Package Compare versions

Comparing version
0.1.4
to
0.1.5
+12
-0
dist/polydoc/buildRequestBody.js

@@ -64,2 +64,11 @@ /**

}
/** Conformance targets live under `pdf`, not `layout`. */
function buildPdfConformance(opts) {
const pdf = {};
for (const target of ['pdfa', 'pdfua']) {
if (isPlainObject(opts[target]))
pdf[target] = opts[target];
}
return Object.keys(pdf).length > 0 ? pdf : undefined;
}
function buildScreenshot(opts) {

@@ -102,2 +111,5 @@ const shot = {};

body.layout = layout;
const pdf = params.pdfOptions ? buildPdfConformance(params.pdfOptions) : undefined;
if (pdf)
body.pdf = pdf;
}

@@ -104,0 +116,0 @@ if (params.operation === 'screenshot') {

+22
-2

@@ -12,2 +12,3 @@ import { z } from 'zod';

export const IMAGE_TYPES = ['png', 'jpeg', 'webp'];
export const PDFA_LEVELS = ['1b', '2b', '3b'];
export const EINVOICE_STANDARDS = ['zugferd', 'facturx'];

@@ -69,3 +70,3 @@ export const EINVOICE_PROFILES = ['minimum', 'basicwl', 'basic', 'en16931', 'extended'];

.optional()
.describe('Raw fields deep-merged into the request body for any API option not exposed here (e.g. pdf.watermark, pdf.pdfa, pdf.pdfua, render, request).'),
.describe('Raw fields deep-merged into the request body for any API option not exposed here (e.g. pdf.watermark, render, request).'),
returnBase64: z

@@ -89,5 +90,24 @@ .boolean()

marginLeft: z.string().optional(),
pdfa: z
.object({
level: z.enum(PDFA_LEVELS).describe('Archival target. Use "3b" unless a downstream system requires "2b" or "1b".'),
verify: z
.boolean()
.optional()
.describe('Validate the output with veraPDF and fail the request (422) if it does not conform.'),
})
.optional()
.describe('Produce archivable PDF/A output. Best-effort unless verify is set.'),
pdfua: z
.object({
verify: z
.boolean()
.optional()
.describe('Validate the output with veraPDF and fail the request (422) if it does not conform.'),
})
.optional()
.describe('Produce accessible PDF/UA-1 (ISO 14289-1) output; forces a tagged render. Best-effort unless verify is set.'),
})
.optional()
.describe('Page layout options.');
.describe('Page layout and PDF conformance options.');
export const screenshotOptionsSchema = z

@@ -94,0 +114,0 @@ .object({

+7
-2
{
"name": "polydoc-mcp",
"version": "0.1.4",
"description": "PolyDoc MCP server: HTML/URL to PDF, screenshots, and EU e-invoices (Factur-X / ZUGFeRD) for MCP clients.",
"version": "0.1.5",
"description": "PolyDoc MCP server: HTML/URL to PDF, screenshots, and EU e-invoices, with best-effort PDF/A and PDF/UA output and an optional veraPDF verify step that fails non-conforming files.",
"mcpName": "tech.polydoc/polydoc-mcp",

@@ -27,2 +27,7 @@ "license": "MIT",

"screenshot",
"pdf-a",
"pdf-ua",
"tagged-pdf",
"accessibility",
"verapdf",
"e-invoice",

@@ -29,0 +34,0 @@ "factur-x",

@@ -5,5 +5,7 @@ # polydoc-mcp

PDF output can target **PDF/A** (archival) and **PDF/UA-1** (accessible, ISO 14289-1). Both are best-effort by default; set `verify` on either to validate the result with veraPDF and fail the request instead of returning a non-conforming file.
## Tools
- **`polydoc_html_to_pdf`** - HTML, URL, or saved template to PDF (layout, margins, page format, page ranges, bookmarks, accessible/tagged PDFs).
- **`polydoc_html_to_pdf`** - HTML, URL, or saved template to PDF (layout, margins, page format, page ranges, bookmarks, tagged PDFs, PDF/A and PDF/UA conformance).
- **`polydoc_screenshot`** - HTML, URL, or template to PNG / JPEG / WebP, with viewport and device-pixel-ratio control. Returns an inline image preview when small enough.

@@ -71,2 +73,19 @@ - **`polydoc_generate_einvoice`** - Factur-X or ZUGFeRD hybrid PDF/A-3 from structured invoice data, profiles from `minimum` to `extended`.

## PDF/A and PDF/UA
`polydoc_html_to_pdf` takes two conformance targets inside `pdfOptions`:
```json
{
"pdfOptions": {
"pdfa": { "level": "3b", "verify": true },
"pdfua": { "verify": true }
}
}
```
`pdfa.level` is `1b`, `2b`, or `3b`. Setting `pdfua` forces a tagged render, so you do not need `tagged` as well.
Without `verify`, output is best-effort: it targets the standard but the request still succeeds if the toolchain cannot satisfy every machine-checkable rule. With `verify: true`, veraPDF validates the result and a non-conforming file fails with **422** instead of being returned. Use it when a downstream system will reject a bad file anyway.
## Anything not in a tool's schema?

@@ -73,0 +92,0 @@