hilvana-mcp
OfficialProvides KDP check and preparation workflows to validate and prepare PDFs for Amazon KDP paperback or hardcover publishing.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@hilvana-mcp Merge factura-enero.pdf and factura-febrero.pdf, then number the pages."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Hilvana
Flujos de PDF para agentes, privados por diseño. · Agent-ready PDF workflows, private by design.
Español
Hilvana une, divide, firma, numera y limpia PDFs, y convierte Word a PDF, en tu equipo. Ningún archivo se sube a un servidor y ningún modelo de IA ve su contenido.
Lo distinto es que trabaja con recetas: describes el resultado y Hilvana encadena los pasos, los valida antes de tocar nada y comprueba al final que se cumplió el objetivo. Tu agente de IA (por ejemplo Claude) puede usarlo directamente a través de un servidor MCP.
Estado: v0.1 publicada en npm. El motor, las recetas, la CLI y el servidor MCP funcionan. La aplicación web (fase 1) procesa todo en el navegador, sin subir archivos, y funciona sin conexión (docs/web.md, hoja de ruta).
Qué puede hacer hoy
Operación | CLI | Paso de receta |
Word (.docx) a PDF con texto seleccionable |
|
|
Unir PDFs y documentos de Word |
|
|
Conservar, reordenar o eliminar páginas |
|
|
Girar páginas |
|
|
Firmar con una imagen |
|
|
Escribir texto (fecha, referencia) |
|
|
Marca de agua |
|
|
Numerar páginas |
|
|
Borrar metadatos (autor, herramientas) |
|
|
Comprimir (o llegar a un peso objetivo) sin rasterizar el texto |
|
|
Imágenes a PDF |
|
|
Firma digital con certificado (.p12/.pfx, PAdES) |
|
|
Reconocer texto de escaneos (OCR en español e inglés, en tu equipo) |
|
|
Tachar de verdad (texto, imágenes y formas bajo cada zona) |
|
|
Proteger con contraseña (AES-256) o restringir el uso |
|
|
Quitar la contraseña o las restricciones, sin cambiar nada más |
|
|
Revisar y preparar un libro para Amazon KDP (tapa blanda o dura; en la web, «Preparar para KDP») |
|
|
Ejecutar una receta completa |
| — |
Aplicar una receta a cada archivo (lote) |
| — |
Una receta
{
"version": 1,
"name": "Expediente mensual",
"steps": [
{ "op": "merge", "files": ["factura-febrero.pdf", "factura-enero.pdf"] },
{ "op": "stampText", "text": "Recibido {date}", "pages": "1", "anchor": "top-right" },
{ "op": "numberPages", "format": "Página {n} de {total}" },
{ "op": "sign", "image": "firma.png" },
{ "op": "stripMetadata" }
],
"output": { "filename": "expediente-{date}" },
"goals": { "pageCount": 5, "maxBytes": 2000000, "noMetadata": true }
}$ hilvana run receta.json factura-enero.pdf factura-febrero.pdf firma.png --yes
1. Unir factura-febrero.pdf, factura-enero.pdf
2. Escribir "Recibido {date}" en la página 1
3. Numerar las páginas
4. Firmar con "firma.png" en la última página
5. Borrar los metadatos (autor, título, herramientas) (borra contenido o información; requiere confirmación)
✓ expediente-2026-11-19.pdf · 5 páginas · 3.6 KB
✓ Pesa como máximo 1.91 MB (3.6 KB)
✓ Tiene exactamente 5 páginas (5)
✓ No contiene metadatos identificablesMás en docs/recipes.md, docs/word.md (Word → PDF), docs/compression.md (compresión y benchmark) y en la carpeta examples.
Reglas de seguridad
Tus archivos nunca se modifican. El resultado siempre es un archivo nuevo, y Hilvana se niega a sobrescribir una entrada.
Los pasos que borran contenido (
select,remove,stripMetadata,setMetadata) piden confirmación.Las recetas se validan antes de ejecutarse: nombres de archivo, tipos y rangos de páginas después de cada paso.
El servidor MCP solo accede a las carpetas que autorizas, y no sigue enlaces simbólicos hacia afuera.
PDF protegidos: los que solo tienen restricciones de uso (como muchos extractos bancarios) se abren solos, y el resultado se guarda sin ellas. Los que piden contraseña se abren con ella en tu equipo (
--passworden la CLI, un campo en la web). El servidor MCP nunca recibe contraseñas, porque pasarían por el modelo de IA.Los PDF firmados digitalmente se señalan antes de procesarlos. Cualquier cambio crea un archivo nuevo que ya no puede llevar esa firma, así que el resultado no conserva firmas rotas (la imagen visible de la firma sí se mantiene). Guarda siempre el original firmado. La excepción es firmar de nuevo con certificado: la firma se agrega sin modificar el documento y las anteriores siguen válidas.
Firma con certificado sin que la clave salga de tu equipo. El certificado y su contraseña se usan solo en tu equipo (en la CLI, la contraseña se pide al ejecutar o viene de
HILVANA_CERT_PASSWORD; nunca de un argumento que quede en el historial). La firma es PAdES B-B con la hora de tu equipo, sin servidor de sellado de tiempo.Secretos fuera del modelo de IA. El servidor MCP rechaza las recetas que firman con certificado o ponen contraseña (sí permite restringir el uso), y la receta que muestra la web nunca incluye contraseñas.
Detalles en PRIVACY.md.
Instalación
Requiere Node.js 20 o superior. No hace falta instalar nada más:
npx hilvana --help
npx hilvana merge a.pdf b.pdf -o ambos.pdfUsarlo con Claude (MCP)
En la configuración de Claude Desktop (claude_desktop_config.json), con la carpeta que quieres autorizar:
{
"mcpServers": {
"hilvana": {
"command": "npx",
"args": ["-y", "hilvana-mcp", "--root", "/Users/tu-usuario/Documentos/PDFs", "--lang", "es"]
}
}
}En Windows usa "command": "cmd" y antepone "/c", "npx" a los argumentos; escribe las rutas con / (por ejemplo C:/Users/tu-usuario/Documents/PDFs).
Para que Claude use tus recetas guardadas, exporta cada una desde Mis recetas en la web a ~/.hilvana/recetas (o agrega "--recipes", "/ruta/a/tus/recetas"). Claude las ve con recipe_list y las ejecuta por su nombre; esa carpeta solo se lee.
Luego puedes pedirle a Claude, por ejemplo: "Une las facturas de la carpeta, numera las páginas, firma la última con firma.png y deja el resultado por debajo de 2 MB."
Herramientas: pdf_list, pdf_inspect, word_to_pdf, recipe_plan, recipe_run, y el recurso hilvana://recipe-schema.
Related MCP server: pdf-agent-toolkit-mcp
English
Hilvana merges, splits, signs, numbers and cleans PDFs, and converts Word to PDF, on your machine. No file is uploaded and no AI model ever sees its content.
What makes it different is recipes: you describe the result, Hilvana chains the steps, validates them before touching anything, and checks at the end that the goal was met. Your AI agent (Claude, for example) can use it directly through an MCP server.
Status: v0.1 on npm. The engine, recipes, CLI and MCP server work. The web app (phase 1) processes everything in the browser, never uploads files, and works offline (docs/web.md, roadmap).
Quick start
Requires Node.js 20 or later:
npx hilvana --help --lang en
npx hilvana merge a.pdf b.pdf -o both.pdf
npx hilvana sign contract.pdf --image signature.png -o contract-signed.pdf
npx hilvana word proposal.docx # Word → PDF with selectable text (docs/word.md)
npx hilvana compress scan.pdf --target 2MB # gentlest setting that fits (docs/compression.md)
npx hilvana run recipe.json a.pdf b.pdf signature.png --dry-run --lang en
npx hilvana run stamp.json invoices/*.pdf --each -o stamped/ # the recipe on each file
npx hilvana certify contract.pdf --cert my-certificate.p12 -o contract-signed.pdf # asks for the certificate password
npx hilvana protect statement.pdf -o statement-locked.pdf # asks for the new password
npx hilvana unlock statement.pdf -o statement-open.pdf # removes restrictions (--password if it needs one)
npx hilvana redact statement.pdf --find 123456789 --pattern email -o shared.pdf # removed from the file, not covered
npx hilvana ocr scan.pdf # searchable scans, OCR on your machine (Spanish by default)With Claude (MCP)
{
"mcpServers": {
"hilvana": {
"command": "npx",
"args": ["-y", "hilvana-mcp", "--root", "/Users/you/Documents/PDFs", "--lang", "en"]
}
}
}On Windows, use "command": "cmd" and put "/c", "npx" before the arguments.
Tools: pdf_list, pdf_inspect, kdp_check, word_to_pdf, recipe_plan, recipe_run, plus the hilvana://recipe-schema resource. Saved recipes (exported from My recipes on the web) in ~/.hilvana/recetas, or the folder given with --recipes, add recipe_list and hilvana://recipes/{id} resources, and run with saved: "<id>"; that folder is only read. Destructive steps require confirm: true, which the agent should only send after you agree.
Safety rules
Inputs are never modified; results always go to a new file.
Steps that remove content or information ask for confirmation.
Recipes are validated against your actual files before running.
The MCP server can only reach the folders you authorize, and does not follow symlinks out of them.
Protected PDFs: files with only usage restrictions (like many bank statements) open on their own, and the result is saved without them. Files that need a password open with it on your machine (
--passwordin the CLI, a field on the web). The MCP server never takes passwords, since they would pass through the AI model.Digitally signed PDFs are flagged before processing. Any change makes a new file that cannot keep the signature, so results carry no broken signatures (the visible signature image stays). Keep the signed original. The exception is signing again with a certificate: the new signature is appended without changing the document, so earlier ones stay valid.
Certificate signatures never move your key: the certificate and its password are used only on your machine (the CLI asks for the password, or reads
HILVANA_CERT_PASSWORD; never a flag that stays in shell history). Signatures are PAdES B-B with your device's clock, with no time-stamping server.Secrets stay away from AI models: the MCP server refuses recipes that sign with a certificate or set a password (restricting use is allowed), and the recipe shown on the web never includes passwords.
Packages
Package | What it is |
PDF engine. Bytes in, bytes out; runs in Node and the browser. | |
Word (.docx) → PDF: own layout engine with embedded open fonts, plus an optional local LibreOffice engine. | |
Recipe schema (JSON Schema included), validator, runner and goal checks, in Spanish and English. | |
Command-line tool. | |
MCP server for AI agents. | |
Web app (not published to npm): the same engine in the browser, as an offline-capable PWA. See docs/web.md. |
Development
npm install
npm run build # TypeScript project references
npm test # Vitest
npm run licenses # blocks AGPL/GPL in production dependencies
npm run dev -w @hilvana/web # web app at http://localhost:5173
npm run build:web && npm run e2e -w @hilvana/web # browser tests (Playwright)License
MIT · Built in public by Jorge Grajales.
Available Tools
6 toolskdp_checkCheck a PDF for Amazon KDPARead-only
Checks a print interior against Amazon KDP requirements for a paperback or hardcover: page size (trim plus bleed), page count, margins and gutter by page count, embedded fonts, image resolution (300 DPI), transparency, annotations, bookmarks, metadata. Returns the findings by page; never page text or images. Read only.
Inputs: path (required), trim (required), binding (required), ink, +2 more.
pdf_inspectInspect a PDFARead-only
Returns structure only: page count, page sizes and rotation, encryption, which metadata fields are set (names only, never their values), signatures and file size. Never returns text or images.
Inputs: path (required).
pdf_listList PDFs and imagesARead-only
Lists PDF, Word (.docx) and image files (PNG/JPEG) in an allowed folder, with page counts for PDFs. Does not read content.
Inputs: folder.
recipe_planValidate and explain a recipeARead-only
Checks a recipe against the actual files without changing anything: schema, file names, page ranges after each step, and which steps are destructive. Returns the steps in plain language to show the user before running.
Inputs: files (required), each, lang, saved, +2 more.
recipe_runRun a recipeAIdempotent
Runs a recipe locally and writes the result to a NEW file (or, when the recipe ends with split, one new file per part in the output folder), then verifies the goals. Inputs are never modified. If the recipe has destructive steps it returns the plan and asks for confirmation instead of running; set confirm=true only after the user agreed.
Inputs: files (required), output (required), each, lang, +5 more.
word_to_pdfConvert Word to PDFAIdempotent
Converts a Word document (.docx) to a NEW PDF on this computer, with real, selectable text. Returns the page count and any simplifications made (e.g. skipped text boxes). Never uploads the file.
Inputs: path (required), lang, engine, output, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a distinct resource+action: pdf_list enumerates files, pdf_inspect returns structural facts, kdp_check applies KDP rules, recipe_plan/recipe_run form an explicit dry-run/execute pair, and word_to_pdf converts. The only mild overlap (pdf_inspect vs. kdp_check both report page sizes and fonts) is resolved by scope, since one is generic structure and the other KDP-specific compliance.
All six names are snake_case with a consistent domain-prefix + action pattern: pdf_inspect, pdf_list, kdp_check, recipe_plan, recipe_run, word_to_pdf. The prefixes group tools meaningfully by subject (pdf_, recipe_) and verbs are unambiguous.
Six tools is well within the sensible range and each one covers a distinct stage of the document workflow: discover, inspect, validate, plan, execute, convert. Nothing feels padded or redundant.
The workflow is largely closed: list → inspect → KDP check → convert → plan → run, with recipes as the transformation engine. Two modest gaps: there is no tool to discover or author the available recipes (recipe_plan/recipe_run reference recipes that the agent cannot enumerate), and pdf_list surfaces PNG/JPEG files that no tool can actually inspect.
Maintenance
Related MCP Connectors
PDF and image tools for AI agents: compress, merge, split, OCR, sign. Runs locally, never uploads.
PDF tools for AI agents: validate, extract, merge, split, compress, OCR, sign and redact.
13 stateless PDF tools for AI agents: merge, split, rotate, compress, watermark, redact, flatten, repair, add page numbers and fill PDF forms. Files are processed in memory and nothing is stored. Part of FreeDailyPro's 211+ MCP tools; trial key with 20,000 calls/month at freedailypro.com/developers.
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to perform 13 PDF operations (merge, split, compress, watermark, encrypt, and more) on local files via MCP.3-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to perform comprehensive PDF operations locally, including compression, text extraction, PII redaction, page organization, splitting, merging, watermarking, creation, and form filling, all without cloud uploads.17 npm-
- AlicenseBqualityCmaintenanceEnables AI agents to perform local-first PDF processing entirely on-device, including OCR write-back to make scans searchable, unlocking and re-encrypting PDFs, splitting/merging/rotating pages, and compressing files, with no cloud calls or file uploads.2514 PyPI1MIT
- AlicenseAqualityBmaintenanceEnables AI apps to run document and image operations such as compressing, merging, splitting, converting, OCR, protecting, and repairing files through natural language, with results saved locally.5MIT