MCP PDF
Enables creative PDF generation with full design control including colors, shapes, emoji, and Unicode support. Supports everything from simple documents to artistic masterpieces using PDFKit's powerful API.
README
@mcp-z/mcp-pdf
MCP server for creative PDF generation. AI agents and users work together to create anything from simple documents to artistic masterpieces—all powered by PDFKit.
Why This Exists
PDFs shouldn't be boring. This server gives AI agents the power to generate professional documents, creative projects, and everything in between. Color emoji support (😀 🎉 🚀), full Unicode (你好 مرحبا Привет), and direct PDFKit access mean the only limit is imagination.
Projects range from Bob Ross-style paintings and space-themed documents to practical invoices and resumes. It's for professionals and fun seekers alike.
Features
- Creative Freedom - Colors, shapes, positioning, emoji—build anything
- Pure JavaScript - No native dependencies, works everywhere
- Emoji & Unicode - Color emoji as images, full international text support
- Three Tools - Simple text, advanced layouts, or JSON Resume format
- PDFKit Wrapper - Minimal abstraction over PDFKit's powerful API
Installation
npm install -g @mcp-z/mcp-pdf
Or use directly:
npx @mcp-z/mcp-pdf
Quick Start
Add to claude_desktop_config.json:
{
"mcpServers": {
"pdf": {
"command": "npx",
"args": ["-y", "@mcp-z/mcp-pdf"]
}
}
}
Security Model
This server writes PDFs to a sandboxed directory to prevent path traversal attacks:
- Default location:
~/.mcp-pdf/ - Custom location: Set
PDF_OUTPUT_DIRenvironment variable - Filename sanitization: Blocks
..,/, and unsafe characters - No path parameters: Tools accept only filenames, not full paths
All generated PDFs are written to the configured output directory with sanitized filenames.
Custom Output Directory
To override the default location, set the PDF_OUTPUT_DIR environment variable:
{
"mcpServers": {
"pdf": {
"command": "npx",
"args": ["-y", "@mcp-z/mcp-pdf"],
"env": {
"PDF_OUTPUT_DIR": "/Users/yourname/Documents/PDFs"
}
}
}
}
Where to Find This Server
Published on multiple MCP registries and package managers:
- npm -
@mcp-z/mcp-pdf - MCP Official Registry -
io.github.kmalakoff/mcp-pdf - Smithery - One-click install via Smithery CLI
- Awesome MCP Servers - Community curated list (pending approval)
- Cline Marketplace - Built-in to Cline IDE (coming soon)
- GitHub Repository - Source code and issues
What You Can Create
- Professional - Resumes, invoices, reports, certificates
- Creative - Flyers, posters, artistic documents, themed designs
- Practical - Letters, notices, forms, documentation
- Experimental - Bob Ross paintings, space themes, progressive effects
- Anything - If it's a PDF, you can build it
Examples
1. Simple Text Document
Start simple with plain text:
create-simple-pdf({
filename: "letter.pdf",
text: "Dear Customer,\n\nThank you for your business.\n\nBest regards,\nACME Corp",
title: "Customer Thank You"
})
2. Styled Document with Colors
Add visual style with colors and formatting:
create-pdf({
filename: "notice.pdf",
content: [
{
type: "heading",
text: "Community Notice",
fontSize: 24,
color: "#2C5F8D",
align: "center"
},
{
type: "text",
text: "Pool maintenance scheduled for this weekend.",
fontSize: 12,
moveDown: 2
},
{
type: "text",
text: "Questions? Contact the front desk.",
color: "#666666"
}
]
})
3. Certificate with Shapes
Combine shapes and text for visual impact:
create-pdf({
filename: "certificate.pdf",
pageSetup: {
backgroundColor: "#FFF8DC"
},
content: [
// Gold border
{
type: "rect",
x: 50,
y: 50,
width: 512,
height: 692,
strokeColor: "#DAA520",
lineWidth: 3
},
// Title
{
type: "heading",
text: "Certificate of Achievement",
fontSize: 32,
color: "#DAA520",
align: "center",
y: 200
},
// Recipient
{
type: "text",
text: "Presented to",
fontSize: 14,
align: "center",
moveDown: 2
},
{
type: "heading",
text: "Alex Quantum",
fontSize: 28,
color: "#003366",
align: "center"
}
]
})
4. Professional Resume
Handle complex structured data with JSON Resume:
generate-resume-pdf({
filename: "john-doe-resume.pdf",
resume: {
basics: {
name: "John Doe",
label: "Software Engineer",
email: "john@example.com",
phone: "(555) 123-4567",
summary: "Experienced software engineer with 5+ years building scalable web applications.",
location: {
city: "San Francisco",
region: "CA"
}
},
work: [
{
name: "Tech Corp",
position: "Senior Software Engineer",
startDate: "2021-03",
highlights: [
"Built real-time notification system",
"Reduced API response time by 60%",
"Mentored 5 junior engineers"
]
}
],
skills: [
{
name: "Languages",
keywords: ["TypeScript", "JavaScript", "Python"]
}
]
}
})
Creative Possibilities
This tool has been used to create:
- Bob Ross-style paintings - Layered shapes with colors creating landscape art
- Space-themed documents - Stars, gradients, and cosmic effects
- Apartment notices - Creative community announcements with visual flair
- Progressive effects - Font tapering, color gradients, animated-style layouts
The examples above show practical starting points, but agents can combine shapes, colors, positioning, and text to create virtually anything. The create-pdf tool provides direct access to PDFKit's capabilities.
Available Tools
generate-resume-pdf
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
Resume Schema Sections:
basics- Name, contact, summary, locationwork- Work experience with highlightseducation- Degrees and institutionsprojects- Personal/professional projectsskills- Skills grouped by categoryawards,certificates,languages,volunteer,publications,interests,references
See the resume example above for structure.
create-simple-pdf
Create basic text PDFs quickly.
Parameters:
filename(string, optional) - Filename for the PDF (defaults to "document.pdf")text(string, required) - Text contenttitle(string, optional) - Document metadata title
create-pdf
Advanced PDF creation with full layout control.
Parameters:
filename(string, optional) - Filename for the PDF (defaults to "document.pdf")title(string, optional) - Document metadataauthor(string, optional) - Document metadatapageSetup(object, optional) - Page configurationcontent(array, required) - Content items
Page Setup:
pageSetup: {
size: [612, 792], // [width, height] in points (default: Letter)
margins: { top: 72, bottom: 72, left: 72, right: 72 },
backgroundColor: "#FFFFFF"
}
Content Types:
Text & Headings:
{
type: "text", // or "heading"
text: "Content here",
fontSize: 12,
bold: true,
color: "#000000",
align: "left", // "left", "center", "right", "justify"
x: 100, // optional positioning
y: 200,
oblique: 15, // italic slant in degrees
characterSpacing: 1,
moveDown: 1, // spacing after (line heights)
underline: true,
strike: true
}
Shapes:
// Rectangle
{
type: "rect",
x: 50,
y: 50,
width: 200,
height: 100,
fillColor: "#FF0000",
strokeColor: "#000000",
lineWidth: 2
}
// Circle
{
type: "circle",
x: 300, // center X
y: 400, // center Y
radius: 50,
fillColor: "#00FF00",
strokeColor: "#000000",
lineWidth: 1
}
// Line
{
type: "line",
x1: 100,
y1: 100,
x2: 500,
y2: 100,
strokeColor: "#0000FF",
lineWidth: 2
}
Images & Pages:
// Image
{
type: "image",
imagePath: "/path/to/image.png",
width: 200,
height: 150,
x: 100, // optional positioning
y: 200
}
// Page Break
{
type: "pageBreak"
}
Emoji & Unicode Support
Color Emoji ✅
True color emoji render as inline PNG images:
{
"basics": {
"name": "John Doe 👨💻",
"summary": "Developer 💻 passionate about clean code ✨"
}
}
Emoji like 😀 🎉 🚀 👋 appear in full color. The emoji font (NotoColorEmoji.ttf) downloads automatically on install.
Unicode ✅
Full international text support:
- CJK: Chinese (你好), Japanese (こんにちは), Korean (안녕하세요)
- Scripts: Arabic (مرحبا), Cyrillic (Привет), Hebrew, Thai
- Symbols: Greek (Ξ Δ Ω), geometric (△ ○ ◆), dingbats (✓ ✗ ➤)
Resources
- PDFKit Documentation - Full PDFKit API reference
- JSON Resume Schema - Resume format documentation
- JSON Resume Editor - Online resume builder
Requirements
Node.js >= 16
License
MIT
Development & Deployment
Publishing a New Version
Two-command deployment:
# 1. Bump version (auto-syncs package.json → server.json)
npm version patch # or: minor, major
# 2. Deploy to all registries (requires 2FA code)
npm run deploy <your-2fa-code>
This script automatically:
- ✅ Builds the package
- ✅ Publishes to npm
- ✅ Pushes to GitHub
- ✅ Updates MCP Official Registry
Manual submissions after deployment:
- 🔲 Smithery: https://smithery.ai/new (if major changes)
- 🔲 mcpservers.org: https://mcpservers.org/submit (one-time)
Automatic updates (no action needed):
- ⏳ PulseMCP: Auto-discovers from npm within 24-48 hours
Registry Status
Check where the package is published:
- npm: https://www.npmjs.com/package/@mcp-z/mcp-pdf
- MCP Official: https://modelcontextprotocol.io/registry
- GitHub: https://github.com/mcp-z/mcp-pdf
- Smithery: https://smithery.ai/server/@mcp-z/mcp-pdf
- PulseMCP: https://www.pulsemcp.com/servers
- Awesome MCP: https://mcpservers.org/
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。