autoform-mcp-server 1.2.0 → 1.2.1
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 +15 -1
- package/dist/services/batchGenerator.js +3 -1
- package/dist/services/templateStore.js +3 -1
- package/dist/tools/fillAtCoordinates.js +3 -2
- package/dist/tools/fillBatchAtCoordinates.js +3 -2
- package/dist/tools/fillPdf.js +3 -2
- package/package.json +1 -3
- package/output/.gitkeep +0 -0
- package/templates/.gitkeep +0 -0
package/README.md
CHANGED
|
@@ -123,9 +123,23 @@ When a template has repeated fields (e.g., 3 fields named "nombre"):
|
|
|
123
123
|
- **`sequential`** (default): Each field consumes a different data row. 9 rows + 3 fields = 3 documents.
|
|
124
124
|
- **`repeat`**: One row fills ALL fields with the same name. 9 rows = 9 documents.
|
|
125
125
|
|
|
126
|
+
## Storage
|
|
127
|
+
|
|
128
|
+
All data is stored in `~/.autoform-mcp/` on the user's machine:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
~/.autoform-mcp/
|
|
132
|
+
├── templates/ ← Saved templates (JSON + PDF files)
|
|
133
|
+
└── output/ ← Generated PDFs
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
- **Windows:** `C:\Users\<name>\.autoform-mcp\`
|
|
137
|
+
- **macOS/Linux:** `~/.autoform-mcp/`
|
|
138
|
+
|
|
139
|
+
You can override the output path in any tool using the `output_path` or `output_dir` parameter.
|
|
140
|
+
|
|
126
141
|
## How It Works
|
|
127
142
|
|
|
128
|
-
- Templates and generated PDFs are stored locally in the MCP server directory
|
|
129
143
|
- Uses `pdf-lib` for PDF manipulation (no external services)
|
|
130
144
|
- All processing happens locally — no data leaves your machine
|
|
131
145
|
- Zero vulnerabilities — only 3 dependencies
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import { PdfService } from './pdfService.js';
|
|
4
|
-
|
|
4
|
+
import * as os from 'os';
|
|
5
|
+
const AUTOFORM_HOME = path.join(os.homedir(), '.autoform-mcp');
|
|
6
|
+
const OUTPUT_DIR = path.join(AUTOFORM_HOME, 'output');
|
|
5
7
|
/**
|
|
6
8
|
* Batch PDF generation with distribution logic.
|
|
7
9
|
* Adapts web app's distributionEngine + pdfGenerator for Node.js.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
|
-
|
|
3
|
+
import * as os from 'os';
|
|
4
|
+
const AUTOFORM_HOME = path.join(os.homedir(), '.autoform-mcp');
|
|
5
|
+
const TEMPLATES_DIR = path.join(AUTOFORM_HOME, 'templates');
|
|
4
6
|
/**
|
|
5
7
|
* Filesystem-based template storage.
|
|
6
8
|
* Templates are stored as individual JSON files in the templates/ directory.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
|
+
import * as os from 'os';
|
|
2
3
|
import { PdfService } from '../services/pdfService.js';
|
|
3
|
-
const OUTPUT_DIR = path.
|
|
4
|
+
const OUTPUT_DIR = path.join(os.homedir(), '.autoform-mcp', 'output');
|
|
4
5
|
export const fillAtCoordinatesSchema = {
|
|
5
6
|
name: 'autoform_fill_at_coordinates',
|
|
6
7
|
description: `Escribe texto en posiciones exactas de un PDF usando coordenadas en puntos PDF (origen: esquina inferior-izquierda).
|
|
@@ -44,7 +45,7 @@ SISTEMA DE COORDENADAS:
|
|
|
44
45
|
},
|
|
45
46
|
output_path: {
|
|
46
47
|
type: 'string',
|
|
47
|
-
description: '(Opcional) Ruta donde guardar el PDF.
|
|
48
|
+
description: '(Opcional) Ruta donde guardar el PDF. Default: ~/.autoform-mcp/output/'
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
51
|
required: ['pdf_path', 'fields']
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
|
+
import * as os from 'os';
|
|
2
3
|
import { PdfService } from '../services/pdfService.js';
|
|
3
|
-
const OUTPUT_DIR = path.
|
|
4
|
+
const OUTPUT_DIR = path.join(os.homedir(), '.autoform-mcp', 'output');
|
|
4
5
|
export const fillBatchAtCoordinatesSchema = {
|
|
5
6
|
name: 'autoform_fill_batch_at_coordinates',
|
|
6
7
|
description: `Genera MULTIPLES PDFs a partir de un mismo PDF base, escribiendo datos diferentes en las mismas posiciones de cada copia.
|
|
@@ -54,7 +55,7 @@ SISTEMA DE COORDENADAS: Origen (0,0) = esquina inferior-izquierda. Y aumenta hac
|
|
|
54
55
|
},
|
|
55
56
|
output_dir: {
|
|
56
57
|
type: 'string',
|
|
57
|
-
description: '(Opcional) Directorio de salida. Default: output/'
|
|
58
|
+
description: '(Opcional) Directorio de salida. Default: ~/.autoform-mcp/output/'
|
|
58
59
|
}
|
|
59
60
|
},
|
|
60
61
|
required: ['pdf_path', 'field_definitions', 'data_rows']
|
package/dist/tools/fillPdf.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
|
+
import * as os from 'os';
|
|
2
3
|
import { PdfService } from '../services/pdfService.js';
|
|
3
4
|
import { TemplateStore } from '../services/templateStore.js';
|
|
4
|
-
const OUTPUT_DIR = path.
|
|
5
|
+
const OUTPUT_DIR = path.join(os.homedir(), '.autoform-mcp', 'output');
|
|
5
6
|
export const fillPdfSchema = {
|
|
6
7
|
name: 'autoform_fill_pdf',
|
|
7
8
|
description: `Llena UN PDF con valores. Detecta automaticamente si tiene AcroForm o usa un template guardado.
|
|
@@ -23,7 +24,7 @@ NO USAR SI: Quieres generar MULTIPLES documentos → usa autoform_generate_batch
|
|
|
23
24
|
},
|
|
24
25
|
output_path: {
|
|
25
26
|
type: 'string',
|
|
26
|
-
description: '(Opcional) Ruta donde guardar el PDF llenado.
|
|
27
|
+
description: '(Opcional) Ruta donde guardar el PDF llenado. Default: ~/.autoform-mcp/output/'
|
|
27
28
|
},
|
|
28
29
|
template_name: {
|
|
29
30
|
type: 'string',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autoform-mcp-server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "MCP server for bulk PDF form filling. Detect fields, fill templates, and generate hundreds of PDFs from data — directly from Claude.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -36,8 +36,6 @@
|
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"dist",
|
|
39
|
-
"templates/.gitkeep",
|
|
40
|
-
"output/.gitkeep",
|
|
41
39
|
"README.md"
|
|
42
40
|
],
|
|
43
41
|
"dependencies": {
|
package/output/.gitkeep
DELETED
|
File without changes
|
package/templates/.gitkeep
DELETED
|
File without changes
|