pdfpipe-mcp-server 0.1.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/README.md +76 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +226 -0
- package/dist/index.js.map +1 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# PDFPipe MCP Server
|
|
2
|
+
|
|
3
|
+
Generate PDF documents (invoices, reports, certificates) from HTML or a URL in
|
|
4
|
+
one tool call, from any MCP-compatible AI agent: Claude Desktop, Claude Code,
|
|
5
|
+
Cursor, Windsurf, and others.
|
|
6
|
+
|
|
7
|
+
It calls the [PDFPipe](https://pdfpipe.xyz) API, so rendering runs server-side in
|
|
8
|
+
a sandboxed Chromium. Your agent does not need a browser.
|
|
9
|
+
|
|
10
|
+
## Tool
|
|
11
|
+
|
|
12
|
+
### `pdfpipe_generate_pdf`
|
|
13
|
+
|
|
14
|
+
Render HTML or a public URL to a PDF and save it to disk.
|
|
15
|
+
|
|
16
|
+
| Argument | Type | Required | Default |
|
|
17
|
+
| --- | --- | --- | --- |
|
|
18
|
+
| `html` | string | one of html/url | — |
|
|
19
|
+
| `url` | string (http/https) | one of html/url | — |
|
|
20
|
+
| `output_path` | string | yes | — |
|
|
21
|
+
| `format` | `A4` `A3` `A5` `Letter` `Legal` `Tabloid` | no | `A4` |
|
|
22
|
+
| `landscape` | boolean | no | `false` |
|
|
23
|
+
| `margin` | CSS length (`1cm`, `0`, `0.5in`) | no | `1cm` |
|
|
24
|
+
|
|
25
|
+
Returns JSON: `{ output_path, size_bytes, plan, usage, limit }`.
|
|
26
|
+
|
|
27
|
+
## Setup
|
|
28
|
+
|
|
29
|
+
You need a PDFPipe API key. Get one at https://pdfpipe.xyz.
|
|
30
|
+
|
|
31
|
+
### Claude Desktop / Claude Code
|
|
32
|
+
|
|
33
|
+
Add to your MCP config (`claude_desktop_config.json`, or `.mcp.json` for Claude Code):
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"mcpServers": {
|
|
38
|
+
"pdfpipe": {
|
|
39
|
+
"command": "npx",
|
|
40
|
+
"args": ["-y", "pdfpipe-mcp-server"],
|
|
41
|
+
"env": {
|
|
42
|
+
"PDFPIPE_API_KEY": "pp_live_your_key_here"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Cursor / Windsurf
|
|
50
|
+
|
|
51
|
+
Same block, in the editor's MCP settings file.
|
|
52
|
+
|
|
53
|
+
### Environment variables
|
|
54
|
+
|
|
55
|
+
| Variable | Required | Default |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| `PDFPIPE_API_KEY` | yes | — |
|
|
58
|
+
| `PDFPIPE_BASE_URL` | no | `https://api.pdfpipe.xyz` |
|
|
59
|
+
|
|
60
|
+
## Example prompts
|
|
61
|
+
|
|
62
|
+
- "Generate an invoice PDF for order #4012 and save it to ./invoices/4012.pdf"
|
|
63
|
+
- "Save https://example.com/report as a landscape A4 PDF at ./report.pdf"
|
|
64
|
+
|
|
65
|
+
## Local development
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm install
|
|
69
|
+
npm run build
|
|
70
|
+
# point at a local PDFPipe API and smoke-test:
|
|
71
|
+
node test-client.mjs <api_key> http://localhost:8077
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MCP server for PDFPipe (https://pdfpipe.xyz).
|
|
4
|
+
*
|
|
5
|
+
* Exposes a single high-value tool, `pdfpipe_generate_pdf`, that turns HTML or
|
|
6
|
+
* a public URL into a PDF document via the PDFPipe REST API and writes it to a
|
|
7
|
+
* path the agent chooses. Built so an AI agent can produce an invoice, report,
|
|
8
|
+
* or certificate in one tool call.
|
|
9
|
+
*
|
|
10
|
+
* Auth: set PDFPIPE_API_KEY. Override the host with PDFPIPE_BASE_URL.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MCP server for PDFPipe (https://pdfpipe.xyz).
|
|
4
|
+
*
|
|
5
|
+
* Exposes a single high-value tool, `pdfpipe_generate_pdf`, that turns HTML or
|
|
6
|
+
* a public URL into a PDF document via the PDFPipe REST API and writes it to a
|
|
7
|
+
* path the agent chooses. Built so an AI agent can produce an invoice, report,
|
|
8
|
+
* or certificate in one tool call.
|
|
9
|
+
*
|
|
10
|
+
* Auth: set PDFPIPE_API_KEY. Override the host with PDFPIPE_BASE_URL.
|
|
11
|
+
*/
|
|
12
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
13
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
import axios from "axios";
|
|
16
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
17
|
+
import { dirname, isAbsolute, resolve } from "node:path";
|
|
18
|
+
const BASE_URL = (process.env.PDFPIPE_BASE_URL || "https://api.pdfpipe.xyz").replace(/\/$/, "");
|
|
19
|
+
const REQUEST_TIMEOUT_MS = 60_000;
|
|
20
|
+
const PAGE_FORMATS = ["A4", "A3", "A5", "Letter", "Legal", "Tabloid"];
|
|
21
|
+
const GeneratePdfInput = z
|
|
22
|
+
.object({
|
|
23
|
+
html: z
|
|
24
|
+
.string()
|
|
25
|
+
.min(1)
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Raw HTML to render into a PDF. Provide this OR url, not both."),
|
|
28
|
+
url: z
|
|
29
|
+
.string()
|
|
30
|
+
.url()
|
|
31
|
+
.optional()
|
|
32
|
+
.describe("Public http(s) URL to render into a PDF. Provide this OR html, not both."),
|
|
33
|
+
output_path: z
|
|
34
|
+
.string()
|
|
35
|
+
.min(1)
|
|
36
|
+
.describe("Filesystem path to write the resulting PDF to, e.g. './invoice.pdf'. " +
|
|
37
|
+
"Parent directories are created if missing."),
|
|
38
|
+
format: z
|
|
39
|
+
.enum(PAGE_FORMATS)
|
|
40
|
+
.default("A4")
|
|
41
|
+
.describe("Page size. Default A4."),
|
|
42
|
+
landscape: z
|
|
43
|
+
.boolean()
|
|
44
|
+
.default(false)
|
|
45
|
+
.describe("Render in landscape orientation. Default false."),
|
|
46
|
+
margin: z
|
|
47
|
+
.string()
|
|
48
|
+
.default("1cm")
|
|
49
|
+
.describe("Uniform page margin as a CSS length, e.g. '1cm', '0', '0.5in'. Default '1cm'."),
|
|
50
|
+
})
|
|
51
|
+
.strict();
|
|
52
|
+
const GeneratePdfOutput = z.object({
|
|
53
|
+
output_path: z.string(),
|
|
54
|
+
size_bytes: z.number(),
|
|
55
|
+
plan: z.string().optional(),
|
|
56
|
+
usage: z.number().optional(),
|
|
57
|
+
limit: z.number().optional(),
|
|
58
|
+
});
|
|
59
|
+
function apiKey() {
|
|
60
|
+
const key = process.env.PDFPIPE_API_KEY;
|
|
61
|
+
if (!key) {
|
|
62
|
+
throw new Error("PDFPIPE_API_KEY is not set. Get a key at https://pdfpipe.xyz and set it " +
|
|
63
|
+
"in the MCP server environment.");
|
|
64
|
+
}
|
|
65
|
+
return key;
|
|
66
|
+
}
|
|
67
|
+
function describeError(error) {
|
|
68
|
+
if (axios.isAxiosError(error)) {
|
|
69
|
+
const e = error;
|
|
70
|
+
if (e.response) {
|
|
71
|
+
// The API returns JSON {detail: "..."} for errors.
|
|
72
|
+
let detail = "";
|
|
73
|
+
const data = e.response.data;
|
|
74
|
+
if (data && typeof data === "object" && "detail" in data) {
|
|
75
|
+
detail = String(data.detail);
|
|
76
|
+
}
|
|
77
|
+
else if (Buffer.isBuffer(data)) {
|
|
78
|
+
try {
|
|
79
|
+
detail = String(JSON.parse(data.toString("utf8")).detail ?? "");
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
/* binary or non-JSON body */
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
switch (e.response.status) {
|
|
86
|
+
case 400:
|
|
87
|
+
return `Error: Bad request. ${detail || "Provide exactly one of 'html' or 'url'."}`;
|
|
88
|
+
case 401:
|
|
89
|
+
return "Error: Invalid or missing API key. Check PDFPIPE_API_KEY.";
|
|
90
|
+
case 402:
|
|
91
|
+
return `Error: Monthly document limit reached. ${detail || "Upgrade your plan at https://pdfpipe.xyz."}`;
|
|
92
|
+
case 413:
|
|
93
|
+
return `Error: Payload too large. ${detail || "Reduce the HTML size."}`;
|
|
94
|
+
case 422:
|
|
95
|
+
return `Error: Could not render the document. ${detail || "Check the HTML/URL is valid and reachable."}`;
|
|
96
|
+
case 429:
|
|
97
|
+
return "Error: Rate limit reached. Wait a moment and retry.";
|
|
98
|
+
default:
|
|
99
|
+
return `Error: PDFPipe API returned ${e.response.status}. ${detail}`.trim();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (e.code === "ECONNABORTED") {
|
|
103
|
+
return "Error: Request timed out. The document may be too complex, or the API is unreachable.";
|
|
104
|
+
}
|
|
105
|
+
if (e.code === "ECONNREFUSED" || e.code === "ENOTFOUND") {
|
|
106
|
+
return `Error: Could not reach the PDFPipe API at ${BASE_URL}. Check PDFPIPE_BASE_URL and your connection.`;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return `Error: ${error instanceof Error ? error.message : String(error)}`;
|
|
110
|
+
}
|
|
111
|
+
const server = new McpServer({
|
|
112
|
+
name: "pdfpipe-mcp-server",
|
|
113
|
+
version: "0.1.0",
|
|
114
|
+
});
|
|
115
|
+
server.registerTool("pdfpipe_generate_pdf", {
|
|
116
|
+
title: "Generate a PDF with PDFPipe",
|
|
117
|
+
description: `Generate a PDF document from HTML or a public URL using the PDFPipe API, and save it to disk.
|
|
118
|
+
|
|
119
|
+
Use this to produce invoices, receipts, reports, certificates, statements, or any document, from HTML you compose or a web page you point at. The rendering runs server-side in a sandboxed Chromium, so the calling agent does not need a browser.
|
|
120
|
+
|
|
121
|
+
Args:
|
|
122
|
+
- html (string, optional): Raw HTML to render. Provide html OR url, not both.
|
|
123
|
+
- url (string, optional): Public http(s) URL to render. Provide html OR url, not both.
|
|
124
|
+
- output_path (string, required): Where to save the PDF, e.g. "./invoice.pdf". Parent dirs are created.
|
|
125
|
+
- format ('A4'|'A3'|'A5'|'Letter'|'Legal'|'Tabloid', optional): Page size, default 'A4'.
|
|
126
|
+
- landscape (boolean, optional): Landscape orientation, default false.
|
|
127
|
+
- margin (string, optional): CSS length page margin, e.g. '1cm', '0', default '1cm'.
|
|
128
|
+
|
|
129
|
+
Returns JSON:
|
|
130
|
+
{
|
|
131
|
+
"output_path": string, // absolute path the PDF was written to
|
|
132
|
+
"size_bytes": number, // size of the generated PDF
|
|
133
|
+
"plan": string, // the API key's plan (e.g. "hobby")
|
|
134
|
+
"usage": number, // documents used this month after this call
|
|
135
|
+
"limit": number // monthly document limit for the plan
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
Examples:
|
|
139
|
+
- "Make an invoice PDF": html="<h1>Invoice #4012</h1>...", output_path="./invoice-4012.pdf"
|
|
140
|
+
- "Save this web page as PDF": url="https://example.com/report", output_path="./report.pdf"
|
|
141
|
+
|
|
142
|
+
Errors return a message starting with "Error:" explaining the cause (bad key, limit reached, render failure, unreachable API).`,
|
|
143
|
+
inputSchema: GeneratePdfInput.shape,
|
|
144
|
+
outputSchema: GeneratePdfOutput.shape,
|
|
145
|
+
annotations: {
|
|
146
|
+
readOnlyHint: false,
|
|
147
|
+
destructiveHint: false,
|
|
148
|
+
idempotentHint: false,
|
|
149
|
+
openWorldHint: true,
|
|
150
|
+
},
|
|
151
|
+
}, async (params) => {
|
|
152
|
+
// Exactly one of html / url.
|
|
153
|
+
if (!params.html && !params.url) {
|
|
154
|
+
return {
|
|
155
|
+
isError: true,
|
|
156
|
+
content: [{ type: "text", text: "Error: Provide either 'html' or 'url'." }],
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
if (params.html && params.url) {
|
|
160
|
+
return {
|
|
161
|
+
isError: true,
|
|
162
|
+
content: [{ type: "text", text: "Error: Provide 'html' or 'url', not both." }],
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
try {
|
|
166
|
+
const response = await axios.post(`${BASE_URL}/v1/pdf`, {
|
|
167
|
+
...(params.html ? { html: params.html } : { url: params.url }),
|
|
168
|
+
options: {
|
|
169
|
+
format: params.format,
|
|
170
|
+
landscape: params.landscape,
|
|
171
|
+
margin: params.margin,
|
|
172
|
+
},
|
|
173
|
+
}, {
|
|
174
|
+
responseType: "arraybuffer",
|
|
175
|
+
timeout: REQUEST_TIMEOUT_MS,
|
|
176
|
+
headers: {
|
|
177
|
+
Authorization: `Bearer ${apiKey()}`,
|
|
178
|
+
"Content-Type": "application/json",
|
|
179
|
+
Accept: "application/pdf",
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
const buffer = Buffer.from(response.data);
|
|
183
|
+
const absPath = isAbsolute(params.output_path)
|
|
184
|
+
? params.output_path
|
|
185
|
+
: resolve(process.cwd(), params.output_path);
|
|
186
|
+
mkdirSync(dirname(absPath), { recursive: true });
|
|
187
|
+
writeFileSync(absPath, buffer);
|
|
188
|
+
const h = response.headers;
|
|
189
|
+
const num = (v) => {
|
|
190
|
+
const n = Number(v);
|
|
191
|
+
return Number.isFinite(n) ? n : undefined;
|
|
192
|
+
};
|
|
193
|
+
const output = {
|
|
194
|
+
output_path: absPath,
|
|
195
|
+
size_bytes: buffer.length,
|
|
196
|
+
plan: h["x-pdfpipe-plan"] ?? undefined,
|
|
197
|
+
usage: num(h["x-pdfpipe-usage"]),
|
|
198
|
+
limit: num(h["x-pdfpipe-limit"]),
|
|
199
|
+
};
|
|
200
|
+
return {
|
|
201
|
+
content: [{ type: "text", text: JSON.stringify(output, null, 2) }],
|
|
202
|
+
structuredContent: output,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
return {
|
|
207
|
+
isError: true,
|
|
208
|
+
content: [{ type: "text", text: describeError(error) }],
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
async function main() {
|
|
213
|
+
// Fail fast with a clear message if the key is missing.
|
|
214
|
+
if (!process.env.PDFPIPE_API_KEY) {
|
|
215
|
+
console.error("WARNING: PDFPIPE_API_KEY is not set. Tool calls will fail until it is. " +
|
|
216
|
+
"Get a key at https://pdfpipe.xyz.");
|
|
217
|
+
}
|
|
218
|
+
const transport = new StdioServerTransport();
|
|
219
|
+
await server.connect(transport);
|
|
220
|
+
console.error(`pdfpipe-mcp-server running (stdio), API base ${BASE_URL}`);
|
|
221
|
+
}
|
|
222
|
+
main().catch((error) => {
|
|
223
|
+
console.error("Fatal:", error);
|
|
224
|
+
process.exit(1);
|
|
225
|
+
});
|
|
226
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzD,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,yBAAyB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CA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,OAAO,CAAC,KAAK,CACX,yEAAyE;YACvE,mCAAmC,CACtC,CAAC;IACJ,CAAC;IACD,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,gDAAgD,QAAQ,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC/B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pdfpipe-mcp-server",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for PDFPipe. Generate PDF documents (invoices, reports, certificates) from HTML or a URL in one tool call.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"pdfpipe-mcp-server": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": ["dist"],
|
|
11
|
+
"author": "Johin Johny <johinjohny144@gmail.com>",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"keywords": ["mcp", "pdf", "pdf-generation", "html-to-pdf", "pdfpipe", "ai-agents"],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"start": "node dist/index.js",
|
|
17
|
+
"dev": "tsx watch src/index.ts"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
24
|
+
"axios": "^1.7.9",
|
|
25
|
+
"zod": "^3.23.8"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^22.10.0",
|
|
29
|
+
"tsx": "^4.19.2",
|
|
30
|
+
"typescript": "^5.7.2"
|
|
31
|
+
}
|
|
32
|
+
}
|