io.github.kmalakoff/mcp-pdf
MCP server for PDF generation using PDFKit
★ 1MITdevtools
Install
Config snippet generator goes here (5 client tabs)
README
# @mcp-z/mcp-pdf
Docs: https://mcp-z.github.io/mcp-pdf
PDF generation MCP server for documents, layouts, and image export.
## Common uses
- Generate PDFs from text or layouts
- Render PDF pages as images
- Measure text before layout
## Transports
MCP supports stdio and HTTP.
**Stdio**
```json
{
"mcpServers": {
"pdf": {
"command": "npx",
"args": ["-y", "@mcp-z/mcp-pdf"]
}
}
}
```
**HTTP**
```json
{
"mcpServers": {
"pdf": {
"type": "http",
"url": "http://localhost:9010/mcp",
"start": {
"command": "npx",
"args": ["-y", "@mcp-z/mcp-pdf", "--port=9010"]
}
}
}
}
```
`start` is an extension used by `npx @mcp-z/cli up` to launch HTTP servers for you.
## Authentication
No OAuth or API keys required.
## How to use
```bash
# List tools
mcp-z inspect --servers pdf --tools
# Create a simple PDF
mcp-z call pdf pdf-document '{"content":["Hello from MCP"]}'
```
## Available tools
### pdf-resume
Generate professional resumes from JSON Resume format.
Parameters:
- `filename` (string, optional) - Filename for the PDF (defaults to "resume.pdf")
- `resume` (object, required) - JSON Resume schema
- `sections` (object, optional) - Section ordering and field templates
- `layout` (object, optional) - Spatial arrangement (single-column or two-column)
- `styling` (object, optional) - Typography and spacing options
- `font` (string, optional) - Custom font
- `pageSize` (string, optional) - Page size (default: "LETTER")
- `backgroundColor` (string, optional) - Page background color
Resume schema sections:
- `basics` - Name, contact, summary, location
- `work` - Work experience with highlights
- `education` - Degrees and institutions
- `projects` - Personal/professional projects
- `skills` - Skills grouped by category
- `awards`, `certificates`, `languages`, `volunteer`, `publications`, `interests`, `references`
#### Section configuration
Control which sections appear and in what order using `sections.sections`:
```ts
await client.callTool('pdf-resume', {
resume: { /* JSON Resume data */ },
sections: {
sections: [
{ source: 'basics', render: 'header' },
{ source: 'basics.summary', title: 'Summary' },
{ source: 'work', title: 'Experience' },
{ source: 'skills', title: 'Skills' },
{ source: 'education', title: 'Education' }
]
}
});
```
Section config properties:
- `source` (string, required) - Path to data in resume schema (e.g., `basics`, `work`, `meta.customField`)
- `render` (string, optional) - Built-in renderer. Use `header` explicitly or to force a renderer
- `title` (string, optional) - Section heading (omit for no title)
- `template` (string, optional) - LiquidJS template for custom rendering
Available renderers:
- `header` - Name + contact line from basics (never auto-inferred)
- `entry-list` - Arrays with position/institution/organization
- `keyword-list` - Arrays with `keywords`
- `language-list` - Arrays with `language`
- `credential-list` - Arrays with awarder/issuer/publisher
- `reference-list` - Arrays with `reference`
- `text` - String or string array
Example: custom section order with meta fields
```ts
await client.callTool('pdf-resume', {
resume: {
basics: { name: 'Jane Doe', email: 'jane@example.com' },
work: [{ /* ... */ }],
meta: { valueProp: 'Full-stack engineer with 10+ years experience...' }
},
sections: {
sections: [
{ source: 'basics', render: 'header' },
{ source: 'meta.valueProp', title: 'Value Proposition' },
{ source: 'work', title: 'Experience' }
]
}
});
```
#### Field templates
Field templates use LiquidJS syntax to customize how fields are rendered.
Available field templates:
- `location` - `{{ city }}{% if region %}, {{ region }}{% endif %}`
- `dateRange` - `{{ start | date: 'MMM YYYY' }} - {{ end | date: 'MMM YYYY' | default: 'Present' }}`
- `degree` - `{{ studyType }}{% if area %}, {{ area }}{% endif %}`
- `credential` - `{{ title | default: name }}{% if awarder %}, {{ awarder }}{% endif %}`
- `language` - `{{ language }}{% if fluency %} ({{ fluency }}){% endif %}`
- `skill` - `{{ name }}: {{ keywords | join: ', ' }}`
- `contactLine` - `{{ items | join: ' | ' }}`
Date format tokens:
- `YYYY`, `YY`, `MMMM`, `MMM`, `MM`, `M`, `DD`, `D`
Available filters:
- `date` - Format a date string
- `default` - Fallback for empty values
- `tenure` - Calculate duration
- `join` - Join array elements
Example: French resume
```ts
await client.callTool('pdf-resume', {
filename: 'cv-francais.pdf',
resume: { /* JSON Resume data */ },
sections: {
fieldTemplates: {
dateRange: "{{ start | date: 'MM/YYYY' }} - {{ end | date: 'MM/YYYY' | default: 'Present' }}",
location: '{{ city }}'
}
}
});
```
Example: verbose date format
```ts
await client.callTool('pdf-resume', {
filename: 'resume.pdf',
resume: { /* JSON Resume data */ },
sections: {
fieldTemplates: {
dateRange: "{{ start | dat